Created
December 10, 2014 17:38
-
-
Save trfiladelfo/94da617b62904041d409 to your computer and use it in GitHub Desktop.
GTK FullScreen Widget
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <gtk/gtk.h> | |
int main(int argc, char** argv) { | |
// GtkWidget *window; | |
// gtk_init(&argc, &argv); | |
// | |
// window = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
// gtk_widget_show(window); | |
// | |
// gtk_main(); | |
/*** The Widgets we'll be using ***/ | |
GtkWidget *window = NULL; | |
GtkWidget *close = NULL; | |
/*** Initialize GTK+ ***/ | |
gtk_init(&argc, &argv); | |
/*** Make that Window!!! ***/ | |
window = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
gtk_container_set_border_width(GTK_CONTAINER(window), 10); | |
gtk_widget_realize(window); | |
gtk_window_fullscreen(window); | |
/*** this is a button that'll help us close the window ***/ | |
close = gtk_button_new_with_label("Close Window"); | |
gtk_container_add(window, close); | |
/*** Callbacks ***/ | |
g_signal_connect(close, "clicked", gtk_main_quit, NULL); | |
g_signal_connect(window, "destroy", gtk_main_quit, NULL); | |
/*** Enter the main loop ***/ | |
gtk_widget_show_all(window); | |
gtk_main(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment