Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 GTKMM 制作应用程序,我想知道如何从 Gtk::Table 捕获右键单击信号?
如果鼠标在 Gtk::Table 上方,如何捕捉?
所有 GTK+ 小部件都有按钮按下事件和焦点事件事件。您可以使用后者,结合它的补充 ( focus-out-event ) 来跟踪鼠标是否在小部件内。
好的,我想出了解决方案。我能够通过覆盖按钮按下事件来捕获右键单击:
virtual bool on_button_press_event(GdkEventButton* event);