Re: EuGTK - Segmentation fault, GtkCheckMenuItem
- Posted by petelomax Oct 19, 2010
- 1107 views
Jerry_Story said...
What causes the segmentation fault?
I've been hung up on this bug for days with zero progress. How can I make some progress with this bug?
It looks like every time you call set() it is finding its way to call setReqs() again, causing an infinite loop and eventually running out of stack space.
Try something like this:
integer setting=0 global procedure setReqs(integer r) atom ctl if not setting then setting = 1 for i = 1 to length(MenuReqs) do set(MenuReqs[i],"active",0) end for ctl = MenuReqs[r] set(ctl,"active",1) setting = 0 end if end procedure -- setReqs()
Alternatively, this would probably fix the problem as well:
for i = 1 to length(MenuReqs) do if i!=r then set(MenuReqs[i],"active",0) end if end for
Regards, Pete