diff options
author | Benjamin Otte <otte@redhat.com> | 2019-11-29 08:48:48 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2019-12-03 18:12:25 +0100 |
commit | a15fb95c46e568326540e78772de95082472dfd4 (patch) | |
tree | bd07f980fa279d1fe13920c4de234f9728f700ac /demos/gtk-demo/spinbutton.c | |
parent | 292371932b5aa8221ad7ec64693b075b7985914e (diff) | |
download | gtk+-a15fb95c46e568326540e78772de95082472dfd4.tar.gz |
gtk-demo: Use normal way to lookup up symbols
We're a normal application, so we can use the normal way to hook up code
into builder files, which is using dlsym() for the function pointers.
There's no need to to extra work exporting static symbols.
Diffstat (limited to 'demos/gtk-demo/spinbutton.c')
-rw-r--r-- | demos/gtk-demo/spinbutton.c | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/demos/gtk-demo/spinbutton.c b/demos/gtk-demo/spinbutton.c index b9cddc8434..43ecd9164b 100644 --- a/demos/gtk-demo/spinbutton.c +++ b/demos/gtk-demo/spinbutton.c @@ -11,9 +11,9 @@ #include <math.h> #include <stdlib.h> -static gint -hex_spin_input (GtkSpinButton *spin_button, - gdouble *new_val) +gint +spinbutton_hex_spin_input (GtkSpinButton *spin_button, + gdouble *new_val) { const gchar *buf; gchar *err; @@ -28,8 +28,8 @@ hex_spin_input (GtkSpinButton *spin_button, return TRUE; } -static gint -hex_spin_output (GtkSpinButton *spin_button) +gint +spinbutton_hex_spin_output (GtkSpinButton *spin_button) { GtkAdjustment *adjustment; gchar *buf; @@ -48,9 +48,9 @@ hex_spin_output (GtkSpinButton *spin_button) return TRUE; } -static gint -time_spin_input (GtkSpinButton *spin_button, - gdouble *new_val) +gint +spinbutton_time_spin_input (GtkSpinButton *spin_button, + gdouble *new_val) { const gchar *text; gchar **str; @@ -87,8 +87,8 @@ time_spin_input (GtkSpinButton *spin_button, return TRUE; } -static gint -time_spin_output (GtkSpinButton *spin_button) +gint +spinbutton_time_spin_output (GtkSpinButton *spin_button) { GtkAdjustment *adjustment; gchar *buf; @@ -121,9 +121,9 @@ static gchar *month[12] = { "December" }; -static gint -month_spin_input (GtkSpinButton *spin_button, - gdouble *new_val) +gint +spinbutton_month_spin_input (GtkSpinButton *spin_button, + gdouble *new_val) { gint i; gchar *tmp1, *tmp2; @@ -150,8 +150,8 @@ month_spin_input (GtkSpinButton *spin_button, return TRUE; } -static gint -month_spin_output (GtkSpinButton *spin_button) +gint +spinbutton_month_spin_output (GtkSpinButton *spin_button) { GtkAdjustment *adjustment; gdouble value; @@ -190,16 +190,7 @@ do_spinbutton (GtkWidget *do_widget) GtkAdjustment *adj; GtkWidget *label; - builder = gtk_builder_new (); - gtk_builder_add_callback_symbols (builder, - "hex_spin_input", G_CALLBACK (hex_spin_input), - "hex_spin_output", G_CALLBACK (hex_spin_output), - "time_spin_input", G_CALLBACK (time_spin_input), - "time_spin_output", G_CALLBACK (time_spin_output), - "month_spin_input", G_CALLBACK (month_spin_input), - "month_spin_output", G_CALLBACK (month_spin_output), - NULL); - gtk_builder_add_from_resource (builder, "/spinbutton/spinbutton.ui", NULL); + builder = gtk_builder_new_from_resource ("/spinbutton/spinbutton.ui"); window = GTK_WIDGET (gtk_builder_get_object (builder, "window")); gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget)); |