Why button press event only reacts on double click?
- From: Klaus Rudolph <lts-rudolph gmx de>
- To: gtkmm-list gnome org
- Subject: Why button press event only reacts on double click?
- Date: Tue, 26 Dec 2017 10:56:34 +0100
The function "signal_button_press_event()" reacts only if I double click
the button. Is it possible to react also on a single press event?
#include <iostream>
#include <gtkmm.h>
#include <gtkmm/window.h>
class ExampleWindow: public Gtk::Window
{
Gtk::Button button;
public:
ExampleWindow(): button("Hallo")
{
add(button);
button.signal_button_press_event().connect( [this](
GdkEventButton* ev)->bool{ std::cout << "Press" << std::endl; return
true; });
}
};
int main(int argc, char* argv[])
{
Gtk::Main kit(argc, argv);
ExampleWindow window;
window.show_all_children();
Gtk::Main::run(window);
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]