summaryrefslogtreecommitdiff
path: root/new/button_unix.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-07 19:47:44 -0400
committerPietro Gagliardi <[email protected]>2015-04-07 19:47:44 -0400
commit89643f70f73e76d8b6484255c3460757715ceeb5 (patch)
tree6c764526c2d4313d21524255bf9849b87c4b9d09 /new/button_unix.c
parent12021269b7789a680bf1286616505a7546f26d93 (diff)
Changed the GTK+ new control system from using g_object_newv() to using g_object_new_valist() due to weird crashes.
Diffstat (limited to 'new/button_unix.c')
-rw-r--r--new/button_unix.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/new/button_unix.c b/new/button_unix.c
index 9c6fa2b..986e81d 100644
--- a/new/button_unix.c
+++ b/new/button_unix.c
@@ -23,18 +23,14 @@ static void defaultOnClicked(uiControl *c, void *data)
uiControl *uiNewButton(const char *text)
{
struct button *b;
- GParameter props[1];
GtkWidget *widget;
b = uiNew(struct button);
- props[0].name = "label";
- g_value_init(&(props[0].value), G_TYPE_STRING);
- g_value_set_string(&(props[0].value), text);
b->c = uiUnixNewControl(GTK_TYPE_BUTTON,
- 1, props,
- FALSE, FALSE, FALSE, b);
- g_value_unset(&(props[0].value)); // thanks to gregier in irc.gimp.net/#gtk+
+ FALSE, FALSE, FALSE, b,
+ "label", text,
+ NULL);
widget = GTK_WIDGET(uiControlHandle(b->c));
g_signal_connect(widget, "clicked", G_CALLBACK(onClicked), b);