Home > Gtk3, PyGObject, python > Python: PyGObject (Gtk3) appunti

Python: PyGObject (Gtk3) appunti

13 Aprile 2020

link di riferimento:
python gtk3 tutorial
Gtk3

Install

Su Ubuntu e Debian derivate installare i pacchetti: python3-gi, python3-gi-cairo e gir1.2-gtk-3.0:

$ sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-3.0

Creare un file di test:

$ touch testgi.py

ed al suo interno scrivere il seguente codice:

import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk


if __name__ == "__main__":
    window = Gtk.Window(title="Hello World")
    window.show()
    window.connect("destroy", Gtk.main_quit)
    Gtk.main()

ed eseguire il file con:

$ python3 testgi.py

Per l’installazione su windows seguire la guida ufficiale.

PyGObject

PyGObject è un modulo di Python che fornisce l’accesso alle librerie GObject-based come le GTK+.
PyGObject supporta esclusivamente GTK+ versione 3 o successive.
Per l’utilizzo di GTK+ 2 è necessario installare il modulo PyGTK

Appunti

Properties
Signals

Classi

Gtk.Application
Gtk.MenuBar
Gtk.Toolbar
Gtk.Builder
Gtk.HeaderBar
Gtk.Popover
Gio.SimpleAction
Gio.ActionMap
Gtk.ScrolledWindow

layout
Gtk.Box
Gtk.EventBox
Gtk.Grid

Gtk.Button
Gtk.LinkButton
Gtk.RadioButton
Gtk.ToggleButton
Gtk.CheckButton
Gtk.SpinButton
Gtk.Switch
Gtk.Label
Gtk.Entry
Gtk.ListBox
Gtk.ComboBox

model-view
Gtk.ListStore
Gtk.IconView
Gtk.TreeStore
Gtk.CellRenderer

Gtk.MessageDialog
Gtk.FileChooserDialog
Gtk.ProgressBar
Gtk.Spinner
Gtk.Stack e Gtk.StackSwitcher
Gtk.FlowBox

Gtk.Clipboard

Gtk.Image
GdkPixbuf.Pixbuf

Drag and Drop
Notebook
TextView (Multiline Text Editor)

link di riferimento:
python Gtk3 tutorial
Gtk3

Categorie:Gtk3, PyGObject, python Tag: , ,
I commenti sono chiusi.