User forums > General (but related to Code::Blocks)

wxSmith, Sizers.

<< < (2/3) > >>

bdad:
It happens that in the WxSmith tutorial 6, that it mentions putting '0,1' into the growable property, (I've only just come across that) but when adding the subsequent panel, then codeblocks crashes. I guess it may have changed since the tutorial was last updated. I'll check the WxWidgets docs.

Miguel Gimenez:
I can confirm it is a comma-separated list, in fact I have just added tooltips for those fields in trunk.

The problem in 20.03 arises when you write a growable column (or row) number greater or equal than the number of columns. This is fixed in trunk.

The workaround is setting the number of columns before writing the list of growable columns or using the last nightly.

bdad:
Thanks for the further info., perhaps you can confirm what this means, (tutorial 6)
--- Quote ---... , a wxFlexGrid Sizer with two columns, both growable.(In the Growable property of the sizer, put"0,1"without the quote marks..)
--- End quote ---

There are two fields, 'Growable cols' and 'Growable rows', the way the tutorial is worded, it is not clear if you put the '0,1', in one or both fields., afaik there is not a field labeled 'Growable property',
anyway it still crashes. Did this work previously, maybe 5 or 6 years ago, when the tutorials were written, or is there a difference in platform it is run on, or do the folk who write the tutorials not have any reviewing process?

From the wxWidgets documentation, I found
--- Quote ---void wxFlexGridSizer::AddGrowableRow    (    size_t     idx,
      int     proportion = 0
   )       
--- End quote ---

The first digit in the tutorial is 0, meaning the first row/column, which is within the range of the two column sizer, but the second is a 1 which afaik means unequal sizing. which should not be a problem.

It may be best to download a recent nightly build, as you say, but with my luck...


Or, does it mean that the '1,0' is a list of rows/columns to be altered, and the tutorial should have said '... in the growable cols field, enter '0,1' to allow both columns to be grown,...'

Miguel Gimenez:

--- Quote ---the tutorial should have said '... in the growable cols field, enter '0,1' to allow both columns to be grown,...'
--- End quote ---

Correct.

wxSmith calls AddGrowableCol() for each item in the list, if any item is not a valid column index wxWidgets will show an alert. The default wxFlexGridSizer has 3 columns and 0 rows, so you can not write in the GrowableRows field until the number of rows is non-zero.

bdad:
Yes, that worked fine. Thanks for explaining. What I found in the wxWidget documents, was not quite the explanation for filling in the fields, but I worked out what it meant, thanks to your reply, just after I posted (and b4 I edited).
It'll take me awhile to get used to the sizers, not so much in what they do, but selecting them with the mouse, in particular when starting, the frame becomes a small dot once the panel and sizers are added, then when adding a component, 50/50 chance where they  go, but can use the buttons down the rhs.  Shame not possible to put in sizers to sort out the layout after components placed.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version