Catching right-click for all widgets in a GtkBox
- From: John Lindgren <john lindgren tds net>
- To: gtk-app-devel-list gnome org
- Subject: Catching right-click for all widgets in a GtkBox
- Date: Sat, 28 May 2011 10:56:44 -0400
Hi,
This question seems to have been asked before [1] and never really
solved. The scenario is as follows. I have a GtkBox acting as a
toolbar and holding various widgets (buttons, a slider, a label, and a
volume slider), some of which may be hidden at times. I want to show a
pop-up menu when the user right-clicks anywhere in the toolbar. I can
connect to the "button-press-event" signal on all the buttons, and I can
further put the entire GtkBox within a GtkEventBox to catch the
"button-press-event" on any unused space. But this gives somewhat
erratic behavior. For one thing, when a button is insensitive, neither
the button nor the event box receive the signal. For another,
right-clicking on the slider sends the signal to the event box, but
afterwards, calls to gtk_range_set_value have no effect on the slider.
I'm thinking there must be a cleaner way to do this, which I've missed.
-- John
[1] http://www.mail-archive.com/gtk-list gnome org/msg28370.html
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]