Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Commit

Permalink
Capture button click event.
Browse files Browse the repository at this point in the history
  • Loading branch information
aentinger committed May 7, 2024
1 parent 05e0d83 commit 2191d5b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/robotem_rovne_gui/Node.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class Node : public rclcpp::Node

private:
std::thread _gui_thread;

void btn_start_pressed();
};

/**************************************************************************************
Expand Down
13 changes: 13 additions & 0 deletions src/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ Node::Node(int & argc, char ** argv)
window.set_title("Robotem Rovne GUI");
window.set_default_size(320, 240);

Gtk::Button btn_start;
btn_start.set_label("Start");
btn_start.signal_clicked().connect(sigc::mem_fun(*this, &Node::btn_start_pressed));

window.add(btn_start);

window.show_all_children();

return app->run(window);
});

Expand All @@ -49,6 +57,11 @@ Node::~Node()
* PRIVATE MEMBER FUNCTIONS
**************************************************************************************/

void Node::btn_start_pressed()
{
RCLCPP_INFO(get_logger(), "btn_start_pressed");
}

/**************************************************************************************
* NAMESPACE
**************************************************************************************/
Expand Down

0 comments on commit 2191d5b

Please sign in to comment.