Thanks Albrecht for taking the time to go through the long post, i am printing
out the advice as i get it and adding to my little FLTK folio, i find it easier
to refer to when referencing it against the test folder examples and the code
examples i have been given here.
I really thought higher level programming was supposed to be easier haha, its
not that so much as new concepts, and methodology to get things done i suppose
though.
also this is good exercise in itself as i am being obliged to use code
constructs and types that i would not normally. (read: "would avoid like plague
as too complicated"...!haha)
But like Colombo...'just one more thing..' >
button->callback(button_cb);
why only one argument in this?
when below:
void Fl_Widget::callback (Fl_Callback *cb, void *p);
>
> This means that calling:
>
> window->callback(win_cb,(void *)button);
>
> is the same as:
>
> window->callback(win_cb); // is this the same as your
> button->callback(button_cb) call?
//and that it also effectively implies
window->user_data(etc?)
> window->user_data((void *)button);
i just need the weekend properly wostudying this and i should be on my way. As
i am confident it is easy to build the rest of my existing code into it once
the events stuff is less daunting.
the 'input' example in the test folder seems a very useful one due to the
various callback types it illustrates, however a couple of the statements are
pretty complex, (to me at least) could you perhaps decipher this one?
int when = 0;
Fl_Input *input[5];
void toggle_cb(Fl_Widget *o, long v) {
if (((Fl_Toggle_Button*)o)->value()) when |= v; else when &= ~v; //this line!
(from 'when', i understand the part in the if())
for (int i=0; i<5; i++) input[i]->when(when);
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk