ocarina: Add a switch for tab label expanding

Pass in true to cause the tab label to expand and fill up the entire
space, false if the label should not expand.
This commit is contained in:
Bryan Schumaker 2011-09-09 08:27:58 -04:00
parent 2110319176
commit b8f977cc35
3 changed files with 10 additions and 3 deletions

View File

@ -4,6 +4,6 @@
#include <ocarina/gtk.h>
GtkWidget *get_tabs();
void add_page(GtkWidget *, GtkWidget *);
void add_page(GtkWidget *, GtkWidget *, bool);
#endif /* OCARINA_BODY_H */

View File

@ -17,7 +17,14 @@ GtkWidget *get_tabs()
return tabs;
}
void add_page(GtkWidget *label, GtkWidget *content)
void add_page(GtkWidget *label, GtkWidget *content, bool fill)
{
gtk_notebook_append_page(GTK_NOTEBOOK(tabs), content, label);
if (fill == true) {
gtk_notebook_set_tab_label_packing(GTK_NOTEBOOK(tabs),
content,
TRUE,
TRUE,
GTK_PACK_START);
}
};

View File

@ -11,5 +11,5 @@ void settings_init()
gtk_widget_show(image);
gtk_widget_show(tabs);
add_page(image, tabs);
add_page(image, tabs, false);
}