-
Notifications
You must be signed in to change notification settings - Fork 0
/
gtkpp-Button.cpp
33 lines (28 loc) · 1 KB
/
gtkpp-Button.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <gtkpp/gtkpp-Button.hpp>
namespace gtkpp
{
Button::Button(const char *name, GtkActionGroup* actionGroup)
{
GtkWidget *image;
GtkAction *action;
widget = gtk_button_new();
image = gtk_image_new();
gtk_button_set_image (GTK_BUTTON (widget), image);
action = gtk_action_group_get_action (actionGroup, name);
gtk_activatable_set_related_action (GTK_ACTIVATABLE (widget), action);
set_label(nullptr);
set_tooltip_text(gtk_action_get_tooltip (action));
}
Button::Button(GtkButton* original, bool callAddReference)
: Container ((GtkContainer*)original, callAddReference){}
Button::Button(): Container ((GtkContainer*)gtk_button_new(), false){}
Button::~Button() {}
void Button::set_focus_on_click(bool setFocus)
{
gtk_button_set_focus_on_click ((GtkButton*)widget, setFocus);
}
void Button::set_label(const char* label)
{
gtk_button_set_label ((GtkButton*)widget, label);
}
}