Fixed click handler in button
This commit is contained in:
parent
4590aeaee8
commit
7c4f64e32d
@ -8,6 +8,7 @@ namespace gtkpp {
|
||||
|
||||
Button::Button() : Widget() {
|
||||
_widget = gtk_button_new();
|
||||
setupSignals();
|
||||
}
|
||||
|
||||
void Button::setTitle(const std::string &title) {
|
||||
|
||||
@ -57,4 +57,8 @@ namespace gtkpp {
|
||||
gtk_widget_set_sensitive(_widget, enabled);
|
||||
}
|
||||
|
||||
void Widget::setupSignals() {
|
||||
g_signal_connect(_widget, "clicked", G_CALLBACK(clickedCallback), this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -20,6 +20,9 @@ namespace gtkpp {
|
||||
private:
|
||||
friend void clickedCallback(GtkButton*, void* data);
|
||||
|
||||
protected:
|
||||
void setupSignals();
|
||||
|
||||
public:
|
||||
void onClick(const std::function<void()>& callback);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user