Fighting with wxToolbar and its documentation

My newbie adventure continues with a couple more question ...

I am using wxWidgets 2.8.12 on XP, and have been using the
documentation that comes with it, I have 2 x problems

1, In 2.8.12 how do I do a InsertStretchableSpace() to push a toolbar
button to the RHS, it seems a latter addition

2, Looking at the wxPython Demo code for Toolbar (and I must be a
little dense, it seems pretty confusing to me !), I see method calls
of ...

tb.AddLabelTool(20, "Open", open_bmp, shortHelp="Open", longHelp="Long
help for 'Open'")
tb.AddSimpleTool(30, copy_bmp, "Copy", "Long help for 'Copy'")

but can find nothing referencing them in the 2.8.12 documentation, any ideas ?

Many thanks

Dave

The wxPython documentation takes a little getting used to. You usually have to go up the tree to find all the methods you want. For example, if you go to http://wxpython.org/docs/api/wx.ToolBar-class.html you won’t find those methods you want. But if you click on the next level up in the tree at the top of the page (i.e. ToolBarBase), you’ll see those methods.

I wrote a little article on all the places I use for docs: http://www.blog.pythonlibrary.org/2010/12/05/wxpython-documentation/ That might help you too. Or you can use Andrea’s alternate docs: http://xoomer.virgilio.it/infinity77/wxPython/Widgets/wx.ToolBar.html?highlight=toolbar

Hope that helps!

···

Mike Driscoll
www.mousevspython.com

That helps a lot, thank you, If I can find the docs I am on with a
chance of getting this to go :slight_smile:

Cheers

Dave

···

On 24 February 2012 16:34, Mike Driscoll <kyosohma@gmail.com> wrote:

The wxPython documentation takes a little getting used to. You usually have
to go up the tree to find all the methods you want. For example, if you go
to wxPython API Documentation — wxPython Phoenix 4.2.2 documentation you won't find those
methods you want. But if you click on the next level up in the tree at the
top of the page (i.e. ToolBarBase), you'll see those methods.

I wrote a little article on all the places I use for docs:
wxPython Documentation - Mouse Vs Python That
might help you too. Or you can use Andrea's alternate docs:
http://xoomer.virgilio.it/infinity77/wxPython/Widgets/wx.ToolBar.html?highlight=toolbar

Hope that helps!

-------------------
Mike Driscoll
www.mousevspython.com

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

--

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

You might find these helpful too:

···

Mike Driscoll
www.mousevspython.com

Thanks again, adding to my list of bookmarks,

···

On 24 February 2012 16:47, Mike Driscoll <kyosohma@gmail.com> wrote:

You might find these helpful too:

http://zetcode.com/wxpython/menustoolbars/
http://www.blog.pythonlibrary.org/2008/07/02/wxpython-working-with-menus-toolbars-and-accelerators/

-------------------
Mike Driscoll
www.mousevspython.com

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

--

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html


My newbie adventure continues with a couple more question ...
I am using wxWidgets 2.8.12 on XP, and have been using the
documentation that comes with it, I have 2 x problems
1, In 2.8.12 how do I do a InsertStretchableSpace() to push a toolbar
button to the RHS, it seems a latter addition
2, Looking at the wxPython Demo code for Toolbar (and I must be a
little dense, it seems pretty confusing to me !), I see method calls
of ...
tb.AddLabelTool(20, "Open", open_bmp, shortHelp="Open", longHelp="Long
help for 'Open'")
tb.AddSimpleTool(30, copy_bmp, "Copy", "Long help for 'Copy'")
but can find nothing referencing them in the 2.8.12 documentation, any ideas ?
Many thanks
Dave
One of the most useful tricks is available to wxPython programmers,

but not to wxC programmers, and it is python itself, try doing the
following:
python
Python 2.6 (r26:66721, Oct 2 2008, 11:35:03) [MSC v.1500 32 bit
(Intel)] on win
32
Type “help”, “copyright”, “credits” or “license” for more
information.
>>> import wx
>>> tb=wx.ToolBar
>>> dir(tb)
[‘AcceleratorTable’, ‘AcceptsFocus’, ‘AcceptsFocusFromKeyboard’,
‘AddCheckLabelT
ol’, ‘AddCheckTool’, ‘AddChild’, ‘AddControl’, ‘AddLabelTool’,
'AddPendingEvent
, ‘AddRadioLabelTool’, ‘AddRadioTool’, ‘AddSeparator’,
‘AddSimpleTool’, 'AddToo
‘, ‘AddToolItem’, ‘AdjustForLayoutDirection’, ‘Alignment’,
‘AssociateHandle’, ’
utoLayout’, ‘BackgroundColour’, ‘BackgroundStyle’, ‘BestSize’,
'BestVirtualSize
, ‘Bind’, ‘Border’, ‘CacheBestSize’, ‘CanSetTransparent’,
‘CaptureMouse’, * long list of all the methods and members
results* ]
>>> help (tb.AddSimpleTool)

Help on method AddSimpleTool in module wx._controls:

AddSimpleTool(self, id, bitmap, shortHelpString='',

longHelpString=‘’, isToggle=

0) unbound wx._controls.ToolBar method

    Old style method to add a tool to the toolbar.

and so on, of course help(tb) shows the lot, one screen at a time.

Gadget/Steve
···

On 24/02/2012 4:29 PM, dave selby wrote:

It was added in 2.9.

···

On 2/24/12 8:29 AM, dave selby wrote:

My newbie adventure continues with a couple more question ...

I am using wxWidgets 2.8.12 on XP, and have been using the
documentation that comes with it, I have 2 x problems

1, In 2.8.12 how do I do a InsertStretchableSpace() to push a toolbar
button to the RHS, it seems a latter addition

--
Robin Dunn
Software Craftsman