mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-09 10:20:07 +00:00
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:
parent
005f9a995e
commit
e694a4137c
@ -4,9 +4,20 @@
|
|||||||
|
|
||||||
The examples in this directory are built alongside the rest of GTK.
|
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 GTK API reference documentation, and can be built independently, using
|
||||||
the system libraries, by doing:
|
the system libraries, by doing:
|
||||||
|
|
||||||
$ cd application1
|
$ cd application1
|
||||||
$ make -f Makefile.example
|
$ 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
|
||||||
|
@ -11,7 +11,7 @@ OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o)
|
|||||||
|
|
||||||
all: exampleapp
|
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
|
$(GLIB_COMPILE_RESOURCES) exampleapp.gresource.xml --target=$@ --sourcedir=. --generate-source
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
|
@ -18,7 +18,7 @@ org.gtk.exampleapp.gschema.valid: org.gtk.exampleapp.gschema.xml
|
|||||||
gschemas.compiled: org.gtk.exampleapp.gschema.valid
|
gschemas.compiled: org.gtk.exampleapp.gschema.valid
|
||||||
$(GLIB_COMPILE_SCHEMAS) .
|
$(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
|
$(GLIB_COMPILE_RESOURCES) exampleapp.gresource.xml --target=$@ --sourcedir=. --generate-source
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
|
@ -18,7 +18,7 @@ org.gtk.exampleapp.gschema.valid: org.gtk.exampleapp.gschema.xml
|
|||||||
gschemas.compiled: org.gtk.exampleapp.gschema.valid
|
gschemas.compiled: org.gtk.exampleapp.gschema.valid
|
||||||
$(GLIB_COMPILE_SCHEMAS) .
|
$(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
|
$(GLIB_COMPILE_RESOURCES) exampleapp.gresource.xml --target=$@ --sourcedir=. --generate-source
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
|
@ -107,7 +107,7 @@ done:
|
|||||||
row = gtk_button_new_with_label (key);
|
row = gtk_button_new_with_label (key);
|
||||||
g_signal_connect (row, "clicked",
|
g_signal_connect (row, "clicked",
|
||||||
G_CALLBACK (find_word), win);
|
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);
|
g_hash_table_unref (strings);
|
||||||
|
@ -109,7 +109,7 @@ done:
|
|||||||
row = gtk_button_new_with_label (key);
|
row = gtk_button_new_with_label (key);
|
||||||
g_signal_connect (row, "clicked",
|
g_signal_connect (row, "clicked",
|
||||||
G_CALLBACK (find_word), win);
|
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);
|
g_hash_table_unref (strings);
|
||||||
|
Loading…
Reference in New Issue
Block a user