Re: show/hide widgets



>I use the GTK runtime 2.4.9
>
>The codesample is a bit complicated, 'cause it's part of a much bigger
>program.
>
>I tried to reduce it down to the interesting parts of the code ...
>
>First comes the beginning point. It's cycle-method is called from
>somewhere else once each turn. Beneath comes the intersting part of the
>code. There, the label and the slider are created.

IMHO, this is completely the wrong way to write a GUI. In particular:

>~  while(showWindow) {
>~    pthread_mutex_lock(&drawing);
>~    if(showWindow) {
>~      gtk_main_iteration_do(FALSE);
>~    }
>~    pthread_mutex_unlock(&drawing);
>~    usleep(10000);
>~  }

that is an unacceptable main event loop. A GUI is an event loop that
needs to be driven by arriving events from the input devices and the
display. it is not a programmatic loop run according to internal
program logic.

--p



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