Re: EuGTK - Segmentation fault, GtkCheckMenuItem

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

The first one stops the segmentation fault. But how can set(), part of EuGTK, call setReqs()?

The second one goes into an endless loop without the segmentation fault, and alternating between 2 numbers.

after ctl 1  r=3  
 
after ctl  ctl=170814224  
after ctl  ctl=170814224  
after ctl  ctl=170814224  
after ctl 1  r=2  
 
after ctl 1  r=2  
 
after ctl  ctl=331504664  
after ctl  ctl=331504664  
after ctl  ctl=331504664  
after ctl 1  r=3  
 
after ctl 1  r=3  
 
after ctl  ctl=170814224  
after ctl  ctl=170814224  
after ctl  ctl=170814224  
after ctl 1  r=2  
 
after ctl 1  r=2  

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

Search



Quick Links

User menu

Not signed in.

Misc Menu