-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
67 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Anatomy of a Gtk Application | ||
|
||
Gtk user interfaces consist of widgets. | ||
Widgets are objects that derive from ``/GlibObject/Object`` | ||
and are organised in a hierarchical fashion, i.e., | ||
every widget is a container that can contain zero, one, | ||
or sometimes more than one other widget. | ||
|
||
The main container of a Gtk application is the ``/Gtk/ApplicationWindow``, | ||
which is a subclass of ``Window`` that integrates with the actual ``/Gtk/Application``. | ||
The user interface of an application is created by adding other widgets such as | ||
``/Gtk/Button``s, text ``/Gtk/Entry`` fields, ``/Gtk/MenuBar``s and similar. | ||
While it is possible to add widgets programmatically, a simpler | ||
way is to create an XML `ui` file and use ``/Gtk/Builder`` to create the widgets | ||
from the user interface file. There are tools you can use to design user interfaces | ||
graphically, such as [Cambalache](https://flathub.org/apps/ar.xjuan.Cambalache) | ||
for gtk4 (as well as gtk3) and [Glade](https://gitlab.gnome.org/GNOME/glade) | ||
for gtk3 (but there are [recommendations to write user interface files by hand] | ||
(https://blogs.gnome.org/christopherdavis/2020/11/19/glade-not-recommended/)). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters