Re: [gtk-list] Item "deactivate"



On Tue, 22 Jun 1999, Alex Buoy wrote:

> Hi,
> 
> I want a command to be executed when deactivating the items (for instance a
> radio menu item) but I only saw the "activate" signal to connect to.

items only get selected and deselected. "deactivating" a radio menu item
actually gets toggled when it changes state, so you want to catch the
"toggled" signal introduced by the check menu item class and check the
current state.

> How can I do that?

static void
my_callback (GtkWidget *widget,
             gpointer   my_data)
{
  if (GTK_CHECK_MENU_ITEM (widget)->active)
    {
    }
  else
    {
      /* check (radio) menu item got "deactivated" */
    }
}

gtk_signal_connect (GTK_OBJECT (widget),
                    "toggled",
                    GTK_SIGNAL_FUNC (my_callback),
                    NULL);
                    

> 
> Any help would be very appreciated.
> 
> thank you.
> 
> Alex.
> 

---
ciaoTJ



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