summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Pelz <pelzflorian@pelzflorian.de>2018-02-12 11:19:18 +0100
committerFlorian Pelz <pelzflorian@pelzflorian.de>2018-02-12 11:40:47 +0100
commit65951a85b2daeb807c64d8c60e29942e106f5b58 (patch)
tree4854bea6deee22e7b2feb098989ad15519ab9e75
parentc035cc2bcc0845171eeecd31554784371c37a086 (diff)
Put the guessed text in a scrolled window.HEADmaster
-rw-r--r--hangman.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/hangman.c b/hangman.c
index e1bf659..08e96f2 100644
--- a/hangman.c
+++ b/hangman.c
@@ -1,7 +1,8 @@
/*
* Don’t Hang - A simple GTK+ hangman game.
*
- * Written in 2016 and 2017 by Florian Pelz <pelzflorian@pelzflorian.de>
+ * Written in 2016, 2017, 2018 by
+ * Florian Pelz <pelzflorian@pelzflorian.de>
*
* To the extent possible under law, the author(s) have dedicated all
* copyright and related and neighboring rights to this software to
@@ -831,7 +832,7 @@ static GActionEntry action_entries[] =
static void
app_startup (GApplication *app)
{
- GtkWidget *window, *grid, *gallow, *guessed;
+ GtkWidget *window, *grid, *gallow, *guessed, *guessed_scrollwin;
GtkWidget *header_bar, *open_button;
GdkScreen *default_screen;
@@ -866,20 +867,20 @@ app_startup (GApplication *app)
NULL);
guessed = gtk_label_new (NULL);
- g_object_set (G_OBJECT (guessed),
+
+ guessed_scrollwin = gtk_scrolled_window_new (NULL, NULL);
+ g_object_set (G_OBJECT (guessed_scrollwin),
"margin-top", 8,
"margin-bottom", 8,
NULL);
- default_screen = gdk_screen_get_default ();
-
- gtk_widget_set_name (guessed, "guessed");
-
gtk_container_add (GTK_CONTAINER (window),
grid);
gtk_container_add (GTK_CONTAINER (grid),
gallow);
gtk_container_add (GTK_CONTAINER (grid),
+ guessed_scrollwin);
+ gtk_container_add (GTK_CONTAINER (guessed_scrollwin),
guessed);
header_bar = gtk_header_bar_new ();
@@ -896,6 +897,9 @@ app_startup (GApplication *app)
gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), open_button);
+
+ gtk_widget_set_name (guessed, "guessed");
+
default_screen = gdk_screen_get_default ();
guessed_css_provider = gtk_css_provider_new ();