summaryrefslogtreecommitdiff
path: root/new/tab_unix.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-13 12:05:14 -0400
committerPietro Gagliardi <[email protected]>2015-04-13 12:05:14 -0400
commit19b85182b83e1eb6d8b91209594adb2f405a19bf (patch)
treea29e5155c09a707373c785fd8491a14eb05eccd8 /new/tab_unix.c
parent4839280b8291fc31bd3ea8669d7d0395c6914ba8 (diff)
Did the GTK+ conversion to uiParent. Now to build.
Diffstat (limited to 'new/tab_unix.c')
-rw-r--r--new/tab_unix.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/new/tab_unix.c b/new/tab_unix.c
index c8d8de7..f995fff 100644
--- a/new/tab_unix.c
+++ b/new/tab_unix.c
@@ -2,15 +2,11 @@
#include "uipriv_unix.h"
struct tab {
- struct tabPage *pages;
+ uiParent **pages;
uintmax_t len;
uintmax_t cap;
};
-struct tabPage {
- GtkWidget *container;
-};
-
static void onDestroy(GtkWidget *widget, gpointer data)
{
struct tab *t = (struct tab *) data;
@@ -44,21 +40,19 @@ void uiTabAddPage(uiControl *c, const char *name, uiControl *child)
{
struct tab *t = (struct tab *) (c->data);
GtkWidget *notebook;
- GtkWidget *container;
+ uiParent *content;
if (t->len >= t->cap) {
t->cap += tabCapGrow;
- t->pages = (struct tabPage *) uiRealloc(t->pages, t->cap * sizeof (struct tabPage), "struct tabPage[]");
+ t->pages = (uiParent **) uiRealloc(t->pages, t->cap * sizeof (uiParent *), "uiParent *[]");
}
- container = newContainer();
- uiContainer(container)->child = child;
- uiControlSetParent(uiContainer(container)->child, (uintptr_t) (container));
notebook = GTK_WIDGET(uiControlHandle(c));
- gtk_container_add(GTK_CONTAINER(notebook), container);
+ content = uiNewParent((uintptr_t) notebook);
+ uiParentSetChild(content, child);
+ uiParentUpdate(content);
gtk_notebook_set_tab_label_text(GTK_NOTEBOOK(notebook), container, name);
- gtk_widget_show_all(container);
- t->pages[t->len].container = container;
+ t->pages[t->len] = content;
t->len++;
}