PyAUI and Customizable Tool Bars

I have noticed that when adding a toolbar to PyAUI pane and setting Resizable to True the ToolBar’s size is automatically as large as possible (like wx.EXPAND style) so manual add of another toolbar to the same row is impossible.

So I kept Resizable as False (which is ok because I prefer it that way) and here is my problem:

I have a Toolbar that the items it includes can be changed by the user so the toolbar’s size is not static.

After adding an item to the toolbar and calling toolbar.Realize() and frame._mgr.Update() [_mgr is PyAUI.FrameManager] the toolbar does include the new item, but it is not visible to the user because the size of the Toolbar’s sizer is too small.

This problem doesn’t exist when using Resizable() for obvious reasons.

This problem also doesn’t exist when not using PyAUI. [toolbar.Realize() and frame.Layout() does the work ].

Any way to by pass it and fix the size automatically as the minimum size for the current items?

Thanks,

roee88.

Never mind,

I was able to solve this by using:

pane.window.SetBestFittingSize()
pane.BestSize1(pane.window.GetBestFittingSize())

Thanks.

···

On 7/3/06, roee88 shlomo roee88@gmail.com wrote:

I have noticed that when adding a toolbar to PyAUI pane and setting Resizable to True the ToolBar’s size is automatically as large as possible (like wx.EXPAND style) so manual add of another toolbar to the same row is impossible.

So I kept Resizable as False (which is ok because I prefer it that way) and here is my problem:

I have a Toolbar that the items it includes can be changed by the user so the toolbar’s size is not static.

After adding an item to the toolbar and calling toolbar.Realize() and frame._mgr.Update() [_mgr is PyAUI.FrameManager] the toolbar does include the new item, but it is not visible to the user because the size of the Toolbar’s sizer is too small.

This problem doesn’t exist when using Resizable() for obvious reasons.

This problem also doesn’t exist when not using PyAUI. [toolbar.Realize() and frame.Layout() does the work ].

Any way to by pass it and fix the size automatically as the minimum size for the current items?

Thanks,

roee88.