Best ToolBar for a panel?

Hey there.

I’m trying to add a ToolBar to a panel, and am wondering if anyone has any tips. I see that [FRAME].CreateToolBar works really for a frame…but what about a panel?

I’m guessing that I could use a wxToolBar right? I’m wanting to add it to the bottom of my panel.

Any ideas would be great,

Matt

Matt Graham wrote:
I'm trying to add a ToolBar to a panel, and am wondering if anyone has
any tips. I see that [FRAME].CreateToolBar works really for a
frame...but what about a panel?

wxFrame.CreateToolbar is a utility function for putting a toolbar on a
frame. It just handles some of the geometry mangement for you, but it
uses wxToolBar.

I'm guessing that I could use a wxToolBar right? I'm wanting to add
it to the bottom of my panel.

Exactly. Use wxToolBar, and manage it's location yourself, just like any
other Widget (sizers, etc.)

I worked up an example of this once, with the intention of putting it in
the Wiki, maybe I'll do that now....stay tuned...

-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

Chris Barker wrote:

Matt Graham wrote:
I'm trying to add a ToolBar to a panel, and am wondering if anyone has
any tips. I see that [FRAME].CreateToolBar works really for a
frame...but what about a panel?

wxFrame.CreateToolbar is a utility function for putting a toolbar on a
frame. It just handles some of the geometry mangement for you, but it
uses wxToolBar.

I'm guessing that I could use a wxToolBar right? I'm wanting to add
it to the bottom of my panel.

Exactly. Use wxToolBar, and manage it's location yourself, just like any
other Widget (sizers, etc.)

Be aware that there has been some recent messages on wx-dev about a potential problem on wxGTK with doing this. I think a patch was submitted, but hasn't been applied yet...

Another possibility is to just use a row of bitmap buttons (and/or other widgets) on the panel using a sizer for layout.

···

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