Merge branch 'master' of https://bitbucket.org/green-caterpillar/autocatgnome
This commit is contained in:
commit
f11ac5cbfc
@ -8,6 +8,7 @@ namespace gtkpp {
|
|||||||
|
|
||||||
Button::Button() : Widget() {
|
Button::Button() : Widget() {
|
||||||
_widget = gtk_button_new();
|
_widget = gtk_button_new();
|
||||||
|
setupSignals();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button::setTitle(const std::string &title) {
|
void Button::setTitle(const std::string &title) {
|
||||||
|
|||||||
@ -57,4 +57,8 @@ namespace gtkpp {
|
|||||||
gtk_widget_set_sensitive(_widget, enabled);
|
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:
|
private:
|
||||||
friend void clickedCallback(GtkButton*, void* data);
|
friend void clickedCallback(GtkButton*, void* data);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void setupSignals();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void onClick(const std::function<void()>& callback);
|
void onClick(const std::function<void()>& callback);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user