Re: Creating widgets with auto-repeat



Thanks to Pauk for the pointers on how to make my autorepeat
code a bit more elegant, but having looked at the suggestions
I'm a bit puzzled...

    info->value++;
    info->count = 0;
    info->state = 0;
    info->timer_id = gtk_timeout_add(REPEAT_STAGE0_DELAY, 
                                      (GtkFunction)timer_func, info);

The "gtk_timeout_add" line doesn't work, becasue you're *passing*
the value of info->timer *before* it gets assigned.  Hence the timeout
function doesn't know the ID of the timer....

This was why I resorted to globals! :-)


-- 
David J. Singer
doc deadvirgins org uk
"Time flies like an arrow, fruit flies like a banana"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]