mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-17 06:10:15 +00:00
docs: don't escape entities in example code
https://bugzilla.gnome.org/show_bug.cgi?id=723119
This commit is contained in:
parent
48b359ea53
commit
e31ebda1d7
@ -71,8 +71,8 @@
|
||||
* |[
|
||||
* @binding-set MoveCursor3
|
||||
* {
|
||||
* bind "<Control>Right" { "move-cursor" (visual-positions, 3, 0) };
|
||||
* bind "<Control>Left" { "move-cursor" (visual-positions, -3, 0) };
|
||||
* bind "<Control>Right" { "move-cursor" (visual-positions, 3, 0) };
|
||||
* bind "<Control>Left" { "move-cursor" (visual-positions, -3, 0) };
|
||||
* }
|
||||
* GtkEntry
|
||||
* {
|
||||
@ -94,8 +94,8 @@
|
||||
* |[
|
||||
* @binding-set MoveCursor3
|
||||
* {
|
||||
* bind "<Control>Right" { };
|
||||
* bind "<Control>Left" { };
|
||||
* bind "<Control>Right" { };
|
||||
* bind "<Control>Left" { };
|
||||
* }
|
||||
* GtkEntry
|
||||
* {
|
||||
@ -115,8 +115,8 @@
|
||||
* |[
|
||||
* @binding-set MoveCursor3
|
||||
* {
|
||||
* unbind "<Control>Right";
|
||||
* unbind "<Control>Left";
|
||||
* unbind "<Control>Right";
|
||||
* unbind "<Control>Left";
|
||||
* }
|
||||
* GtkEntry
|
||||
* {
|
||||
|
@ -90,7 +90,7 @@
|
||||
* <example><title>A rule set with two selectors</title>
|
||||
* |[
|
||||
* GtkButton, GtkEntry {
|
||||
* color: #ff00ea;
|
||||
* color: #ff00ea;
|
||||
* font: Comic Sans 12
|
||||
* }
|
||||
* ]|
|
||||
@ -129,12 +129,12 @@
|
||||
* |[
|
||||
* /* Theme labels that are descendants of a window */
|
||||
* GtkWindow GtkLabel {
|
||||
* background-color: #898989
|
||||
* background-color: #898989
|
||||
* }
|
||||
*
|
||||
* /* Theme notebooks, and anything that's within these */
|
||||
* GtkNotebook {
|
||||
* background-color: #a939f0
|
||||
* background-color: #a939f0
|
||||
* }
|
||||
*
|
||||
* /* Theme combo boxes, and entries that
|
||||
@ -142,7 +142,7 @@
|
||||
* GtkComboBox,
|
||||
* GtkNotebook > GtkEntry {
|
||||
* color: @fg_color;
|
||||
* background-color: #1209a2
|
||||
* background-color: #1209a2
|
||||
* }
|
||||
*
|
||||
* /* Theme any widget within a GtkBin */
|
||||
@ -151,13 +151,13 @@
|
||||
* }
|
||||
*
|
||||
* /* Theme a label named title-label */
|
||||
* GtkLabel#title-label {
|
||||
* GtkLabel#title-label {
|
||||
* font: Sans 15
|
||||
* }
|
||||
*
|
||||
* /* Theme any widget named main-entry */
|
||||
* #main-entry {
|
||||
* background-color: #f0a810
|
||||
* #main-entry {
|
||||
* background-color: #f0a810
|
||||
* }
|
||||
* ]|
|
||||
* </example>
|
||||
@ -182,12 +182,12 @@
|
||||
* |[
|
||||
* /* Theme all widgets defining the class entry */
|
||||
* .entry {
|
||||
* color: #39f1f9;
|
||||
* color: #39f1f9;
|
||||
* }
|
||||
*
|
||||
* /* Theme spinbuttons' entry */
|
||||
* GtkSpinButton.entry {
|
||||
* color: #900185
|
||||
* color: #900185
|
||||
* }
|
||||
* ]|
|
||||
* </example>
|
||||
@ -216,19 +216,19 @@
|
||||
* |[
|
||||
* /* Theme any label within a notebook */
|
||||
* GtkNotebook GtkLabel {
|
||||
* color: #f90192;
|
||||
* color: #f90192;
|
||||
* }
|
||||
*
|
||||
* /* Theme labels within notebook tabs */
|
||||
* GtkNotebook tab GtkLabel {
|
||||
* color: #703910;
|
||||
* color: #703910;
|
||||
* }
|
||||
*
|
||||
* /* Theme labels in the any first notebook
|
||||
* tab, both selectors are equivalent */
|
||||
* GtkNotebook tab:nth-child(first) GtkLabel,
|
||||
* GtkNotebook tab:first-child GtkLabel {
|
||||
* color: #89d012;
|
||||
* color: #89d012;
|
||||
* }
|
||||
* ]|
|
||||
* </example>
|
||||
@ -244,35 +244,35 @@
|
||||
* |[
|
||||
* /* Theme active (pressed) buttons */
|
||||
* GtkButton:active {
|
||||
* background-color: #0274d9;
|
||||
* background-color: #0274d9;
|
||||
* }
|
||||
*
|
||||
* /* Theme buttons with the mouse pointer on it,
|
||||
* both are equivalent */
|
||||
* GtkButton:hover,
|
||||
* GtkButton:prelight {
|
||||
* background-color: #3085a9;
|
||||
* background-color: #3085a9;
|
||||
* }
|
||||
*
|
||||
* /* Theme insensitive widgets, both are equivalent */
|
||||
* :insensitive,
|
||||
* *:insensitive {
|
||||
* background-color: #320a91;
|
||||
* background-color: #320a91;
|
||||
* }
|
||||
*
|
||||
* /* Theme selection colors in entries */
|
||||
* GtkEntry:selected {
|
||||
* background-color: #56f9a0;
|
||||
* background-color: #56f9a0;
|
||||
* }
|
||||
*
|
||||
* /* Theme focused labels */
|
||||
* GtkLabel:focused {
|
||||
* background-color: #b4940f;
|
||||
* background-color: #b4940f;
|
||||
* }
|
||||
*
|
||||
* /* Theme inconsistent checkbuttons */
|
||||
* GtkCheckButton:inconsistent {
|
||||
* background-color: #20395a;
|
||||
* background-color: #20395a;
|
||||
* }
|
||||
* ]|
|
||||
* </example>
|
||||
@ -296,7 +296,7 @@
|
||||
* <example>
|
||||
* <title>Using the @import rule</title>
|
||||
* |[
|
||||
* @import url ("path/to/common.css");
|
||||
* @import url ("path/to/common.css");
|
||||
* ]|
|
||||
* </example>
|
||||
* <para id="css-binding-set">
|
||||
@ -315,14 +315,14 @@
|
||||
* <example>
|
||||
* <title>Using the @binding rule</title>
|
||||
* |[
|
||||
* @binding-set binding-set1 {
|
||||
* bind "<alt>Left" { "move-cursor" (visual-positions, -3, 0) };
|
||||
* @binding-set binding-set1 {
|
||||
* bind "<alt>Left" { "move-cursor" (visual-positions, -3, 0) };
|
||||
* unbind "End";
|
||||
* };
|
||||
*
|
||||
* @binding-set binding-set2 {
|
||||
* bind "<alt>Right" { "move-cursor" (visual-positions, 3, 0) };
|
||||
* bind "<alt>KP_space" { "delete-from-cursor" (whitespace, 1)
|
||||
* @binding-set binding-set2 {
|
||||
* bind "<alt>Right" { "move-cursor" (visual-positions, 3, 0) };
|
||||
* bind "<alt>KP_space" { "delete-from-cursor" (whitespace, 1)
|
||||
* "insert-at-cursor" (" ") };
|
||||
* };
|
||||
*
|
||||
@ -340,10 +340,10 @@
|
||||
* <example>
|
||||
* <title>Defining colors</title>
|
||||
* |[
|
||||
* @define-color bg_color #f9a039;
|
||||
* @define-color bg_color #f9a039;
|
||||
*
|
||||
* * {
|
||||
* background-color: @bg_color;
|
||||
* * {
|
||||
* background-color: @bg_color;
|
||||
* }
|
||||
* ]|
|
||||
* </example>
|
||||
@ -359,15 +359,15 @@
|
||||
* <example>
|
||||
* <title>Using symbolic colors</title>
|
||||
* |[
|
||||
* @define-color entry-color shade (@bg_color, 0.7);
|
||||
* @define-color entry-color shade (@bg_color, 0.7);
|
||||
*
|
||||
* GtkEntry {
|
||||
* background-color: @entry-color;
|
||||
* }
|
||||
*
|
||||
* GtkEntry:focused {
|
||||
* background-color: mix (@entry-color,
|
||||
* shade (#fff, 0.5),
|
||||
* background-color: mix (@entry-color,
|
||||
* shade (#fff, 0.5),
|
||||
* 0.8);
|
||||
* }
|
||||
* ]|
|
||||
|
@ -93,8 +93,8 @@
|
||||
*
|
||||
* gtk_style_context_get_color (gtk_widget_get_style_context (widget),
|
||||
* 0,
|
||||
* &color);
|
||||
* gdk_cairo_set_source_rgba (cr, &color);
|
||||
* &color);
|
||||
* gdk_cairo_set_source_rgba (cr, &color);
|
||||
*
|
||||
* cairo_fill (cr);
|
||||
*
|
||||
|
@ -40,16 +40,16 @@
|
||||
* <example>
|
||||
* <title>Forcing entry to uppercase.</title>
|
||||
* |[<!-- language="C" -->
|
||||
* #include <ctype.h>
|
||||
* #include <ctype.h>;
|
||||
*
|
||||
* void
|
||||
* insert_text_handler (GtkEditable *editable,
|
||||
* const gchar *text,
|
||||
* insert_text_handler (GtkEditable *editable,
|
||||
* const gchar *text,
|
||||
* gint length,
|
||||
* gint *position,
|
||||
* gint *position,
|
||||
* gpointer data)
|
||||
* {
|
||||
* gchar *result = g_utf8_strup (text, length);
|
||||
* gchar *result = g_utf8_strup (text, length);
|
||||
*
|
||||
* g_signal_handlers_block_by_func (editable,
|
||||
* (gpointer) insert_text_handler, data);
|
||||
|
@ -53,7 +53,7 @@
|
||||
* <object class="GtkFileFilter">
|
||||
* <mime-types>
|
||||
* <mime-type>text/plain</mime-type>
|
||||
* <mime-type>image/*</mime-type>
|
||||
* <mime-type>image/*</mime-type>
|
||||
* </mime-types>
|
||||
* <patterns>
|
||||
* <pattern>*.txt</pattern>
|
||||
|
@ -1829,14 +1829,14 @@ gtk_main_do_event (GdkEvent *event)
|
||||
* <example>
|
||||
* <title>A persistent window</title>
|
||||
* |[<!-- language="C" -->
|
||||
* #include <gtk/gtk.h><
|
||||
* #include <gtk/gtk.h>
|
||||
*
|
||||
* int
|
||||
* main (int argc, char **argv)
|
||||
* {
|
||||
* GtkWidget *win, *but;
|
||||
*
|
||||
* gtk_init (&argc, &argv);
|
||||
* gtk_init (&argc, &argv);
|
||||
*
|
||||
* win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
* g_signal_connect (win, "delete-event",
|
||||
|
@ -59,10 +59,10 @@
|
||||
* GError *error = NULL;
|
||||
*
|
||||
* manager = gtk_recent_manager_get_default ();
|
||||
* info = gtk_recent_manager_lookup_item (manager, file_uri, &error);
|
||||
* info = gtk_recent_manager_lookup_item (manager, file_uri, &error);
|
||||
* if (error)
|
||||
* {
|
||||
* g_warning ("Could not find the file: %s", error->message);
|
||||
* g_warning ("Could not find the file: %s", error->message);
|
||||
* g_error_free (error);
|
||||
* }
|
||||
* else
|
||||
|
@ -2951,11 +2951,11 @@ gtk_style_context_lookup_color (GtkStyleContext *context,
|
||||
* Can be handled in the CSS file like this:
|
||||
* |[
|
||||
* GtkButton {
|
||||
* background-color: #f00
|
||||
* background-color: #f00
|
||||
* }
|
||||
*
|
||||
* GtkButton:hover {
|
||||
* background-color: #fff;
|
||||
* background-color: #fff;
|
||||
* transition: 200ms linear
|
||||
* }
|
||||
* ]|
|
||||
|
@ -123,19 +123,19 @@
|
||||
* GtkTreeIter parent_iter;
|
||||
*
|
||||
* /* get the iterator from a string */
|
||||
* gtk_tree_model_get_iter_from_string (model, &iter, "3:2:5");
|
||||
* gtk_tree_model_get_iter_from_string (model, &iter, "3:2:5");
|
||||
*
|
||||
* /* get the iterator from a path */
|
||||
* path = gtk_tree_path_new_from_string ("3:2:5");
|
||||
* gtk_tree_model_get_iter (model, &iter, path);
|
||||
* gtk_tree_model_get_iter (model, &iter, path);
|
||||
* gtk_tree_path_free (path);
|
||||
*
|
||||
* /* walk the tree to find the iterator */
|
||||
* gtk_tree_model_iter_nth_child (model, &iter, NULL, 3);
|
||||
* gtk_tree_model_iter_nth_child (model, &iter, NULL, 3);
|
||||
* parent_iter = iter;
|
||||
* gtk_tree_model_iter_nth_child (model, &iter, &parent_iter, 2);
|
||||
* gtk_tree_model_iter_nth_child (model, &iter, &parent_iter, 2);
|
||||
* parent_iter = iter;
|
||||
* gtk_tree_model_iter_nth_child (model, &iter, &parent_iter, 5);
|
||||
* gtk_tree_model_iter_nth_child (model, &iter, &parent_iter, 5);
|
||||
* ]|
|
||||
* </example>
|
||||
*
|
||||
@ -170,9 +170,9 @@
|
||||
*
|
||||
* /* Get the first iter in the list, check it is valid and walk
|
||||
* * through the list, reading each row. */
|
||||
* for (valid = gtk_tree_model_get_iter_first (list_store, &iter);
|
||||
* for (valid = gtk_tree_model_get_iter_first (list_store, &iter);
|
||||
* valid;
|
||||
* valid = gtk_tree_model_iter_next (list_store, &iter))
|
||||
* valid = gtk_tree_model_iter_next (list_store, &iter))
|
||||
* {
|
||||
* gchar *str_data;
|
||||
* gint int_data;
|
||||
@ -180,9 +180,9 @@
|
||||
* /* Make sure you terminate calls to gtk_tree_model_get()
|
||||
* * with a '-1' value
|
||||
* */
|
||||
* gtk_tree_model_get (list_store, &iter,
|
||||
* STRING_COLUMN, &str_data,
|
||||
* INT_COLUMN, &int_data,
|
||||
* gtk_tree_model_get (list_store, &iter,
|
||||
* STRING_COLUMN, &str_data,
|
||||
* INT_COLUMN, &int_data,
|
||||
* -1);
|
||||
*
|
||||
* /* Do something with the data */
|
||||
|
@ -11384,7 +11384,7 @@ gtk_XParseGeometry (const char *string,
|
||||
* GDK_HINT_BASE_SIZE |
|
||||
* GDK_HINT_RESIZE_INC);
|
||||
*
|
||||
* if (argc > 1)
|
||||
* if (argc > 1)
|
||||
* {
|
||||
* if (!gtk_window_parse_geometry (GTK_WINDOW (window), argv[1]))
|
||||
* fprintf (stderr, "Failed to parse '%s'\n", argv[1]);
|
||||
|
Loading…
Reference in New Issue
Block a user