From 5b929084f8b80409ee39d21ef80f562042807e0b Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 7 Apr 2015 13:22:46 -0400 Subject: Tied everything together. Now to fix build issues. --- new/window_unix.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'new/window_unix.c') diff --git a/new/window_unix.c b/new/window_unix.c index 3a145ac..ecc520c 100644 --- a/new/window_unix.c +++ b/new/window_unix.c @@ -3,6 +3,7 @@ struct uiWindow { GtkWidget *widget; + GtkWidget *container; int (*onClosing)(uiWindow *, void *); void *onClosingData; }; @@ -15,6 +16,8 @@ uiWindow *uiNewWindow(char *title, int width, int height) w->widget = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(w->widget), title); gtk_window_resize(GTK_WINDOW(w->widget), width, height); + w->container = newContainer(); + gtk_container_add(GTK_CONTAINER(w->widget), w->container); return w; } @@ -58,3 +61,9 @@ void uiWindowOnClosing(uiWindow *w, int (*f)(uiWindow *, void *), void *data) w->onClosingData = data; g_signal_connect(w->widget, "delete-event", G_CALLBACK(onClosing), w); } + +void uiWindowSetChild(uiWindow *w, uiControl *c) +{ + uiContainer(w->container)->child = c; + (*(c->setParent))(c, (uintptr_t) (w->container)); +} -- cgit v1.2.3