Re: EuGTK - Segmentation fault, GtkCheckMenuItem

new topic     » goto parent     » topic index » view thread      » older message » newer message
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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu