EuGTK - Segmentation fault, GtkCheckMenuItem

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

What causes the segmentation fault?

global procedure setReqs(integer r) 
atom ctl 
 
-- r is getting correct numbers. 
 
  for i = 1 to length(MenuReqs) do 
    set(MenuReqs[i],"active",0) 
  end for 
-- Each MenuReqs[i] is a GtkCheckMenuItem. 
-- All these show up in the menu bar and are clickable. 
 
  ctl = MenuReqs[r] 
 
printf(1,"after ctl  ctl=%d \n",{ctl}) --  (1) 
-- This prints a large number, as it should. 
-- But this line is executed many times, (2) below never. How? 
-- ctl is the same number each time. 
 
  set(ctl,"active",1) 
-- Segmentation fault happens here. 
-- When I comment this statement out, the segmentation fault does not happen. 
-- set(ctl,"active",TRUE) makes no difference. 
 
printf(1,"after ctl 1  r=%d \n\n",{r}) -- (2) 
-- It never gets here. 
-- How can line (1) be executed many times and line (2) never? 
 
-- more code 
 
end procedure  -- setReqs() 

This is what happens.

after ctl  ctl=327386248  
after ctl  ctl=327386248  
after ctl  ctl=327386248  
after ctl  ctl=327386248  
after ctl  ctl=327386248  
after ctl  ctl=327386248  
after ctl  ctl=327386248  
after ctl  ctl=327386248  
after ctl  ctl=327386248  
... etc ... 
Segmentation fault 
The error is invoked when I click on any of the MenuReqs[r] in the menu bar.

I've been hung up on this bug for days with zero progress. How can I make some progress with this bug?

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

Search



Quick Links

User menu

Not signed in.

Misc Menu