various Linux updates, including making the default size of the splash window 512x96.

This commit is contained in:
AJ Kelly
2011-08-22 15:50:56 -05:00
parent 842a493c60
commit e2ab3d6493
5 changed files with 54 additions and 17 deletions
@@ -5,13 +5,13 @@
static GtkWidget *label;
static GtkWidget *window;
static GtkWidget *splash;
static GtkWidget *progressBar;
extern "C" const char *Init( int *argc, char ***argv )
{
const gchar *splash_image_path = "Data/splash.png";
GtkWidget *vbox;
GtkWidget *loadimage;
gtk_disable_setlocale();
if( !gtk_init_check(argc,argv) )
@@ -19,15 +19,16 @@ extern "C" const char *Init( int *argc, char ***argv )
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position( GTK_WINDOW(window), GTK_WIN_POS_CENTER );
gtk_window_set_default_size( GTK_WINDOW(window), 512,96 );
gtk_widget_realize(window);
loadimage = gtk_image_new_from_file(splash_image_path);
splash = gtk_image_new_from_file(splash_image_path);
label = gtk_label_new(NULL);
gtk_label_set_justify(GTK_LABEL(label),GTK_JUSTIFY_CENTER);
progressBar = gtk_progress_bar_new();
gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR(progressBar), 0.0 );
vbox = gtk_vbox_new(FALSE,5);
gtk_container_add(GTK_CONTAINER(window),vbox);
gtk_box_pack_start(GTK_BOX(vbox),loadimage,FALSE,FALSE,0);
gtk_box_pack_start(GTK_BOX(vbox),splash,FALSE,FALSE,0);
gtk_box_pack_end(GTK_BOX(vbox),progressBar,TRUE,TRUE,0);
gtk_box_pack_end(GTK_BOX(vbox),label,TRUE,TRUE,0);
@@ -51,6 +52,13 @@ extern "C" void SetText( const char *s )
gtk_main_iteration_do(FALSE);
}
extern "C" void SetSplash( const char *s )
{
splash = gtk_image_new_from_file(s);
gtk_widget_show(splash);
gtk_main_iteration_do(FALSE);
}
extern "C" void SetProgress( int progress, int totalWork )
{
gdouble fraction = ( totalWork > 0 ? progress / (gdouble)totalWork : 0 );