[wxPython-users] ANN: wxPython 2.8.4.2

Werner F. Bruhin werner.bruhin at free.fr
Sat Aug 11 00:53:50 PDT 2007


Robin,

Robin Dunn wrote:
> Werner F. Bruhin wrote:
>
>> I see something similar on Windows Vista, Python 2.5, wxPython =

>> 2.8.4.2 ansi.
>>
>> The demo looks fine but in my application I have a toolbar on a panel =

>> and the background on that looks strange around the =

>> buttons/controls.  The theme color on Vista for the toolbar (i.e. in =

>> the demo) is blue at the bottom going to white on the top, but on the =

>> toolbar which is attached to the panel the panel color "shows =

>> through" around the controls on the toolbar which looks very ugly.  I =

>> worked around this by setting the toolbar background to the =

>> background of the panel.
>
> Does this happen with 2.8.4.0?  I don't remember any recent changes =

> that might have an effect like this, but I could be wrong.
With 2.8.4.0 the background was the same color as is used for wx.Panel, =

with 2.8.4.2 it is using the same as the menubar.
>
>
>> I am a bit short on time, but if needed I can try and put a sample =

>> together over the weekend.
>
> That would help but since I don't have Vista yet it won't be helping =

> me.  ;-).  You should create a "wxMSW Specific" bug report about this, =

> and maybe attach some screen shots too.
Attached is a small sample using copy/paste from the demo and attaching =

the toolbar to the panel instead of the frame (it needs images.py from =

the demo).  I also attach two screen shots, one running it with 2.8.4.0 =

and one with 2.8.4.2 and in the later you see that above and below the =

combobox is the wx.Panel background color instead of what the toolbar uses.

Submitted with ID: 1772120

Werner


-------------- next part --------------
A non-text attachment was scrubbed...
Name: toolbarbackground2842.png
Type: image/png
Size: 17361 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20070=
811/fc2288cb/toolbarbackground2842.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: toolbarbackground2840.png
Type: image/png
Size: 18907 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20070=
811/fc2288cb/toolbarbackground2840.png
-------------- next part --------------
#Boa:Frame:Frame1

import wx

import  images

TBFLAGS =3D ( wx.TB_HORIZONTAL
            | wx.NO_BORDER
            | wx.TB_FLAT
            #| wx.TB_TEXT
            #| wx.TB_HORZ_LAYOUT
            )


def create(parent):
    return Frame1(parent)

[wxID_FRAME1, wxID_FRAME1PANEL1, =

] =3D [wx.NewId() for _init_ctrls in range(2)]

class Frame1(wx.Frame):
    def _init_sizers(self):
        # generated method, don't edit
        self.boxSizer1 =3D wx.BoxSizer(orient=3Dwx.VERTICAL)

        self.panel1.SetSizer(self.boxSizer1)


    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Frame.__init__(self, id=3DwxID_FRAME1, name=3D'', parent=3Dprnt,
              pos=3Dwx.Point(684, 280), size=3Dwx.Size(400, 250),
              style=3Dwx.DEFAULT_FRAME_STYLE, title=3D'Frame1')
        self.SetClientSize(wx.Size(384, 214))

        self.panel1 =3D wx.Panel(id=3DwxID_FRAME1PANEL1, name=3D'panel1', p=
arent=3Dself,
              pos=3Dwx.Point(0, 0), size=3Dwx.Size(384, 214),
              style=3Dwx.TAB_TRAVERSAL)

        self._init_sizers()

    def __init__(self, parent):
        self._init_ctrls(parent)
        =


        tb =3D wx.ToolBar(self.panel1, -1, style=3DTBFLAGS)
        =

        self.boxSizer1.AddWindow(tb, flag=3Dwx.EXPAND)

##        tb =3D self.CreateToolBar(TBFLAGS) # if one uses this instead of =
the above two lines then it looks o.k.
        tsize =3D (24,24)
        new_bmp =3D  wx.ArtProvider.GetBitmap(wx.ART_NEW, wx.ART_TOOLBAR, t=
size)
        open_bmp =3D wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_TOOL=
BAR, tsize)
        copy_bmp =3D wx.ArtProvider.GetBitmap(wx.ART_COPY, wx.ART_TOOLBAR, =
tsize)
        paste_bmp=3D wx.ArtProvider.GetBitmap(wx.ART_PASTE, wx.ART_TOOLBAR,=
 tsize)

        tb.SetToolBitmapSize(tsize)
        =

        #tb.AddSimpleTool(10, new_bmp, "New", "Long help for 'New'")
        tb.AddLabelTool(10, "New", new_bmp, shortHelp=3D"New", longHelp=3D"=
Long help for 'New'")

        #tb.AddSimpleTool(20, open_bmp, "Open", "Long help for 'Open'")
        tb.AddLabelTool(20, "Open", open_bmp, shortHelp=3D"Open", longHelp=
=3D"Long help for 'Open'")

        tb.AddSeparator()
        tb.AddSimpleTool(30, copy_bmp, "Copy", "Long help for 'Copy'")

        tb.AddSimpleTool(40, paste_bmp, "Paste", "Long help for 'Paste'")

        tb.AddSeparator()

        #tool =3D tb.AddCheckTool(50, images.getTog1Bitmap(), shortHelp=3D"=
Toggle this")
        tool =3D tb.AddCheckLabelTool(50, "Checkable", images.getTog1Bitmap=
(),
                                    shortHelp=3D"Toggle this")

        tb.AddSeparator()
        cbID =3D wx.NewId()

        tb.AddControl(
            wx.ComboBox(
                tb, cbID, "", choices=3D["", "This", "is a", "wx.ComboBox"],
                size=3D(150,-1), style=3Dwx.CB_DROPDOWN
                ))

        tb.AddSeparator()

        # Final thing to do for a toolbar is call the Realize() method. This
        # causes it to render (more or less, that is).
        tb.Realize()



if __name__ =3D=3D '__main__':
    app =3D wx.PySimpleApp()
    frame =3D create(None)
    frame.Show()

    app.MainLoop()


More information about the wxpython-users mailing list