Debug warnings on WxMax release with Blitzmax-NG

Started by fielder, December 07, 2018, 10:12:29

Previous topic - Next topic

fielder

After 4 or 5 warnings.. the app starts... (Sheet example)
any idea?
using latest wxmax and latest blitzmax-ng

(screenshot attached)

Derron

that is a warning printed by wxidgets. Seems you are using options which should either not be used with the widget you are using - or you set an option before you should.

In the past months I had such stuff with "sizers" (gridbag and flexible sizers) which did not like to have stuff like "addGrowableCol()" called before the cols were actually added. Stuff then resulted in such warnings.


In short: check where that assert is used - and check then, where the corresponding function in wxmax is used - and then, where in your app you actually call something which calls the wxmax function which leads to the wxwidgets assert.


bye
Ron

Derron

#2
In your case the assert comes from this line:


    void SetContainerWindow(wxWindow *winParent)
    {
        wxASSERT_MSG( !m_winParent, wxT("shouldn't be called twice") );

        m_winParent = winParent;
    }


Do you use a "wxSheetSplitter" ? Else there are only two other occurrences in which this function is called.

#define WX_INIT_CONTROL_CONTAINER() \
    m_container.SetContainerWindow(this)

//and
    wxNavigationEnabled()
    {
        m_container.SetContainerWindow(this);



In all cases the error says what is the culprit: something is calling "SetContainerWindow" twice. Eg by using "wxNavigationEnabled" twice - or initializing an "wxSheetSplitter" more than one time.


Best bet is to "cut down" your app code to just the barebone "initialize my widgets" (window + widgets you use to make the warning happen). This is easier to debug then.


bye
Ron

fielder

#3
very thank you Derron!... i'm compiling the DEFAULT SAMPLE of a sheet...  sheet.bmx .. i've not made any change.

this mean that the WxMax samples will be "fixed" on future? (Brucey?)

Derron

#4
Can replicate it on my linux box - maybe I have luck when researching a bit.




Interestingly my Windows installment gets a crash (EAV) on "Local sheetSplitter:wxSheetSplitter = New wxSheetSplitter.Create(splitter, -1, 0, 0)" (so when it calls the C stuff - leading to the assert).


Edit: if I hit "continue" I see that "addchild" is called twice too. So of course another error pops up when then closing the newly opened sheet-window: as the sheet fails to get removed properly.

bye
Ron

fielder

i have also crashes on Windows... sometimes it compile right.. and sometimes bad... without any change on code.  (on release mode)

Derron

While I created an github-issue for this and also narrowed down to the exact "duplicate call" I cannot see why it should crash "here and there". Might be another issue.

Aside of wxSheet other examples should work as planned.


bye
Ron

fielder

the text.bmx sample (without any change) throws a "syntax error" (remembering the Basic on the C64)

Derron

Readonly is now a defined keyword - so the "Field readonly" should be renamed to "Field _readonly" (and other occourences in this sample code too).


bye
Ron