1. EuGTK, routine_id

I don't know whether this is a EuGTK problem or a routine_id problem.

function onMenu_Reqs()  -- I would like to put r here. 
 
-- some code 
-- r is needed 
 
  return(0) 
end function 
for r = 1 to length(MenuReqs) do 
  connect(MenuReqs[r],"activate",call_back(routine_id("onMenu_Reqs")) 
end for 
 
-- MenuReqs is a sequence of GtkCheckMenuItems. 
-- The length of MenuReqs is unknown, because it depends on the number of *.req files. 

In the Euphoria documentation, there is no such thing as
routine_id("onMenu_Reqs", r)

So how do you do it?

new topic     » topic index » view message » categorize

2. Re: EuGTK, routine_id

Jerry_Story said...

I don't know whether this is a EuGTK problem or a routine_id problem.

function onMenu_Reqs(atom ctl, integer r)  
-- I would like to put r here. (ok ----^ there it is :) 
-- some code 
-- r is needed 
 
  return(0) 
end function 
for r = 1 to length(MenuReqs) do 
  connect(MenuReqs[r],"activate",call_back(routine_id("onMenu_Reqs"),r) 
-- all connect calls can pass one additional data item:--------------^ 
end for 
 
-- MenuReqs is a sequence of GtkCheckMenuItems. 
-- The length of MenuReqs is unknown, because it depends on the number of *.req files. 

In the Euphoria documentation, there is no such thing as
routine_id("onMenu_Reqs", r)

So how do you do it?

new topic     » goto parent     » topic index » view message » categorize

3. Re: EuGTK, routine_id

irv said...
Jerry_Story said...
  connect(MenuReqs[r],"activate",call_back(routine_id("onMenu_Reqs"),r) 
-- all connect calls can pass one additional data item:--------------^ 

Thanks.

I made a mistake combining 2 statements into 1.

connect(MenuReqs[r],"activate",call_back(routine_id("onMenu_Reqs")),r)

Works better.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu