Is there an equivalent of a Layout method for Toolbars?
I have a StaticText in a toolbar and while SetLabel seems to update
the label, if the label changes length it wont move any items to the
right of it to compensate for the different label.
The only ways I've found is to call .AddControl again, which although
works then causes problems for methods like ClearTools or RemoveTool
which presumably destroy the tool object then have a problem when
trying to destroy the tool on the subsequent times from where
AddControl was called.
The other way I've found is to call ClearTools and then add everything
again and call Realize, but this is very clunky and on Mac the toolbar
disappears, making the frame smaller at which point the toolbar drops
back down causing the whole frame to pulse.
Is there an equivalent of a Layout method for Toolbars?
I have a StaticText in a toolbar and while SetLabel seems to update
the label, if the label changes length it wont move any items to the
right of it to compensate for the different label.
The only ways I've found is to call .AddControl again, which although
works then causes problems for methods like ClearTools or RemoveTool
which presumably destroy the tool object then have a problem when
trying to destroy the tool on the subsequent times from where
AddControl was called.
The other way I've found is to call ClearTools and then add everything
again and call Realize, but this is very clunky and on Mac the toolbar
disappears, making the frame smaller at which point the toolbar drops
back down causing the whole frame to pulse.
Is there an easy way to do this that I'm missing?
IIRC it should work to just make your changes and then call Realize again. However since you are changing a widget I'm less sure about it.
Is there an equivalent of a Layout method for Toolbars?
I have a StaticText in a toolbar and while SetLabel seems to update
the label, if the label changes length it wont move any items to the
right of it to compensate for the different label.
The only ways I've found is to call .AddControl again, which although
works then causes problems for methods like ClearTools or RemoveTool
which presumably destroy the tool object then have a problem when
trying to destroy the tool on the subsequent times from where
AddControl was called.
The other way I've found is to call ClearTools and then add everything
again and call Realize, but this is very clunky and on Mac the toolbar
disappears, making the frame smaller at which point the toolbar drops
back down causing the whole frame to pulse.
Is there an easy way to do this that I'm missing?
IIRC it should work to just make your changes and then call Realize again.
However since you are changing a widget I'm less sure about it.
I just gave it a go but that doesn't appear to have an effect
I put together a quick demo with the methods I've found that work but
unfortunately I can't use any of the methods there as they are, I put
in a constant METHOD in to try the different ways
Because in my code I change the StaticText label quite often I don't
want the visual effect of METHOD 3. Not very often I need to change
the labels on all the tools (when the user changes the application
language) I couldn't find a way to change the labels on the
CheckLabelTools, so for this I use ClearTools and add them again - but
METHOD 2 breaks ClearTools so this prevents me from using this method.
I guess if I can find a solution to any one of these 3 things I will be ok;
1. Remove all the tools without using ClearTools method, I guess with
either RemoveTool or DeleteTool (then I can use method 2 that calls
AddControl multiple times and breaks ClearTools)
2. Hide the visual effect of ClearTools + adding tools, then I can do
this every time I want to update the label
3. If I can update the labels of the CheckLabelTools I wont ever need
to remove them, then I can use the AddControl trick on the label
I can't quite seem to get it but I'm sure there's a a way!
Would you mind taking a look at the demo and see if you can think of anything?
--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.