Questions about Gtk::Toolbar
- From: Tao Wang <dancefire gmail com>
- To: gtkmm-list gnome org
- Subject: Questions about Gtk::Toolbar
- Date: Thu, 12 Aug 2010 15:13:25 +1000
I created a window with toolbar by UIManager and Gtk::Builder. I want to have a feature that when user press mouse button at any place within the window, and move the mouse with button pressed, the window will also moved, just like what we do on press and move on title bar. (The window doesn't have a titlebar and border)
The Window contains a Toolbar and a Label. I set the event mask of Window to:
"GDK_POINTER_MOTION_MASK | GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK"
And override the function: on_button_press_event() and on_motion_notify_event().
Now, I can press mouse button on the Label and drag the Window to move, however, I cannot do the samething on Toolbar. When I press and move mouse on Toolbar, I found "on_motion_notify_event()" cannot receive the GDK_BUTTON1_MASK from event->state. Does Toolbar stop the GDK_BUTTON1_MASK? I tried set event mask of Toolbar, but it doesn't work. How should I let "on_motion_notify_event()" successfully receive the event?
The glade file I used is here: http://pastebin.com/38G43AKp
The minimized program is here: http://pastebin.com/4vk0fMLc
I also have a problem on the button in the Toolbar with Stock Id: "gtk-media-play", it's disabled by default. Could anyone tell me why? and should I have to set it sensitive to use? And what else Stock items are disabled?
Thank you in advance.
] [Thread Prev