Tutorial for beginners (Python) Un titorial para principiantes que queren aprender como programar interfaces de usuario GTK+ empregando Python. Tiffany Antopolski tiffany.antopolski@gmail.com 2012 Marta Maria Casetti mmcasetti@gmail.com 2012 2013 Jim Campbell jwcampbell@gmail.com 2013 Fran Dieguez frandieguez@gnome.org 2012-2013. Tutorial for beginners

By following these tutorials you will learn the basics of GUI programming using GTK+ in Python.

If you have never programmed before, or are not familiar with the concepts of object oriented programming, you may need to learn a few basics first. The book Learn Python the Hard Way or The Python Tutorial may be a better place for you to start. You may also be interested in The Python GTK+ 3 Tutorial. Once you master the basics, be sure to come back and check out these tutorials.

Para executar os exemplos de código

To run the code samples in the tutorial:

Type or copy and paste the code into a file, and save the file with a name like filename.py

To execute the code, type in the terminal:

python nomeficheiro.py

After executing the code, you will either see the widget on your screen, or (if you have mistyped some of the code) you will see an error message that will help you identify the problem.

A path through the widgets (with some theory)

The tutorial will walk you through increasingly complex examples and programming theory, but you can also feel free to just go directly to the tutorial that is most helpful to you.

Titorial Xanela básica

Imaxes e etiquetas

Introduction to properties

Grid, separator and scrolling

Signals, callbacks and buttons

ButtonBox

Outros widgets de visualización

Entry widgets

A widget to write and display text

Diálogos

Menus, Toolbars and Tooltips (also: using Glade and GtkBuilder)

Selectores

TreeViews e ComboBoxes (usando o deseño M/V/C)

Widget personalizado