[ repeat message] toggle button: clicked == toggled, and vice versa



Pardon the remailing, but I would really appreciate some feedback on this
from the GTK folk. I am happy to do the work to fix this problem, but its 
not worth it if its not going to be accepted into the mainstream GTK+.

--p

------- Forwarded Message

Date:    Sun, 16 Jan 2000 08:22:37 -0500
From:    Paul Barton-Davis <pbd@Op.Net>
To:      gtk-list@redhat.com
Subject: [gtk-list] Re: how to set toggle/radio buttons without "clicked"

>    You can use
>        gtk_signal_handler_block_by_func(GtkObject *, GtkSignalFunc *,
>gpointer)
>    (the func and the data pointer must be equal to the correponding
>gtk_signal_connect()
>    parameters)
>
>    Or
>        gtk_signal_handler_block_by_data(GtkObject *, gpointer)
>    (the data parameter must be the same as in the gtk_signal_connect()
>call)

Yes, but as I think you understand, this also involves knowing the
specific signal connection(s) I want to block. I can't know that.

All I really want is a way to set a button to be "active" without
making it appear that there was user interaction.

The error, I think, is that toggle buttons have 2 signals, but anytime
you generate 1, you also generate the other. It seemed to me from
reading the docs that one could connect to "toggled" instead of
"clicked", and would then *every* change to the button
state. Alternatively, one could connect to "clicked", and see only
those changes caused by a mouse click.

Instead, the function that handles a pure toggle causes "clicked" to
be sent. This seems like a mistake to me. The button has not been
clicked, its been toggled, and so you're sending the wrong signal ...

"clicked" should be reserved for the completion of a button release
event. 

Comments ?

>    BTW, it should be nice to have a
>        gtk_signal_handler_xxx_by_name(GtkObject *, const gchar *)
>    where xxx is disconnect, block, unblock or pending.

Yes, indeed it would. Owen, etc: if someone writes this (these?) will
you accept them into GTK ?

- --p






- -- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null



------- End of Forwarded Message



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