ocarina: Create default content for the window
I'm not using a notebook as the main widget anymore. I'm also setting the content directly, rather than getting the widget from the body code and setting it in the window code. Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
c0df8f2e2b
commit
3d11ea47ba
|
@ -9,4 +9,16 @@ void push_page(GtkWidget *, GtkWidget *, bool);
|
|||
void remove_page(GtkWidget *);
|
||||
void set_current_page(GtkWidget *);
|
||||
|
||||
namespace ocarina
|
||||
{
|
||||
|
||||
namespace body
|
||||
{
|
||||
|
||||
void init();
|
||||
|
||||
}
|
||||
|
||||
}; /* Namespace: ocarina */
|
||||
|
||||
#endif /* OCARINA_BODY_H */
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace ocarina
|
|||
|
||||
void set_title(string);
|
||||
void set_icon(string);
|
||||
void set_content(GtkWidget *);
|
||||
|
||||
}; /* Namespace: window */
|
||||
/*void window_resize(int, int);
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (c) 2012 Bryan Schumaker
|
||||
#include <ocarina/ocarina.h>
|
||||
#include <ocarina/window.h>
|
||||
#include <ocarina/body.h>
|
||||
|
||||
static GtkWidget *content;
|
||||
|
||||
namespace ocarina
|
||||
{
|
||||
|
||||
void body::init()
|
||||
{
|
||||
content = gtk_vbox_new(FALSE, 0);
|
||||
|
||||
gtk_widget_show(content);
|
||||
}
|
||||
|
||||
}; /* Namespace: ocarina */
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include <ocarina/ocarina.h>
|
||||
#include <ocarina/window.h>
|
||||
#include <ocarina/body.h>
|
||||
/*#include <version.h>
|
||||
#include <ocarina/callback.h>
|
||||
#include <ocarina/body.h>
|
||||
|
@ -77,6 +78,7 @@ static void init(int argc, char **argv)
|
|||
{
|
||||
gtk_init(&argc, &argv);
|
||||
ocarina::window::init();
|
||||
ocarina::body::init();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
|
|
|
@ -132,4 +132,9 @@ namespace ocarina
|
|||
gtk_window_set_icon_from_file(GTK_WINDOW(win), path.c_str(), NULL);
|
||||
}
|
||||
|
||||
void window::set_content(GtkWidget *content)
|
||||
{
|
||||
gtk_container_add(GTK_CONTAINER(win), content);
|
||||
}
|
||||
|
||||
} /* Namespace: ocarina */
|
||||
|
|
Loading…
Reference in New Issue