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

Re: infinite loop by toggle button



On Wed, Apr 03, 2002 at 11:42:30AM +0900, Kang Jeong-Hee wrote:
> I made a toggle button to toggle visiblity of a dialog.
> 
> give signal handler of "toggled",
> the callback check GTK_WIDGET_VISIBLE(dialog) to show or hide.
> and set active button itself.
> 
> here is the trouble infinite.
> 1. click to toggle button.
> 2. callback comes up.
> 3. set active button itself.
> 4. the button face "toggle" signal.
> 5. infinite to 2.
> 
> how can I solve this problem?
> I wanted to sync button's toggle status with visibility of dialog.
> (if toggle is on, visible. if off, hidden)
> 
> thanks.
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
---end quoted text---

Why are you toggling the button itself?
Here's a function that I did for the same action:

void on_Lyric_toggled (GtkToggleButton * togglebutton, gpointer user_data)
{
        if (!gtk_toggle_button_get_active (togglebutton))
                gtk_widget_hide (LyricWindow);
        else
                gtk_widget_show (LyricWindow);
}

And then I attached LyricWindow's close signal to another function that will
toggle the button and hide the window instead destroying it.

[]'s
-- 
Marcelo R Leitner <mrl@netbank.com.br>
ICQ #: 29966851



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