Author Topic: Debug warnings on WxMax release with Blitzmax-NG  (Read 125 times)

Offline fielder

  • Jr. Member
  • **
  • Posts: 38
Debug warnings on WxMax release with Blitzmax-NG
« on: December 07, 2018, 10:12:29 AM »
After 4 or 5 warnings.. the app starts... (Sheet example)
any idea?
using latest wxmax and latest blitzmax-ng

(screenshot attached)

Offline Derron

  • Hero Member
  • *****
  • Posts: 1501
Re: Debug warnings on WxMax release with Blitzmax-NG
« Reply #1 on: December 07, 2018, 12:09:27 PM »
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

Offline Derron

  • Hero Member
  • *****
  • Posts: 1501
Re: Debug warnings on WxMax release with Blitzmax-NG
« Reply #2 on: December 07, 2018, 12:20:19 PM »
In your case the assert comes from this line:
Code: [Select]

    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.
Code: [Select]
#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

Offline fielder

  • Jr. Member
  • **
  • Posts: 38
Re: Debug warnings on WxMax release with Blitzmax-NG
« Reply #3 on: December 08, 2018, 09:30:44 AM »
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?)

Offline Derron

  • Hero Member
  • *****
  • Posts: 1501
Re: Debug warnings on WxMax release with Blitzmax-NG
« Reply #4 on: December 08, 2018, 12:05:07 PM »
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

Offline fielder

  • Jr. Member
  • **
  • Posts: 38
Re: Debug warnings on WxMax release with Blitzmax-NG
« Reply #5 on: December 09, 2018, 03:06:01 PM »
i have also crashes on Windows... sometimes it compile right.. and sometimes bad... without any change on code.  (on release mode)

Offline Derron

  • Hero Member
  • *****
  • Posts: 1501
Re: Debug warnings on WxMax release with Blitzmax-NG
« Reply #6 on: December 09, 2018, 08:55:21 PM »
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

Offline fielder

  • Jr. Member
  • **
  • Posts: 38
Re: Debug warnings on WxMax release with Blitzmax-NG
« Reply #7 on: December 10, 2018, 07:40:08 PM »
the text.bmx sample (without any change) throws a "syntax error" (remembering the Basic on the C64)

Offline Derron

  • Hero Member
  • *****
  • Posts: 1501
Re: Debug warnings on WxMax release with Blitzmax-NG
« Reply #8 on: December 10, 2018, 07:50:31 PM »
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