static text and combobox in the toolbar

Hi all,

In the application I'm developping, I put some buttons (tools) and a static
text and a combobox (controls) in the toolbar.

This perfectly work under linux but under windows, the static text and the
combobox are displayed at the same place at the beginning of the toolbar on
top of the buttons...

The placement of the tools and controls in the toolbar are done in a relative
way (not absolute).

Is there some known behavior under windows like :
  * no control in toolbar
  * tools and controls have to be defined in an absolute way

Or is this due to bugs in my code :slight_smile: ?

Thanks for any tips,
-philippe

-------8<--------------------------------------
[...]
        # A Toolbar
        # using the CreatToolBar methode of the frame create a toolbar
        # that is managed by the frame (wxFrame::CreateToolBar).
        toolBar = self.CreateToolBar ()

        # Populate the toolbar with useful tools and controls :slight_smile:
        # 1) a button for compose a new message (wxITEM_NORMAL)
        toolBar.AddTool (ID_COMPOSE,
                         wxBitmap ("images/compose.png", wxBITMAP_TYPE_PNG),
                         longHelpString = "Compose a new message")
        # 2) a button for reply to a message (wxITEM_NORMAL)
        toolBar.AddTool (ID_REPLY,
                         wxBitmap ("images/reply.png", wxBITMAP_TYPE_PNG),
                         longHelpString = "Reply to this message")
        # a separator
        toolBar.AddSeparator ()
        # 3) buttons to select next message and to delete selected message
        toolBar.AddTool (ID_NEXT,
                         wxBitmap ("images/next.png", wxBITMAP_TYPE_PNG),
                         longHelpString = "select next message")
        toolBar.AddTool (ID_DELETE,
                         wxBitmap ("images/delete.png", wxBITMAP_TYPE_PNG),
                         longHelpString = "Delete selected message")
        toolBar.AddSeparator ()
        # 4) a combobox for the name with a label
        person_label = wxStaticText (toolBar, -1, "Selected :",
                                    wxPoint (0, 0))
        person_combo = wxComboBox (toolBar, ID_PERSON)
        toolBar.AddControl (person_label)
        toolBar.AddSeparator ()
        toolBar.AddControl (person_combo)

        # Adding the ToolBar to the Frame content.
        self.SetToolBar (toolBar)
[...]
-------8<--------------------------------------

Philippe Ney wrote:

Hi all,

In the application I'm developping, I put some buttons (tools) and a static
text and a combobox (controls) in the toolbar.

This perfectly work under linux but under windows, the static text and the
combobox are displayed at the same place at the beginning of the toolbar on
top of the buttons...

The placement of the tools and controls in the toolbar are done in a relative
way (not absolute).

Is there some known behavior under windows like :
  * no control in toolbar
  * tools and controls have to be defined in an absolute way

Or is this due to bugs in my code :slight_smile: ?

You don't call toolBar.Realize()

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

> Hi all,
>
> In the application I'm developping, I put some buttons (tools) and a

[...]

> * tools and controls have to be defined in an absolute way
>
> Or is this due to bugs in my code :slight_smile: ?
>

You don't call toolBar.Realize()

Yessss! It works now.

Thanks a lot,
-philippe