Re: [gtk-list] Re: toggle button
- From: Havoc Pennington <rhpennin midway uchicago edu>
- To: Alexander Kotelnikov <sacha AK2614 spb edu>
- cc: gtk-list redhat com
- Subject: Re: [gtk-list] Re: toggle button
- Date: Sat, 30 Jan 1999 17:07:52 -0600 (CST)
On Sun, 31 Jan 1999, Alexander Kotelnikov wrote:
> ...
> void quit(GtkObject *widget)
> {
> gtk_main_quit();
> gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),FALSE);
> }
>
> explanations
> I use 'button' many times, 'loop_button' only once. I need my program
> exiting just after pressing "Quit" button, it works only if "Loop" button
> is not toggled (I think that's because "loop" function have many things to
> do:), so I want my Quit buton to untoggle loop_button ("loop" function
> works while(GTK_TOGGLE_BUTTON (widget)->active)) and then I want to
> gtk_main_quit BUT I had to swap this actions, 'cos another way I get many
> Gtk/Gdk 'messages' after exiting.
>
This is just a mess. Try keeping a separate bool which reflects the toggle
button's state; that will cause you less problems. Better: connect to
"toggled" on the toggle button, start or stop your loop when it's toggled.
That way you aren't chewing CPU checking the bool over and over.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]