From: Kent D. <ke...@st...> - 2001-09-30 18:20:50
|
Takaaki Tateishi wrote: > If you'd like to get non-nil value, give the data like this: > > @transactionlist.callback(somedata){ ... } Well, the problem was, that transactionlist is a Fltk::HoldBrowser, which has one callback, but a list of entries. Maybe I've misunderstood Fltk on this part, since the obvious, useful thing for me when I have a select callback, is the structure it represents and not some toplevel object assosiated solely with the Browser... If I think hard about it, I realize that it would break the way callbacks work everywhere else in FLTK where 1 widget -> 1 callback -> 1 user data. > Here is a part of FLTK manual: > > Each line contains a null-terminated string of text and a void * data pointer. > The text string is displayed, the void * pointer can be used by the callbacks > to reference the object the text describes. > > If I don't misunderstand, I think this description mention > something like "a.data(a.value)" in your code, > and the void * pointer (= "a.data(a.value)") *can* be used > in the callback block. I'll buy that now. When I read "void * pointer can be used by callbacks" before I just assumed that it was the closest pointer to the callback, the one it gets as an argument... I'm off to kick myself a bit now :-) -- <[ Kent Dahl ]>================<[ http://www.stud.ntnu.no/~kentda/ ]> )____(stud.techn.;ind.øk.data)||(softwareDeveloper.at(Trustix))_( /"Opinions expressed are mine and not those of my Employer, "\ ( "the University, my girlfriend, stray cats, banana fruitflies, " ) \"nor the frontal lobe of my left cerebral hemisphere. "/ |