Questions about Gtk::Toolbar


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:


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:
The minimized program is here:

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.


Tao Wang

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