ocarina: Set window title and icon during init()

I was setting these through other function calls, but it's easier (and
cleaner) to do it all in the initial init() call.
This commit is contained in:
Bryan Schumaker 2011-10-22 08:55:32 -04:00
parent c3fd002e92
commit 155e436259
3 changed files with 5 additions and 7 deletions

View File

@ -4,7 +4,7 @@
#include <ocarina/gtk.h>
void window_resize(int, int);
void window_init();
void window_init(string, string);
void window_add(GtkWidget *);
void window_title(string);
void window_icon(string);

View File

@ -27,10 +27,7 @@ void ocarina_idle_add()
void ocarina_init(int argc, char **argv)
{
window_init();
window_title("Ocarina " + vers_str());
window_icon("images/ocarina.png");
window_init("Ocarina " + vers_str(), "images/ocarina.png");
window_add(get_tabs());
library_init();
settings_init();

View File

@ -28,13 +28,14 @@ void window_icon(string file)
gtk_window_set_icon_from_file(GTK_WINDOW(window), file.c_str(), NULL);
}
void window_init()
void window_init(string title, string icon)
{
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
GTK_CONNECT(window, "destroy", destroy_window, NULL);
//window_resize(800, 600);
window_resize(800, 600);
gtk_widget_show(window);
window_title(title);
window_icon(icon);
}
void window_add(GtkWidget *widget)