Set window title

I set the title based on the current version, but I do this through a
function to make it easier to change later.
This commit is contained in:
Bryan Schumaker 2011-08-21 15:15:40 -04:00
parent 9c0a00dd48
commit b802b31d42
3 changed files with 11 additions and 0 deletions

View File

@ -1,4 +1,5 @@
#include <version.h>
#include <ocarina/gtk.h>
#include <ocarina/button.h>
#include <ocarina/window.h>
@ -12,6 +13,7 @@ void ocarina_init(int argc, char **argv)
gtk_init(&argc, &argv);
window_init();
window_title("Ocarina " + vers_str());
hbox = gtk_hbox_new(FALSE, 0);
play = make_play_button(GTK_ICON_SIZE_MENU);

View File

@ -1,4 +1,7 @@
#include <string>
using namespace std;
#include <ocarina/gtk.h>
#include <ocarina/ocarina.h>
#include <ocarina/window.h>
@ -15,6 +18,11 @@ void window_resize(int w, int h)
gtk_window_resize(GTK_WINDOW(window), w, h);
}
void window_title(string title)
{
gtk_window_set_title(GTK_WINDOW(window), title.c_str());
}
void window_init()
{
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

View File

@ -6,5 +6,6 @@
void window_resize(int, int);
void window_init();
void window_add(GtkWidget *);
void window_title(string);
#endif