User forums > General (but related to Code::Blocks)
Migrating from wxWidgets 2.8 to 2.9 I get alert about sizer generated by wxSmith
(1/1)
eranon:
Good evening. I've recently switched from wxWidgets 2.8.12 to 2.9.3 and the DEBUG target of my project (compiled with MSVC9) reports me two debug alerts : one about wx, so I've asked in wx forum and one which seems to be related to sizers. I've attached the alert box.
Also, in this page http://wiki.wxwidgets.org/Updating_to_the_Latest_Version_of_wxWidgets, it's said that :
--- Quote ---wxGridSizer and wxFlexGridSizer
In wx2.8 and earlier, if you create a 2x2 gridsizer and then add 5 items to it, wx would roll its eyes but quietly make a 5-item grid. In wx2.9 the same code will still work, but will also assert. The best solution is to ask for a 0x2 gridsizer instead. This specifies that the sizer will always have 2 columns, and the number of rows will be calculated automatically. (Alternatively a 2x0 gridsizer will specify always 2 rows.)
--- End quote ---
So, what to do ? Do I have to regenerate my GUI (I hope not :o) or is there a simple way to fix the problem through the wxSmith graphic editor ?
oBFusCATed:
How have you generated the GUI? wxSmith?
Jenna:
Did you try to set the apprpriate cols or rows to 0 or the correct size ?
We had some xrc with incorrect col/row numbers in C::B, that did not lead to an assert message, but a crash when loading the xrc (with wx2.9).
eranon:
--- Quote from: oBFusCATed on June 10, 2012, 10:09:41 pm ---How have you generated the GUI? wxSmith?
--- End quote ---
Yes, I did-it with wxSmith in a wx28-based project ; now migrated to wx29.
--- Quote ---Did you try to set the apprpriate cols or rows to 0 or the correct size ?
--- End quote ---
I have to take a look to tell you, jens. My GUI uses several BoxSizers, GridBagSizers, FlexGridSizers and StaticBoxSizers : so, I've to see all of this closer... I'll tell you...
--
EDIT#1 : well, the line the alert talks about is the 91, here :
--- Code: ---89 : GridBagSizer1 = new wxGridBagSizer(0, 0);
90 : GridBagSizer1->AddGrowableCol(2);
91 : GridBagSizer1->AddGrowableRow(3);
--- End code ---
--
EDIT #2 : well, all was about GridBagSizers. The alerts (with a "s" since I got others during modification of the UI) told me growable col(s) and row(s) were outside of possible index, while the indexes I passed were fully valids :( So, I've reagenced my GUI without any GridBagSizer (but replacing them with Flex and BoxSizers) and now it's OK :)
Navigation
[0] Message Index
Go to full version