GtkWidget *windowing_startup(struct session *session) { PangoFontDescription *desc; GtkWidget *hbox; /* Create the session's window */ session->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); /* This is used for each screen's title, and the clock */ session->caption = gtk_statusbar_new(); session->caption_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(session->caption), "Title"); /* Remove the resize */ gtk_statusbar_set_has_resize_grip(GTK_STATUSBAR(session->caption), FALSE); session->sclock = gtk_statusbar_new(); session->sclock_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(session->sclock), "Time"); /* Push default messages to each */ gtk_statusbar_push(GTK_STATUSBAR(session->caption), session->caption_id, "ConcinnityPOS Version 1.0"); gtk_statusbar_push(GTK_STATUSBAR(session->sclock), session->sclock_id, "00/00/0000 00:00 PM"); /* Set the size of the clock since it'll always be that size, whereas the caption bar expands/shrinks */ gtk_widget_set_size_request(GTK_WIDGET(session->sclock), 250, -1); /* Do some font modifications on the statusbar labels */ desc = pango_font_description_from_string("Sans 15"); gtk_widget_modify_font(GTK_STATUSBAR(session->sclock)->label, desc); pango_font_description_free(desc); desc = pango_font_description_from_string ("Sans 15"); gtk_widget_modify_font (GTK_STATUSBAR(session->caption)->label, desc); pango_font_description_free (desc); gtk_misc_set_alignment(GTK_MISC(GTK_STATUSBAR(session->sclock)->label), 0.5, 0.5); /* Remove the resize */ gtk_statusbar_set_has_resize_grip(GTK_STATUSBAR(session->sclock), FALSE); /* Create the hbox for the caption bar, and the clock */ hbox = gtk_hbox_new(FALSE, 0); /* Pack the clock into the end of the hbox, do not expand */ gtk_box_pack_end(GTK_BOX(hbox), GTK_WIDGET(session->sclock), FALSE, FALSE, 0); /* Put the caption bar in the beginning, expand to fill all space */ gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(session->caption), TRUE, TRUE, 0); /* Make the global vbox for the screen */ session->g_vbox = gtk_vbox_new(FALSE, 0); /* Pack the hbox with clock and caption bar at the bottom of the screen */ gtk_box_pack_end(GTK_BOX(session->g_vbox), GTK_WIDGET(hbox), FALSE, FALSE, 0); /* Put the g_vbox in the window */ gtk_container_add(GTK_CONTAINER(session->window), GTK_WIDGET(session->g_vbox)); /* Always want fullscreen */ gtk_window_maximize(GTK_WINDOW(session->window)); /* Show window and children */ gtk_widget_show_all(GTK_WIDGET(session->window)); /* Not needed */ return session->window; }