Re: [Boa Constr] problems adding constraints
Status: Beta
Brought to you by:
riaan
From: Riaan B. <riaan@e.co.za> - 2000-09-26 02:39:03
|
Hi Wayne, "Boras, Wayne" wrote: > > Hello, > > First of all I would just like to say that I think Boa is fantastic! I cannot, however, successfully add layout constraints using Boa. Here are the problems I am having: > > 1. When new Constraints are added using the Collection Editor, the only available constraints are Left, Right, Top, Bottom. There is no way to add any other types of constraints, e.g. Width or Height. > > 2. When defining the individual Constraint, the OtherWindow cell doesn't do anything. I think this is where I should be able to specify the object that I want this constraint to be relative to, but I > am not sure. > > 3. If I fully constrain an object using Left, Right, Top and Bottom constraints, and edit the code to include the OtherWindow specification, the constraint still does not seem to work. > > If anyone could please send me an example of sucessfully implemented constraints or tell me what I'm doing wrong, I would be very appreciative. Constraints are tricky (well, for me anyway). Things to remember: Set AutoLayout of the container to true There has to be 4 valid constraints, if they don't make sense together the control usually disappears :( If you really want to use them first read up on wxLayoutConstraint and wxIndividualLayoutConstraint. The fact that you can't change the OtherWindow property is a bug. On line 783 in Views\Designer.py change def getAllObjects(self, theClass): to def getAllObjects(self): to fix this. There is currently a bug in wxPython where wxIndividualLayoutConstraint.Set() does not work for the relationship parameters wxSameAs and wxPercentOf (the most useful ones :( ) If this didn't discourage you nothing will ;) I've attached an example to show that it is actually possible to use layout constraints. I'm personally hoping for nice integration of sizers into Boa. -- Riaan >>> a='a=%s;a%%`a`';a%`a` ___________________________________________________ Boa Constructor - RAD GUI building IDE for wxPython http://boa-constructor.sourceforge.net |