# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-06-30 15:27+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../../source/application.txt:4 msgid "Application" msgstr "" #: ../../source/application.txt:6 msgid "" ":class:`Gtk.Application` encompasses many repetitive tasks that a modern " "application needs such as handling multiple instances, D-Bus activation, " "opening files, command line parsing, startup/shutdown, menu management, " "window management, and more." msgstr "" #: ../../source/application.txt:12 ../../source/menus.txt:17 msgid "Actions" msgstr "" #: ../../source/application.txt:14 msgid "" ":class:`Gio.Action` is a way to expose any single task your application or " "widget does by a name. These actions can be disabled/enabled at runtime and " "they can either be activated or have a state changed (if they contain state)." msgstr "" #: ../../source/application.txt:18 msgid "" "The reason to use actions is to separate out the logic from the UI. For " "example this allows using a menubar on OSX and a gear menu on GNOME both " "simply referencing the name of an action. The main implementation of this " "you will be using is :class:`Gio.SimpleAction` which will be demonstrated " "later." msgstr "" #: ../../source/application.txt:23 msgid "" "Many classes such as :class:`Gio.MenuItem` and :class:`Gtk.ModelButton` " "support properties to set an action name." msgstr "" #: ../../source/application.txt:26 msgid "" "These actions can be grouped together into a :class:`Gio.ActionGroup` and " "when these groups are added to a widget with :meth:`Gtk.Widget." "insert_action_group()` they will gain a prefix. Such as \"win\" when added " "to a :class:`Gtk.ApplicationWindow`. You will use the full action name when " "referencing it such as \"app.about\" but when you create the action it will " "just be \"about\" until added to the application." msgstr "" #: ../../source/application.txt:32 msgid "" "You can also very easily make keybindings for actions by setting the `accel` " "property in the :class:`Gio.Menu` file or by using :meth:`Gtk.Application." "set_accels_for_action()`." msgstr "" #: ../../source/application.txt:36 ../../source/menus.txt:2 msgid "Menus" msgstr "" #: ../../source/application.txt:38 msgid "" "Your menus should be defined in XML using :class:`Gio.Menu` and would " "reference the previously mentioned actions you defined. :class:`Gtk." "Application` allows you to set a menu either via :meth:`Gtk.Application." "set_app_menu()` or :meth:`Gtk.Application.set_menubar()`. If you make use " "of :class:`Gio.Resource` this can automatically use the correct menu based " "on platform, otherwise you can set them manually. A detailed example is " "shown below." msgstr "" #: ../../source/application.txt:46 msgid "Command Line" msgstr "" #: ../../source/application.txt:48 msgid "" "When creating your application it takes a flag property of :class:`Gio." "ApplicationFlags`. Using this you can let it handle everything itself or " "have more custom behavior." msgstr "" #: ../../source/application.txt:51 msgid "" "You can use `HANDLES_COMMAND_LINE` to allow custom behavior in :meth:`Gio." "Application.do_command_line()`. In combination with :meth:`Gio.Application." "add_main_option()` to add custom options." msgstr "" #: ../../source/application.txt:54 msgid "" "Using `HANDLES_OPEN` will do the work of simply taking file arguments for " "you and let you handle it in :meth:`Gio.Application.do_open()`." msgstr "" #: ../../source/application.txt:57 msgid "" "If your application is already open these will all be sent to the existing " "instance unless you use `NON_UNIQUE` to allow multiple instances." msgstr "" #: ../../source/application.txt:61 ../../source/builder.txt:118 #: ../../source/button_widgets.txt:18 ../../source/button_widgets.txt:39 #: ../../source/button_widgets.txt:78 ../../source/button_widgets.txt:95 #: ../../source/button_widgets.txt:131 ../../source/button_widgets.txt:150 #: ../../source/cellrenderers.txt:39 ../../source/cellrenderers.txt:59 #: ../../source/cellrenderers.txt:74 ../../source/cellrenderers.txt:98 #: ../../source/cellrenderers.txt:116 ../../source/cellrenderers.txt:138 #: ../../source/clipboard.txt:17 ../../source/combobox.txt:32 #: ../../source/dialogs.txt:46 ../../source/dialogs.txt:66 #: ../../source/dialogs.txt:130 ../../source/drag_and_drop.txt:74 #: ../../source/entry.txt:32 ../../source/expander.txt:19 #: ../../source/iconview.txt:10 ../../source/label.txt:48 #: ../../source/layout.txt:40 ../../source/layout.txt:97 #: ../../source/layout.txt:123 ../../source/layout.txt:156 #: ../../source/layout.txt:180 ../../source/layout.txt:212 #: ../../source/layout.txt:232 ../../source/layout-table.txt:26 #: ../../source/menus.txt:80 ../../source/popover.txt:19 #: ../../source/popover.txt:38 ../../source/progressbar.txt:32 #: ../../source/spinner.txt:12 ../../source/spinner.txt:29 #: ../../source/textview.txt:115 msgid "Example" msgstr "" #: ../../source/application.txt:69 ../../source/popover.txt:45 msgid "See Also" msgstr "" #: ../../source/application.txt:71 msgid "https://wiki.gnome.org/HowDoI/GtkApplication" msgstr "" #: ../../source/application.txt:72 msgid "https://wiki.gnome.org/HowDoI/GAction" msgstr "" #: ../../source/application.txt:73 msgid "https://wiki.gnome.org/HowDoI/ApplicationMenu" msgstr "" #: ../../source/application.txt:74 msgid "https://wiki.gnome.org/HowDoI/GMenu" msgstr "" #: ../../source/basics.txt:4 msgid "Basics" msgstr "" #: ../../source/basics.txt:5 msgid "This section will introduce some of the most important aspects of GTK+." msgstr "" #: ../../source/basics.txt:12 msgid "Main loop and Signals" msgstr "" #: ../../source/basics.txt:13 msgid "" "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+." msgstr "" #: ../../source/basics.txt:18 msgid "" "When widgets receive an event, they frequently emit one or more signals. " "Signals notify your program that \"something interesting happened\" by " "invoking 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 more user input." msgstr "" #: ../../source/basics.txt:28 msgid "A generic example is:" msgstr "" #: ../../source/basics.txt:34 msgid "" "Firstly, *widget* is an instance of a widget we created earlier. Next, the " "event we are interested in. Each widget has its own particular events which " "can occur. For instance, if you have a button you usually want to connect to " "the \"clicked\" event. This means that when the button is clicked, the " "signal is issued. Thirdly, the *callback* argument is the name of the " "callback function. It contains the code which runs when signals of the " "specified type are issued. Finally, the *data* argument includes any data " "which should be passed when the signal is issued. However, this argument is " "completely optional and can be left out if not required." msgstr "" #: ../../source/basics.txt:46 msgid "" "The function returns a number that identifies this particular signal-" "callback pair. It is required to disconnect from a signal such that the " "callback function will not be called during any future or currently ongoing " "emissions of the signal it has been connected to." msgstr "" #: ../../source/basics.txt:56 msgid "" "If you have lost the \"handler_id\" for some reason (for example the " "handlers were installed using :func:`Gtk.Builder.connect_signals`), you can " "still disconnect a specific callback using the function :func:" "`disconnect_by_func`:" msgstr "" #: ../../source/basics.txt:64 msgid "" "Applications should connect to the \"destroy\" signal of the top-level " "window. It is emitted when an object is destroyed, so when a user requests " "that a toplevel window is closed, the default handler for this signal " "destroys the window, but does not terminate the application. Connecting the " "\"destroy\" signal of the top-level window to the function :func:`Gtk." "main_quit` will result in the desired behaviour." msgstr "" #: ../../source/basics.txt:74 msgid "" "Calling :func:`Gtk.main_quit` makes the main loop inside of :func:`Gtk.main` " "return." msgstr "" #: ../../source/basics.txt:77 ../../source/objects.txt:96 msgid "Properties" msgstr "" #: ../../source/basics.txt:78 msgid "" "Properties describe the configuration and state of widgets. As for signals, " "each widget has its own particular set of properties. For example, a button " "has the property \"label\" which contains the text of the label widget " "inside the button. You can specify the name and value of any number of " "properties as keyword arguments when creating an instance of a widget. To " "create a label aligned to the right with the text \"Hello World\" and an " "angle of 25 degrees, use:" msgstr "" #: ../../source/basics.txt:89 msgid "which is equivalent to" msgstr "" #: ../../source/basics.txt:98 msgid "" "Instead of using getters and setters you can also get and set the gobject " "properties through the \"props\" property such as ``widget.props.prop_name = " "value``. This is equivalent to the more verbose ``widget.get_property(\"prop-" "name\")`` and ``widget.set_property(\"prop-name\", value)``." msgstr "" #: ../../source/basics.txt:103 msgid "" "To see which properties are available for a widget in the running version of " "GTK you can \"dir\" the \"props\" property:" msgstr "" #: ../../source/basics.txt:110 msgid "This will print in the console the list of properties a Gtk.Box has." msgstr "" #: ../../source/builder.txt:2 msgid "Glade and Gtk.Builder" msgstr "" #: ../../source/builder.txt:3 msgid "" "The :class:`Gtk.Builder` class offers you the opportunity to design user " "interfaces without writing a single line of code. This is achieved by " "defining the interface in an XML file and then loading that XML UI " "definition at runtime using the Builder class which creates the objects " "automatically. To avoid writing the XML manually use the `Glade `_ application which lets you create the user interface in " "a WYSIWYG (what you see is what you get) manner" msgstr "" #: ../../source/builder.txt:7 msgid "This method has several advantages:" msgstr "" #: ../../source/builder.txt:9 msgid "Less code needs to be written." msgstr "" #: ../../source/builder.txt:10 msgid "UI changes can be seen more quickly, so UIs are able to improve." msgstr "" #: ../../source/builder.txt:11 msgid "Designers without programming skills can create and edit UIs." msgstr "" #: ../../source/builder.txt:12 msgid "" "The description of the user interface is independent from the programming " "language being used." msgstr "" #: ../../source/builder.txt:14 msgid "" "There is still code required for handling interface changes triggered by the " "user, but :class:`Gtk.Builder` allows you to focus on implementing that " "functionality." msgstr "" #: ../../source/builder.txt:17 msgid "Creating and loading the .glade file" msgstr "" #: ../../source/builder.txt:18 msgid "" "First of all you have to download and install Glade. There are `several " "tutorials `_ about " "Glade, so this is not explained here in detail. Let's start by creating a " "window with a button in it and saving it to a file named *example.glade*. " "The resulting XML file should look like this." msgstr "" #: ../../source/builder.txt:41 msgid "To load this file in Python we need a :class:`Gtk.Builder` object." msgstr "" #: ../../source/builder.txt:48 msgid "" "The second line loads all objects defined in *example.glade* into the " "Builder object." msgstr "" #: ../../source/builder.txt:50 msgid "" "It is also possible to load only some of the objects. The following line " "would add only the objects (and their child objects) given in the tuple." msgstr "" #: ../../source/builder.txt:57 msgid "" "These two methods exist also for loading from a string rather than a file. " "Their corresponding names are :meth:`Gtk.Builder.add_from_string` and :meth:" "`Gtk.Builder.add_objects_from_string` and they simply take a XML string " "instead of a file name." msgstr "" #: ../../source/builder.txt:61 msgid "Accessing widgets" msgstr "" #: ../../source/builder.txt:62 msgid "" "Now that the window and the button are loaded we also want to show them. " "Therefore the :meth:`Gtk.Window.show_all` method has to be called on the " "window. But how do we access the associated object?" msgstr "" #: ../../source/builder.txt:71 msgid "" "Every widget can be retrieved from the builder by the :meth:`Gtk.Builder." "get_object` method and the widget's *id*. It is really *that* simple." msgstr "" #: ../../source/builder.txt:74 msgid "It is also possible to get a list of all objects with" msgstr "" #: ../../source/builder.txt:81 msgid "Connecting Signals" msgstr "" #: ../../source/builder.txt:82 msgid "" "Glade also makes it possible to define signals which you can connect to " "handlers in your code without extracting every object from the builder and " "connecting to the signals manually. The first thing to do is to declare the " "signal names in Glade. For this example we will act when the window is " "closed and when the button was pressed, so we give the name \"onDestroy\" to " "the callback handling the \"destroy\" signal of the window and " "\"onButtonPressed\" to the callback handling the \"pressed\" signal of the " "button. Now the XML file should look like this." msgstr "" #: ../../source/builder.txt:90 msgid "" "Now we have to define the handler functions in our code. The *onDestroy* " "should simply result in a call to :meth:`Gtk.main_quit`. When the button is " "pressed we would like to print the string \"Hello World!\", so we define the " "handler as follows" msgstr "" #: ../../source/builder.txt:99 msgid "" "Next, we have to connect the signals and the handler functions. The easiest " "way to do this is to define a *dict* with a mapping from the names to the " "handlers and then pass it to the :meth:`Gtk.Builder.connect_signals` method." msgstr "" #: ../../source/builder.txt:110 msgid "" "An alternative approach is to create a class which has methods that are " "called like the signals. In our example the last code snippet could be " "rewritten as:" msgstr "" #: ../../source/builder.txt:119 msgid "The final code of the example" msgstr "" #: ../../source/builder.txt:125 msgid "Gtk.Template" msgstr "" #: ../../source/builder.txt:126 msgid "" ":class:`Gtk.WidgetClass` allows UI definition files to be used to extend a " "widget, PyGObject provides :doc:`guide/gtk_template` as a way of accessing " "this from Python." msgstr "" #: ../../source/builder.txt:129 msgid "" "The UI definition file used in the example needs a small change to include a " "*