Add wrapper for gtk_widow_new().

This commit is contained in:
Sergey Cherepanov
2022-08-17 13:45:58 +03:00
committed by lassik
parent 8c45a1ac20
commit fd710559e0
+20
View File
@@ -28,7 +28,27 @@
* THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
#include <string.h>
#include "gtk.h"
static Object P_Gtk_Window_New (Object sym) {
Object string;
char *str;
GtkWidget *w;
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);
}
void elk_init_gtk_gtkwindow () {
Define_Primitive (P_Gtk_Window_New, "gtk-window-new", 1, 1, EVAL);
}