Skip to content

Commit

Permalink
examples: Fix multiple small problems
Browse files Browse the repository at this point in the history
Add a paragraph about running the example apps
uninstalled in the README, and verify that the
standalone Makefiles actually work. Hint: some
didn't.
  • Loading branch information
Matthias Clasen committed Aug 13, 2020
1 parent 005f9a9 commit e694a41
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 6 deletions.
13 changes: 12 additions & 1 deletion examples/README
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion examples/application4/Makefile.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/application5/Makefile.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/application6/Makefile.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/application8/exampleappwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ update_words (ExampleAppWindow *win)
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);
Expand Down
2 changes: 1 addition & 1 deletion examples/application9/exampleappwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ update_words (ExampleAppWindow *win)
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);
Expand Down

0 comments on commit e694a41

Please sign in to comment.