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.
This commit is contained in:
Matthias Clasen 2020-08-13 17:30:47 -04:00
parent 005f9a995e
commit e694a4137c
6 changed files with 17 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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);