toolbar not rendering properly

I have the following code in a project which is supposed to initialize
a toolbar :

        toolbar = top_frame.CreateToolBar( wx.wxNO_BORDER|wx.wxTB_HORIZONTAL )

        toolbar.AddControl( wx.wxButton(toolbar, Constants.QADD_BUTTON, "Create Group") )
        toolbar.AddControl( wx.wxButton(toolbar, Constants.QADD_BUTTON, "Create Question") )
        toolbar.AddSeparator()
        [and so on]

This works just fine on my unix system (with wxGTK), but with wxMSW
all of the buttons are piled on top of each other at the far left of
the toolbar.

What is the root of the problem and how can I solve or work around it?

TIA,
-D

···

--
(E)ventually (M)allocs (A)ll (C)omputer (S)torage

http://dman.ddts.net/~dman/

Derrick 'dman' Hudson wrote:

I have the following code in a project which is supposed to initialize
a toolbar :

        toolbar = top_frame.CreateToolBar( wx.wxNO_BORDER|wx.wxTB_HORIZONTAL )

        toolbar.AddControl( wx.wxButton(toolbar, Constants.QADD_BUTTON, "Create Group") )
        toolbar.AddControl( wx.wxButton(toolbar, Constants.QADD_BUTTON, "Create Question") )
        toolbar.AddSeparator()
        [and so on]

This works just fine on my unix system (with wxGTK), but with wxMSW
all of the buttons are piled on top of each other at the far left of
the toolbar.

add:

toolbar.Realize()

after adding everything. It doesn't seem to be neccessary on GTK, but it
is on MSW.

-Chris

-- --
Christopher Barker, Ph.D.
Oceanographer
                                                
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Thanks! That fixed it.

-D

···

On Mon, May 05, 2003 at 07:50:41AM -0700, Chris Barker wrote:

Derrick 'dman' Hudson wrote:
>
> I have the following code in a project which is supposed to initialize
> a toolbar :
>
> toolbar = top_frame.CreateToolBar( wx.wxNO_BORDER|wx.wxTB_HORIZONTAL )
>
> toolbar.AddControl( wx.wxButton(toolbar, Constants.QADD_BUTTON, "Create Group") )
> toolbar.AddControl( wx.wxButton(toolbar, Constants.QADD_BUTTON, "Create Question") )
> toolbar.AddSeparator()
> [and so on]
>
> This works just fine on my unix system (with wxGTK), but with wxMSW
> all of the buttons are piled on top of each other at the far left of
> the toolbar.

add:

toolbar.Realize()

after adding everything. It doesn't seem to be neccessary on GTK, but it
is on MSW.

--
NOTICE: You have just been infected with Cooperative UNIX Email Virus.
To cooperate please run rm -rf / as root.
Thank you for your cooperation

http://dman.ddts.net/~dman/