From dbe90a6278d3b57487e37f46f62067294e3e6aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20P=C3=B6lsterl?= Date: Tue, 21 Apr 2020 20:34:17 +0200 Subject: [PATCH] Rename GTK+ -> GTK Fixes #166 --- source/basics.txt | 10 +++++----- source/conf.py | 2 +- source/index.txt | 8 ++++---- source/install.txt | 8 ++++---- source/introduction.txt | 8 ++++---- source/label.txt | 4 ++-- source/layout-table.txt | 2 +- source/layout.txt | 10 +++++----- source/menus.txt | 4 ++-- source/objects.txt | 6 +++--- source/treeview.txt | 2 +- source/unicode.txt | 14 +++++++------- 12 files changed, 39 insertions(+), 39 deletions(-) diff --git a/source/basics.txt b/source/basics.txt index 4f7d328..ff63456 100644 --- a/source/basics.txt +++ b/source/basics.txt @@ -2,7 +2,7 @@ Basics ====== -This section will introduce some of the most important aspects of GTK+. +This section will introduce some of the most important aspects of GTK. @@ -10,10 +10,10 @@ This section will introduce some of the most important aspects of GTK+. Main loop and Signals --------------------- -Like most GUI toolkits, GTK+ uses an event-driven programming model. -When the user is doing nothing, GTK+ sits in the main loop and waits for input. +Like most GUI toolkits, GTK uses an event-driven programming model. +When the user is doing nothing, GTK sits in the main loop and waits for input. If the user performs some action - say, a mouse click - then the main loop -"wakes up" and delivers an event to GTK+. +"wakes up" and delivers an event to GTK. When widgets receive an event, they frequently emit one or more signals. Signals notify your program that "something interesting happened" by invoking @@ -21,7 +21,7 @@ functions you've connected to the signal. Such functions are commonly known as *callbacks*. When your callbacks are invoked, you would typically take some action - for example, when an Open button is clicked you might display a file chooser -dialog. After a callback finishes, GTK+ will return to the main loop and await +dialog. After a callback finishes, GTK will return to the main loop and await more user input. diff --git a/source/conf.py b/source/conf.py index bce0b97..b38c69f 100644 --- a/source/conf.py +++ b/source/conf.py @@ -47,7 +47,7 @@ master_doc = "index" # General information about the project. -project = u"Python GTK+ 3 Tutorial" +project = u"Python GTK 3 Tutorial" copyright = u"GNU Free Documentation License 1.3" locale_dirs = ["../translations/locale"] diff --git a/source/index.txt b/source/index.txt index 9194303..ba724f7 100644 --- a/source/index.txt +++ b/source/index.txt @@ -3,14 +3,14 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -The Python GTK+ 3 Tutorial +The Python GTK 3 Tutorial ========================== :Release: |version| :Date: |today| :Copyright: GNU Free Documentation License 1.3 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts -This tutorial gives an introduction to writing GTK+ 3 applications in Python. +This tutorial gives an introduction to writing GTK 3 applications in Python. Prior to working through this tutorial, it is recommended that you have a reasonable grasp of the Python programming language. @@ -23,8 +23,8 @@ For the more advanced widgets in this tutorial, good knowledge of lists and tuples will be needed. Although this tutorial describes the most important classes and methods within -GTK+ 3, it is not supposed to serve as an API reference. Please refer to the -`GTK+ 3 Reference Manual `_ for a +GTK 3, it is not supposed to serve as an API reference. Please refer to the +`GTK 3 Reference Manual `_ for a detailed description of the API. Also there's a `Python-specific reference `_ available. diff --git a/source/install.txt b/source/install.txt index 1cde610..00cc372 100644 --- a/source/install.txt +++ b/source/install.txt @@ -4,14 +4,14 @@ Installation ============ The first step before we start with actual coding consists of setting up `PyGObject`_ and its dependencies. PyGObject is a Python module -that enables developers to access GObject-based libraries such as GTK+ +that enables developers to access GObject-based libraries such as GTK within Python. -It exclusively supports GTK+ version 3 or later. +It exclusively supports GTK version 3 or later. Dependencies ------------ -* GTK+3 +* GTK 3 * Python 2 (2.6 or later) or Python 3 (3.1 or later) @@ -49,7 +49,7 @@ Executing the following command will build PyGObject and all its dependencies:: $ jhbuild build pygobject -Finally, you might want to install GTK+ from source as well:: +Finally, you might want to install GTK from source as well:: $ jhbuild build gtk+-3 diff --git a/source/introduction.txt b/source/introduction.txt index 0d68c32..3f97861 100644 --- a/source/introduction.txt +++ b/source/introduction.txt @@ -20,9 +20,9 @@ We will now explain each line of the example. :lines: 1-4 In the beginning, we have to import the Gtk module to be able to -access GTK+'s classes and functions. -Since a user's system can have multiple versions of GTK+ installed at the same, -we want to make sure that when we import Gtk that it refers to GTK+ 3 +access GTK's classes and functions. +Since a user's system can have multiple versions of GTK installed at the same, +we want to make sure that when we import Gtk that it refers to GTK 3 and not any other version of the library, which is the purpose of the statement ``gi.require_version('Gtk', '3.0')``. @@ -42,7 +42,7 @@ In the next step we display the window. .. literalinclude:: ../examples/simple_example.py :lines: 8 -Finally, we start the GTK+ processing loop which we quit when the window is +Finally, we start the GTK processing loop which we quit when the window is closed (see line 6). .. literalinclude:: ../examples/simple_example.py diff --git a/source/label.txt b/source/label.txt index f06d317..deecd19 100644 --- a/source/label.txt +++ b/source/label.txt @@ -25,14 +25,14 @@ Pango Markup syntax [#pango]_. For instance, ``bold text and strikethrough text``. In addition, :class:`Gtk.Label` supports clickable hyperlinks. The markup for links is borrowed from HTML, using the a with href and title -attributes. GTK+ renders links similar to the way they appear in web browsers, +attributes. GTK renders links similar to the way they appear in web browsers, with colored, underlined text. The title attribute is displayed as a tooltip on the link. .. code-block:: python label.set_markup("Go to GTK+ website for more") + "title=\"Our website\">GTK website for more") Labels may contain *mnemonics*. Mnemonics are underlined characters in the label, used for keyboard navigation. Mnemonics are created by providing a diff --git a/source/layout-table.txt b/source/layout-table.txt index d0f9ab9..789c326 100644 --- a/source/layout-table.txt +++ b/source/layout-table.txt @@ -2,7 +2,7 @@ Table ----- .. note:: :class:`Gtk.Table` - has been deprecated since GTK+ version 3.4 and should not be used in + has been deprecated since GTK version 3.4 and should not be used in newly-written code. Use the :ref:`layout-grid` class instead. Tables allows us to place widgets in a grid similar to :class:`Gtk.Grid`. diff --git a/source/layout.txt b/source/layout.txt index f89352b..283d327 100644 --- a/source/layout.txt +++ b/source/layout.txt @@ -3,7 +3,7 @@ Layout Containers ================= While many GUI toolkits require you to precisely place widgets in a window, -using absolute positioning, GTK+ uses a different approach. +using absolute positioning, GTK uses a different approach. Rather than specifying the position and size of each widget in the window, you can arrange your widgets in rows, columns, and/or tables. The size of your window can be determined automatically, based on the sizes @@ -12,11 +12,11 @@ And the sizes of the widgets are, in turn, determined by the amount of text they contain, or the minimum and maximum sizes that you specify, and/or how you have requested that the available space should be shared between sets of widgets. You can perfect your layout by specifying padding distance and -centering values for each of your widgets. GTK+ then uses all this information +centering values for each of your widgets. GTK then uses all this information to resize and reposition everything sensibly and smoothly when the user manipulates the window. -GTK+ arranges widgets hierarchically, using *containers*. +GTK arranges widgets hierarchically, using *containers*. They are invisible to the end user and are inserted into a window, or placed within each other to layout components. There are two flavours of containers: single-child @@ -168,7 +168,7 @@ to place children at the start or the end. In addition, it allows a title to be displayed. The title will be centered with respect to the width of the box, even if the children at either side take up different amounts of space. -Since GTK+ now supports Client Side Decoration, a :class:`Gtk.HeaderBar` can +Since GTK now supports Client Side Decoration, a :class:`Gtk.HeaderBar` can be used in place of the title bar (which is rendered by the Window Manager). A :class:`Gtk.HeaderBar` is usually located across the top of a window and @@ -187,7 +187,7 @@ Example FlowBox ------- -.. note:: This example requires at least GTK+ 3.12. +.. note:: This example requires at least GTK 3.12. A :class:`Gtk.FlowBox` is a container that positions child widgets in sequence according to its orientation. diff --git a/source/menus.txt b/source/menus.txt index 7b890d2..6530f96 100644 --- a/source/menus.txt +++ b/source/menus.txt @@ -2,10 +2,10 @@ Menus ===== .. note:: :class:`Gtk.UIManager`, :class:`Gtk.Action`, and :class:`Gtk.ActionGroup` - have been deprecated since GTK+ version 3.10 and should not be used in + have been deprecated since GTK version 3.10 and should not be used in newly-written code. Use the :ref:`application` framework instead. -GTK+ comes with two different types of menus, :class:`Gtk.MenuBar` and +GTK comes with two different types of menus, :class:`Gtk.MenuBar` and :class:`Gtk.Toolbar`. :class:`Gtk.MenuBar` is a standard menu bar which contains one or more :class:`Gtk.MenuItem` instances or one of its subclasses. :class:`Gtk.Toolbar` widgets are used for quick accessibility to commonly used diff --git a/source/objects.txt b/source/objects.txt index 730caca..c40d091 100644 --- a/source/objects.txt +++ b/source/objects.txt @@ -4,7 +4,7 @@ Objects ======= GObject is the fundamental type providing the common attributes and methods -for all object types in GTK+, Pango and other libraries based on GObject. +for all object types in GTK, Pango and other libraries based on GObject. The :class:`GObject.GObject` class provides methods for object construction and destruction, property access methods, and signal support. @@ -37,8 +37,8 @@ Signals ------- Signals connect arbitrary application-specific events with any number of listeners. -For example, in GTK+, every user event (keystroke or mouse move) is received -from the X server and generates a GTK+ event under the form of a signal emission +For example, in GTK, every user event (keystroke or mouse move) is received +from the X server and generates a GTK event under the form of a signal emission on a given object instance. Each signal is registered in the type system together with the type on which it diff --git a/source/treeview.txt b/source/treeview.txt index 8a9c941..12ab055 100644 --- a/source/treeview.txt +++ b/source/treeview.txt @@ -154,7 +154,7 @@ Once the :class:`Gtk.TreeView` widget has a model, it will need to know how to display the model. It does this with columns and cell renderers. Cell renderers are used to draw the data in the tree model in a way. There are a -number of cell renderers that come with GTK+, for instance +number of cell renderers that come with GTK, for instance :class:`Gtk.CellRendererText`, :class:`Gtk.CellRendererPixbuf` and :class:`Gtk.CellRendererToggle`. In addition, it is relatively easy to write a custom renderer yourself. diff --git a/source/unicode.txt b/source/unicode.txt index 00cf64c..e529cf0 100644 --- a/source/unicode.txt +++ b/source/unicode.txt @@ -2,7 +2,7 @@ How to Deal With Strings ======================== This section explains how strings are represented in Python 2.x, Python 3.x -and GTK+ and discusses common errors that arise when working with strings. +and GTK and discusses common errors that arise when working with strings. Definitions ----------- @@ -81,9 +81,9 @@ get :exc:`UnicodeDecodeError` if it contained non-ASCII values:: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2: ordinal not in range(128) -Unicode in GTK+ +Unicode in GTK +++++++++++++++ -GTK+ uses UTF-8 encoded strings for all text. This means that if you call a +GTK uses UTF-8 encoded strings for all text. This means that if you call a method that returns a string you will always obtain an instance of the :class:`str` type. The same applies to methods that expect one or more strings as parameter, they must be UTF-8 encoded. However, for convenience PyGObject will automatically @@ -110,9 +110,9 @@ This is especially important if you want to internationalize your program using `gettext `_. You have to make sure that gettext will return UTF-8 encoded 8-bit strings for all languages. In general it is recommended to not use :class:`unicode` objects -in GTK+ applications at all and only use UTF-8 encoded :class:`str` objects since -GTK+ does not fully integrate with :class:`unicode` objects. Otherwise, you would -have to decode the return values to Unicode strings each time you call a GTK+ method:: +in GTK applications at all and only use UTF-8 encoded :class:`str` objects since +GTK does not fully integrate with :class:`unicode` objects. Otherwise, you would +have to decode the return values to Unicode strings each time you call a GTK method:: >>> txt = label.get_text().decode("utf-8") >>> txt == unicode_string @@ -144,7 +144,7 @@ because it will result in a :exc:`TypeError`:: >>> text.encode("utf-8") + data b'Fu\xc3\x9fb\xc3\xa4lle sind rund' -Unicode in GTK+ +Unicode in GTK +++++++++++++++ As a consequence, things are much cleaner and consistent with Python 3.x, because PyGObject will automatically encode/decode to/from UTF-8 if you pass a string to