ocarina: Created tabs for the main window
Most things are going to be displayed in a gtk notebook. This patch creates that notebook.
This commit is contained in:
parent
7b48c3311d
commit
c3b82c401f
|
@ -0,0 +1,6 @@
|
|||
#ifndef OCARINA_BODY_H
|
||||
#define OCARINA_BODY_H
|
||||
|
||||
GtkWidget *get_tabs();
|
||||
|
||||
#endif /* OCARINA_BODY_H */
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
#include <ocarina/gtk.h>
|
||||
|
||||
GtkWidget *tabs = NULL;
|
||||
|
||||
static void make_tabs()
|
||||
{
|
||||
tabs = gtk_notebook_new();
|
||||
gtk_notebook_set_tab_pos(GTK_NOTEBOOK(tabs), GTK_POS_LEFT);
|
||||
gtk_widget_show(tabs);
|
||||
}
|
||||
|
||||
GtkWidget *get_tabs()
|
||||
{
|
||||
if (tabs == NULL)
|
||||
make_tabs();
|
||||
return tabs;
|
||||
}
|
|
@ -2,16 +2,23 @@
|
|||
#include <version.h>
|
||||
#include <ocarina/callback.h>
|
||||
#include <ocarina/gtk.h>
|
||||
#include <ocarina/body.h>
|
||||
#include <ocarina/footer.h>
|
||||
#include <ocarina/window.h>
|
||||
#include <libsaria/libsaria.h>
|
||||
|
||||
void ocarina_init(int argc, char **argv)
|
||||
{
|
||||
GtkWidget *vbox = gtk_vbox_new(FALSE, 0);
|
||||
|
||||
window_init();
|
||||
window_title("Ocarina " + vers_str());
|
||||
window_icon("images/ocarina.png");
|
||||
window_add(get_tiny_footer());
|
||||
|
||||
box_pack_start(vbox, get_tabs(), FALSE, FALSE, 0);
|
||||
box_pack_start(vbox, get_tiny_footer(), FALSE, FALSE, 0);
|
||||
gtk_widget_show(vbox);
|
||||
window_add(vbox);
|
||||
}
|
||||
|
||||
void ocarina_quit()
|
||||
|
|
Loading…
Reference in New Issue