summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-08-13 17:30:47 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-08-13 17:30:47 -0400
commite694a4137cdc6a4046e964559b643ab5d77b8bfa (patch)
tree0d84a0214d77a7da67167aeee2c1cf679b9a2d75 /examples
parent005f9a995e96a24735166cd916aea7157711ccba (diff)
downloadgtk+-e694a4137cdc6a4046e964559b643ab5d77b8bfa.tar.gz
examples: Fix multiple small problems
Add a paragraph about running the example apps uninstalled in the README, and verify that the standalone Makefiles actually work. Hint: some didn't.
Diffstat (limited to 'examples')
-rw-r--r--examples/README13
-rw-r--r--examples/application4/Makefile.example2
-rw-r--r--examples/application5/Makefile.example2
-rw-r--r--examples/application6/Makefile.example2
-rw-r--r--examples/application8/exampleappwin.c2
-rw-r--r--examples/application9/exampleappwin.c2
6 files changed, 17 insertions, 6 deletions
diff --git a/examples/README b/examples/README
index ab70ec382c..44ce0bd734 100644
--- a/examples/README
+++ b/examples/README
@@ -4,9 +4,20 @@
The examples in this directory are built alongside the rest of GTK.
-The examples under the `application[1-10]` directories are also included in
+The examples under the `application[1-9]` directories are also included in
the GTK API reference documentation, and can be built independently, using
the system libraries, by doing:
$ cd application1
$ make -f Makefile.example
+
+== Running the examples ==
+
+The examples can be run uninstalled.
+
+The later demos are using GSettings,so they need a GSettings schema.
+The code for these demos contains a workaround to look for the schema
+in the current directory, so this works:
+
+ $ cd application5
+ & ./exampleapp window.ui
diff --git a/examples/application4/Makefile.example b/examples/application4/Makefile.example
index 97af3fca29..5b81fedf07 100644
--- a/examples/application4/Makefile.example
+++ b/examples/application4/Makefile.example
@@ -11,7 +11,7 @@ OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o)
all: exampleapp
-resources.c: exampleapp.gresource.xml window.ui app-menu.ui
+resources.c: exampleapp.gresource.xml window.ui
$(GLIB_COMPILE_RESOURCES) exampleapp.gresource.xml --target=$@ --sourcedir=. --generate-source
%.o: %.c
diff --git a/examples/application5/Makefile.example b/examples/application5/Makefile.example
index ac7ae85bd3..1090c73012 100644
--- a/examples/application5/Makefile.example
+++ b/examples/application5/Makefile.example
@@ -18,7 +18,7 @@ org.gtk.exampleapp.gschema.valid: org.gtk.exampleapp.gschema.xml
gschemas.compiled: org.gtk.exampleapp.gschema.valid
$(GLIB_COMPILE_SCHEMAS) .
-resources.c: exampleapp.gresource.xml window.ui app-menu.ui
+resources.c: exampleapp.gresource.xml window.ui
$(GLIB_COMPILE_RESOURCES) exampleapp.gresource.xml --target=$@ --sourcedir=. --generate-source
%.o: %.c
diff --git a/examples/application6/Makefile.example b/examples/application6/Makefile.example
index 0a8a3db355..eb9d43ce57 100644
--- a/examples/application6/Makefile.example
+++ b/examples/application6/Makefile.example
@@ -18,7 +18,7 @@ org.gtk.exampleapp.gschema.valid: org.gtk.exampleapp.gschema.xml
gschemas.compiled: org.gtk.exampleapp.gschema.valid
$(GLIB_COMPILE_SCHEMAS) .
-resources.c: exampleapp.gresource.xml window.ui app-menu.ui
+resources.c: exampleapp.gresource.xml window.ui
$(GLIB_COMPILE_RESOURCES) exampleapp.gresource.xml --target=$@ --sourcedir=. --generate-source
%.o: %.c
diff --git a/examples/application8/exampleappwin.c b/examples/application8/exampleappwin.c
index a598de13e0..b623c3d0a8 100644
--- a/examples/application8/exampleappwin.c
+++ b/examples/application8/exampleappwin.c
@@ -107,7 +107,7 @@ done:
row = gtk_button_new_with_label (key);
g_signal_connect (row, "clicked",
G_CALLBACK (find_word), win);
- gtk_box_append (GTK_BOX (win->words), row);
+ gtk_list_box_insert (GTK_LIST_BOX (win->words), row, -1);
}
g_hash_table_unref (strings);
diff --git a/examples/application9/exampleappwin.c b/examples/application9/exampleappwin.c
index a775f5b08a..0edfa2cea1 100644
--- a/examples/application9/exampleappwin.c
+++ b/examples/application9/exampleappwin.c
@@ -109,7 +109,7 @@ done:
row = gtk_button_new_with_label (key);
g_signal_connect (row, "clicked",
G_CALLBACK (find_word), win);
- gtk_box_append (GTK_BOX (win->words), row);
+ gtk_list_box_insert (GTK_LIST_BOX (win->words), row, -1);
}
g_hash_table_unref (strings);