ocarina: Add settings tab

Eventually this tab will be used for configuring everything.  Right now
it's an empty page.
This commit is contained in:
Bryan Schumaker 2011-09-09 08:14:07 -04:00
parent c3b82c401f
commit 976637f88b
5 changed files with 33 additions and 1 deletions

View File

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

View File

@ -0,0 +1,6 @@
#ifndef OCARINA_SETTINGS_H
#define OCARINA_SETTINGS_H
void settings_init();
#endif /* OCARINA_SETTINGS_H */

View File

@ -1,7 +1,7 @@
#include <ocarina/gtk.h>
GtkWidget *tabs = NULL;
static GtkWidget *tabs = NULL;
static void make_tabs()
{
@ -16,3 +16,8 @@ GtkWidget *get_tabs()
make_tabs();
return tabs;
}
void add_page(GtkWidget *label, GtkWidget *content)
{
gtk_notebook_append_page(GTK_NOTEBOOK(tabs), content, label);
};

View File

@ -3,6 +3,7 @@
#include <ocarina/callback.h>
#include <ocarina/gtk.h>
#include <ocarina/body.h>
#include <ocarina/settings.h>
#include <ocarina/footer.h>
#include <ocarina/window.h>
#include <libsaria/libsaria.h>
@ -19,6 +20,8 @@ void ocarina_init(int argc, char **argv)
box_pack_start(vbox, get_tiny_footer(), FALSE, FALSE, 0);
gtk_widget_show(vbox);
window_add(vbox);
settings_init();
}
void ocarina_quit()

View File

@ -0,0 +1,15 @@
#include <ocarina/settings.h>
#include <ocarina/body.h>
#include <ocarina/gtk.h>
void settings_init()
{
GtkWidget *tabs = gtk_notebook_new();
GtkWidget *image = gtk_image_new_from_stock(GTK_STOCK_PREFERENCES,
GTK_ICON_SIZE_MENU);
gtk_widget_show(image);
gtk_widget_show(tabs);
add_page(image, tabs);
}