python-2.7user-interfacewxpythontoolbarwxnotebook

wxPython Toolbook/Toolbar, blank space between toolbar and frame


Line between toolbar and frame

The screenshot is a snip of the left side of my main frame. This frame has a toolbook at the top. I've set the background color of both the toolbar in the toolbook and the frame to 0,0,0 but, as you can see, there is a small blank line between the two. How do I get that line gone or how do I make it black, as well?

As a quick side question -- is there a way to change the color of the "selected" halo on the toolbar to something a bit more contrasted for black? You can see the very faint blue halo around that first icon, I'd like that to be a much lighter blue, if possible.

EDIT: Code added --

il = wx.ImageList(128, 128)
        for tab in self.package.vars["tabs"]:
            il.Add(wx.Image(self.package.vars["iconPath"].format(tab), wx.BITMAP_TYPE_PNG).ConvertToBitmap())
        self.AssignImageList(il)
        imageIdGenerator = self.getNextImageID(il.GetImageCount())

        pages = [(wx.Panel(parent = self.parent, id = wx.ID_ANY), name.capitalize()) for name in self.package.vars["tabs"]]
        imID = 0
        toolbar = self.GetToolBar()
        toolbar.SetBackgroundColour(self.package.vars["bgColor"])
        toolbar.AddStretchableSpace()
        for page, label in pages:
            self.AddPage(page, label, imageId=imageIdGenerator.next())
            page.SetBackgroundColour(c.COLORS["green"])
            imID += 1
        toolbar.AddStretchableSpace()

Solution

  • pages = [(wx.Panel(parent = self.parent, id = wx.ID_ANY), name.capitalize()) for name in self.package.vars["tabs"]]
    

    maybe this wx.Panel in the list comprehension still has the default color. what happens if you apply SetBackgroundColour to these panels as well?

    (edit)

    How about removing that boarder space by

    self.SetInternalBorder(0)

    self here is Toolbook class. It seems to work on wxPython Demo Toolbook example.