Re: How to use GtkCheckMenuItem?



>>>>> "Damon" == Damon Chaplin <damon ximian com> writes:

    Damon> Roland Roberts wrote:
    [...]
    >> After some trial-and-error (and poking about the GTK headers),
    >> I've discovered that using the "activate" signal and checking
    >> the status of
    >> GTK_MENU_CHECK_ITEM(object)->active is the "right" thing to do.
    >> Is this a Glade problem?

    Damon> Yes. In a GNOME application Glade only sets up the
    Damon> "activate" signal as it uses GnomeUIInfo structs to create
    Damon> the menus.  Though I don't think its too much of a problem.

The main problem comes later.  When toggling the GtkCheckMenuItem, I
display/hide a window.  The window itself has a "Close" button which
should also toggle the GtkCheckMenuItem.  The "nice" thing to do would
be to toggle the state and raise the "toggled" signal.  This would
insure that the same exact callback is used without my having to keep
track of the UI.  Instead, I call the same function and just have to
remember that if I change the signal handler I have to track down this
secondary reference....  It's hardly a show stopper; I just think
raising the signal is a cleaner way to handle this and was
surprised/disappointed that Glade let me set up the signal handler but
then didn't actually use it.

roland
-- 
		       PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD                             RL Enterprises
roland rlenter com                     76-15 113th Street, Apt 3B
rbroberts acm org                          Forest Hills, NY 11375




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