tDon't use deprecated gtk_label_get() - vaccinewars - be a doctor and try to vaccinate the world
git clone git://src.adamsgaard.dk/vaccinewars
Log
Files
Refs
README
LICENSE
---
commit f7f888151cd2dcf4a18323345a383a154930e97f
parent 31887b475ae814acb421a2ae9fc89049835ccedf
Author: Ben Webb 
Date:   Fri, 20 Nov 2020 00:41:38 -0800

Don't use deprecated gtk_label_get()

Diffstat:
  M src/gtkport/gtkport.c               |       4 ++--
  M src/gtkport/gtkport.h               |       2 +-
  M src/gui_client/gtk_client.c         |       4 ++--

3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/gtkport/gtkport.c b/src/gtkport/gtkport.c
t@@ -4826,9 +4826,9 @@ guint gtk_label_parse_uline(GtkLabel *label, const gchar *str)
   return 0;
 }
 
-void gtk_label_get(GtkLabel *label, gchar **str)
+const char *gtk_label_get_text(GtkLabel *label)
 {
-  *str = label->text;
+  return label->text;
 }
 
 void gtk_text_set_point(GtkText *text, guint index)
diff --git a/src/gtkport/gtkport.h b/src/gtkport/gtkport.h
t@@ -635,7 +635,7 @@ void gtk_option_menu_set_menu(GtkOptionMenu *option_menu, GtkWidget *menu);
 void gtk_option_menu_set_history(GtkOptionMenu *option_menu, guint index);
 void gtk_label_set_text(GtkLabel *label, const gchar *str);
 guint gtk_label_parse_uline(GtkLabel *label, const gchar *str);
-void gtk_label_get(GtkLabel *label, gchar **str);
+const gchar *gtk_label_get_text(GtkLabel *label);
 void gtk_text_set_point(GtkText *text, guint index);
 void gtk_widget_set_size_request(GtkWidget *widget, gint width, gint height);
 gint gtk_spin_button_get_value_as_int(GtkSpinButton *spin_button);
diff --git a/src/gui_client/gtk_client.c b/src/gui_client/gtk_client.c
t@@ -995,7 +995,7 @@ static void UpdateCombatant(gchar *DefendName, int DefendBitches,
                             gchar *BitchName, int DefendHealth)
 {
   guint i, RowIndex;
-  gchar *name;
+  const gchar *name;
   struct combatant *compt;
   GArray *combatants;
   GtkWidget *table;
t@@ -1018,7 +1018,7 @@ static void UpdateCombatant(gchar *DefendName, int DefendBitches,
         compt = NULL;
         continue;
       }
-      gtk_label_get(GTK_LABEL(compt->name), &name);
+      name = gtk_label_get_text(GTK_LABEL(compt->name));
       if (name && strcmp(name, DefendName) == 0) {
         break;
       }