ui/gtk/button.c

branch
newapi
changeset 276
376921880a7f
parent 274
9e2aee097b69
child 278
a8faf8757450
--- a/ui/gtk/button.c	Sun Mar 31 16:19:01 2024 +0200
+++ b/ui/gtk/button.c	Sun Mar 31 18:29:06 2024 +0200
@@ -35,13 +35,13 @@
 #include "../common/context.h"
 #include "../common/object.h"
 
-static void button_set_icon(GtkWidget *button, const char *icon) {
+void ui_button_set_icon_name(GtkWidget *button, const char *icon) {
     if(!icon) {
         return;
     }
     
 #ifdef UI_GTK4
-    gtk_button_set_icon_name(GTK_BUTTON(button), args.icon);
+    gtk_button_set_icon_name(GTK_BUTTON(button), icon);
 #else
 #if GTK_CHECK_VERSION(2, 6, 0)
     GtkWidget *image = gtk_image_new_from_icon_name(icon, GTK_ICON_SIZE_BUTTON);
@@ -60,7 +60,7 @@
     if(args.label) {
         gtk_button_set_label(GTK_BUTTON(button), args.label);
     }
-    button_set_icon(button, args.icon);
+    ui_button_set_icon_name(button, args.icon);
 
     
     if(args.onclick) {
@@ -129,7 +129,7 @@
     if(args.label) {
         gtk_button_set_label(GTK_BUTTON(widget), args.label);
     }
-    button_set_icon(widget, args.icon);
+    ui_button_set_icon_name(widget, args.icon);
     
     UiVar* var = uic_widget_var(obj->ctx, current->ctx, args.value, args.varname, UI_VAR_INTEGER);
     if (var) {

mercurial