I am seeing a strange bug. If I use auto layout, and anchor an object to the bottom (and not the top) of the frame, the object slowly moves up the frame every time it is reopened. Could someone point me to where in the code this is handled, so I could try to fix it?
Do you see the same thing happing in the AnchorsInBoa example (boa\examples\layout)?
BTW, why are you not using sizers?
P.S. Don't know where in the code this is handled.
Accidentally replied to my post rather than yours (see above).. Anyway, I have done some more experimentation, and it seems the problem is related to having a menubar. If I remove the menu bar from the main frame, the problem disappears.
Aha! No, AnchorsInBoa.py works fine.
I think there is something wrong with my code because the Inspector shows a different vertical size in ClientSize in Props to Size in Constr. Any idea how this mismatch might arise, and how to fix it?
The frame is pretty complicated and I did some hand-editing to the code, but I can't seem to replicate the bug in a new app..
And I'm not using sizers because I did not know of their existence when I started this project! To add them in now will mean writing the GUI from scratch again..
... By the way are there any good tutorials on sizers :) The sizer example crashes Boa on my system.
What OS and wxPython version?
Is the \boa\Examples\guide code also crashing on you?
Re-write of that tutorial is on my todo.
There are a few good pages on the wxPython wiki about sizers.
OS: Linux (debian sid)
\boa\Examples\guide works fine..
I will go and look at the wiki...
By the way, I am not 100% sure sizers will work for my project: http://tunapie.sourceforge.net
If you have the time to look at it, I would appreciate some clue as to how sizers would work with the main frame.. Would I need to have several panels? Is that even possible??
Sizers are sometimes still a bit touchy and if one does something which one should not do they can crash instead of giving a nice exception.
If you can recreate the crash and give step by step instructions on how to do it that would help a lot on resolving issues like this.
Your screen should be no problem to do with sizers. Possibly with one gridbagsizer (but I have often problems with spacing between controls with it) or by using multiple sizers. If you want me to have a go at it send me just the one file involved (werner.bruhin at free.fr) as an attachment and let me know which controls should expand when one resizes the screen (only the two big text controls?), is your app I18n - i.e do the labels need to adapt to different languages/sizes?
P.S. hopefully your controls are nicely named?!
Thanks for your offer:) I have sent you a copy of my main frame. by email. I have renamed some of the controls so they are a bit more intuitive and also added a panel..
I am not sure what info you need on the sizers crash, but essentially I can load the file, and run it, but if I open the frame designer, Boa crashes with:
Gtk-ERROR **: file gtkcontainer.c: line 2450 (gtk_container_propagate_expose): assertion failed: (child->parent == GTK_WIDGET (container))
/usr/local/bin/boa-constructor: line 3: 9398 Aborted python Boa.py
Log in to post a comment.