Re: [glade--]radiobutton "clicked" signal handler



Syed Sajjad Lateef wrote:
On Wed, 29 May 2002, Christof Petig wrote:


Syed Sajjad Lateef wrote:

1. I would like only B's signal handler called when B is clicked. I don't
want to have the signal handler for A called. How can I do this?

Please ask on the gtkmm mailing list and then tell me, too. I'd love to know myself, but didn't find the time to ask or investigate.


Thanks, Christof. And, Thank You, for creating and maintaining glademm. After further investigation, I created a separate Gtk::RadioButton::Group object for each radio button. This ensured that the signal for each radio button was sent only to that button.

You seem to be looking for a checkbutton. checkbuttons don't have groups. Perhaps even a button will fit your needs (a button has no state: active/inactive aka pressed in, released out).


Initially, I tried assigning 'user_data' to each button and then accessing
the 'user_data' from each callback function. I was hoping that only the user_data for the button that was clicked would be sent to both buttons. But, no, different user_data (corresponding to each button) was sent to those buttons.

Of course, data belongs to a connect and is only sent to that callback.


I realize that this is a non-standard way of using the radio button. But,
I need circular "active" areas for an imagemap. Until I can figure out a
way to do an imagemap correctly in Gtk--/glademm, I am using the circular
radiobuttons to define the active areas of the imagemap (therefore, a
different theme would not be of much help).

I think using an image (there is danger with glade-1: you can't assign a file. And there are problems with gtkmm1.2: I wasn't able to load a xpm into an image with three or four lines of code and finally gave up - not too interesting once gtkmm-2 support works well.) and connecting to button press/button_release (event.x and event.y tell you the relative position) would the way to go.

 Yours
    Christof





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