Computer Science Canada

GUI problem - "Assert Condition is False"

Author:  wiltongrove [ Tue Jun 12, 2007 4:15 pm ]
Post subject:  GUI problem - "Assert Condition is False"

I'm making a program for computers class similar to text twist. The point of this program is that we are supposed to use GUI buttons for the user to interact with. The problem that I have is after I enter a few words a GUI turing file opens and says the assert condition is false and the program crashes. in my program it says Dispose: widget id number "0" not found. also it seems to sometimes randomly switch the keyboard shortcuts on my buttons.

i have attached my turing file and the accompanying text file for you to look at, any help here would really be appreciated.

Author:  Valderino [ Fri Feb 01, 2013 3:35 pm ]
Post subject:  Re: GUI problem - "Assert Condition is False"

Posted Image, might have been reduced in size. Click Image to view fullscreen.

I have this issue too.

Posted Image, might have been reduced in size. Click Image to view fullscreen.

Author:  Tony [ Fri Feb 01, 2013 4:43 pm ]
Post subject:  RE:GUI problem - "Assert Condition is False"

Does that "put message" provide any useful context? If you have trouble seeing where that put is going, try replacing that line with writing "message" to a log file instead.

Failing that, you'd need to figure out from where AssertFailed function is called.

That use of XKCD was perfect!

Author:  Dreadnought [ Fri Feb 01, 2013 4:51 pm ]
Post subject:  Re: GUI problem - "Assert Condition is False"

The AssertFailed is called by the RemoveWidget procedure (line 250 in Turing X.X.X > Support > lib > gui). The function is apparently trying to remove the widget (gui element) with id 0 which does not exist. I second Tony's suggestion, try to figure out where you are in your code when this happens.

Author:  Valderino [ Mon Feb 25, 2013 11:48 am ]
Post subject:  RE:GUI problem - "Assert Condition is False"

My code appeared to work fine on other computers, so I've just changed the AssertFailed to True, not false on the advice of my teacher. Everything seems fine thus far, but I don't feel comfortable modifying Turing.

Author:  Dreadnought [ Mon Feb 25, 2013 6:38 pm ]
Post subject:  Re: GUI problem - "Assert Condition is False"

Well I've played around with the code you posted and can reproduce the problem.

1) Click a letter
2) Click Submit
3) Click a letter
4) click another letter

At this point I get the error.

Maybe this will help you figure out the cause.


: