From 5a4ea5dd5c2de469d51560f7b2b27c48c8691372 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Fri, 30 Nov 2012 11:45:40 +1100 Subject: [PATCH] Change P_Gtk_Window_New() to use Symbols_To_Bits(). --- lib/gtk/gtkwindow.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/lib/gtk/gtkwindow.c b/lib/gtk/gtkwindow.c index 22c820d..8edce56 100644 --- a/lib/gtk/gtkwindow.c +++ b/lib/gtk/gtkwindow.c @@ -32,21 +32,13 @@ #include "gtk.h" static Object P_Gtk_Window_New (Object sym) { - Object string; - char *str; - GtkWidget *w; + SYMDESCR syms[] = { + { "gtk-window-toplevel", GTK_WINDOW_TOPLEVEL }, + { "gtk-window-popup", GTK_WINDOW_POPUP }, + { 0, 0 } + }; - Check_Type (sym, T_Symbol); - string = P_Symbol_To_String (sym); - str = Get_String (string); - if (!strcmp(str, "gtk-window-toplevel")) - w = gtk_window_new(GTK_WINDOW_TOPLEVEL); - else if (!strcmp(str, "gtk-window-popup")) - w = gtk_window_new(GTK_WINDOW_POPUP); - else - Primitive_Error ("wrong symbol: %s", str); - - return Make_GtkWidget (w); + return Make_GtkWidget (gtk_window_new (Symbols_To_Bits (sym, 0, syms))); } static Object P_Gtk_Window_Set_Title (Object w, Object title) {