docs: Fix typos

This commit is contained in:
Matthias Clasen 2020-08-03 17:17:56 -04:00
parent 70b0bdd5e3
commit a5058c605f

View File

@ -48,7 +48,7 @@ the question you have, this list is a good place to start.
5. Why does my program leak memory, if I destroy a widget immediately 5. Why does my program leak memory, if I destroy a widget immediately
after creating it ? after creating it ?
If `GtkFooi` isn't a toplevel window, then If `GtkFoo` isn't a toplevel window, then
foo = gtk_foo_new (); foo = gtk_foo_new ();
g_object_unref (foo); g_object_unref (foo);
@ -63,7 +63,7 @@ the question you have, this list is a good place to start.
foo = gtk_foo_new (); foo = gtk_foo_new ();
g_object_ref_sink (foo); g_object_ref_sink (foo);
When you immediately add a widget to a container, it takes care of assuming When you immediately add a widget to a container, it takes care of assuming
the initial floating reference and you don't have to worry about reference the initial floating reference and you don't have to worry about reference
counting at all ... just remove the widget from the container to get rid of it. counting at all ... just remove the widget from the container to get rid of it.
@ -80,7 +80,7 @@ the question you have, this list is a good place to start.
7. How do I internationalize a GTK program? 7. How do I internationalize a GTK program?
Most people use <[GNU gettext](https://www.gnu.org/software/gettext/), Most people use [GNU gettext](https://www.gnu.org/software/gettext/),
already required in order to install GLib. On a UNIX or Linux system with already required in order to install GLib. On a UNIX or Linux system with
gettext installed, type `info gettext` to read the documentation. gettext installed, type `info gettext` to read the documentation.
@ -108,7 +108,7 @@ the question you have, this list is a good place to start.
Code using these macros ends up looking like this: Code using these macros ends up looking like this:
#include &lt;gi18n.h&gt; #include <gi18n.h>
static const char *global_variable = N_("Translate this string"); static const char *global_variable = N_("Translate this string");
@ -162,7 +162,7 @@ the question you have, this list is a good place to start.
if (g_file_get_contents (filename, &amp;text, &amp;length, NULL)) if (g_file_get_contents (filename, &amp;text, &amp;length, NULL))
{ {
utf8_text = g_convert (text, length, "UTF-8", "ISO-8859-1", utf8_text = g_convert (text, length, "UTF-8", "ISO-8859-1",
NULL, NULL, &amp;error); NULL, NULL, &error);
if (error != NULL) if (error != NULL)
{ {
fprintf ("Couldn't convert file %s to UTF-8\n", filename); fprintf ("Couldn't convert file %s to UTF-8\n", filename);
@ -188,9 +188,9 @@ the question you have, this list is a good place to start.
Even if your toolchain can't handle UTF-8 directly, you can still Even if your toolchain can't handle UTF-8 directly, you can still
encode string literals in UTF-8 by using octal or hexadecimal escapes encode string literals in UTF-8 by using octal or hexadecimal escapes
like `\\212` or `\\xa8` to encode each byte. This is portable, but like `\212` or `\xa8` to encode each byte. This is portable, but
modifying the escaped strings is not very convenient. Be careful when modifying the escaped strings is not very convenient. Be careful when
mixing hexadecimal escapes with ordinary text; `"\\xa8abcd" is a string mixing hexadecimal escapes with ordinary text; `"\xa8abcd" is a string
of length 1 ! of length 1 !
- Runtime conversion - Runtime conversion
@ -203,7 +203,7 @@ the question you have, this list is a good place to start.
Here is an example showing the three approaches using the copyright Here is an example showing the three approaches using the copyright
sign © which has Unicode and ISO-8859-1 codepoint 169 and is represented sign © which has Unicode and ISO-8859-1 codepoint 169 and is represented
in UTF-8 by the two bytes 194, 169, or `"\\302\\251"` as a string literal: in UTF-8 by the two bytes 194, 169, or `"\302\251"` as a string literal:
g_print ("direct UTF-8: ©"); g_print ("direct UTF-8: ©");
g_print ("escaped UTF-8: \302\251"); g_print ("escaped UTF-8: \302\251");
@ -444,7 +444,7 @@ the question you have, this list is a good place to start.
So pack both a #GtkCellRendererPixbuf and a #GtkCellRendererText into the So pack both a #GtkCellRendererPixbuf and a #GtkCellRendererText into the
column. column.
28. I can set data easily on my #GtkTreeStore/#GtkListStore models using 28. I can set data easily on my #GtkTreeStore or #GtkListStore models using
gtk_list_store_set() and gtk_tree_store_set(), but can't read it back? gtk_list_store_set() and gtk_tree_store_set(), but can't read it back?
Both the #GtkTreeStore and the #GtkListStore implement the #GtkTreeModel Both the #GtkTreeStore and the #GtkListStore implement the #GtkTreeModel