For the more advanced widgets in this tutorial, good knowledge If you want to use GTK+ 2 in your application, use PyGTK, instead. import pygtk musicmarkup.infoe("") import gtk def quit(*args): musicmarkup.info_quit() greeting = musicmarkup.info("hello, world") button = musicmarkup.info(stock=musicmarkup.info_QUIT). Prior to working through this tutorial, it is recommended that you have a reasonable grasp of the Python programming language. GUI programming introduces.
|Language:||English, Spanish, Portuguese|
|ePub File Size:||22.57 MB|
|PDF File Size:||20.69 MB|
|Distribution:||Free* [*Sign up for free]|
The PyGTK programming tutorial is suited for novice and more advanced programmers. PyGTK. PyGTK is a set of Python wrappers for the GTK+ GUI library. PyGTK is a set of wrappers written in Python and C for GTK + GUI library. It is part of PyGTK. Advanced programmers can also draw benefits from this tutorial. PyGTK Tutorial for Beginners - Learn PyGTK in simple and easy steps starting from basic to advanced concepts with examples including Tutorial. PDF Version.
NoOpObjectFactory — the atk. ObjectFactory which creates an atk. ObjectFactory — the base object class for a factory used to create accessible objects for objects of a specific GType. Rectangle — an object holding data about a rectangle atk. Registry — an object used to store the GType of the factories used to create an accessible object for an object of a particular GType.
ItemFactory — creates menus, menubars and option menus from a data description. Label — a widget that displays a limited amount of read-only text gtk.
Layout — infinite scrollable area containing child widgets and custom drawing gtk. ListStore — a list model to use with a gtk. TreeView gtk. Menu — a drop down menu widget. MenuBar — a widget that displays gtk. MenuItem widgets horizontally gtk.
MenuItem — the widget used for an item in menus gtk. MenuShell — a base class for menu objects. MenuToolButton — A gtk. MessageDialog — a convenient message window gtk. Misc — a base class for widgets with alignments and padding. Notebook — a tabbed notebook container. Object — the base class of the PyGTK type hierarchy. OffscreenWindow — a toplevel container widget used to manage offscreen rendering of child widgets new in PyGTK 2. OptionMenu — a widget used to provide a list of valid choices.
Paned — a base class for widgets with two adjustable panes gtk. Plug — A toplevel window for embedding into other processes.
ProgressBar — a widget which indicates progress visually. RadioButton — a choice of one of multiple check buttons. RadioMenuItem — a choice from multiple check menu items. Range — a base class for widgets that allow a user to set a value in a range. RcStyle — an object holding resource styles gtk.
RecentChooser — an interface implemented by gtk. RecentChooserWidget , gtk. RecentChooserMenu and gtk. RecentInfo — information found when looking up an entry of the recently used files list.
Requisition — an object containing information about the desired space requirements of a widget. Ruler — a base class for horizontal or vertical rulers gtk.
Scale — a base class for the scale widgets. ScaleButton — A button which pops up a scale. Scrollbar — a base class for scrollbar widgets. ScrolledWindow — adds scrollbars to its child widget. SelectionData — an object that stores information about a selection gtk.
Separator — a base class for visual separator widgets. SeparatorMenuItem — a separator used in menus. Settings — an object that contains the global settings for the widgets on a gtk. Screen gtk. SizeGroup — an object that groups widgets so they request the same size gtk. Socket — a container for widgets from other processes. SpinButton — retrieve an integer or floating-point number from the user.
Spinner — show a spinner animation new in PyGTK 2. Statusbar — report messages of minor importance to the user. Style — an object that hold style information for widgets gtk.
Table — layout widgets in a two-dimensional array gtk. TearoffMenuItem — a menu item used to tear off and reattach its menu. TextAttributes — an object containing the attributes set on some text gtk. TextBuffer — stores attributed text for display in a gtk. TextView gtk. TextChildAnchor — a location in a textbuffer for placing widgets gtk.
TextIter — an object pointing at a location in a gtk. TextBuffer gtk. TextMark — a position in a textbuffer that is preserved across textbuffer modifications gtk. TextTag — an object used to apply attributes to text in a gtk.
TextTagTable — A collection of gtk. TextTag objects that can be used together gtk. TextView — a widget that displays the contents of a gtk. ToggleButton — a button that retains its state gtk. ToggleToolButton — A gtk. Toolbar — a bar holding buttons and other widgets. ToolButton — a gtk.
ToolItem — the base class of widgets that can be added to gtk. Toolbar new in PyGTK 2.
Tooltips — add tips to your widgets. TreeDragDest — an interface that manages the data transfer for a destination of a gtk. TreeView drag and drop operation gtk. TreeDragSource — an interface that manages the source data transfer for a gtk. TreeIter — An object that points at a path in a gtk.
TreeModel — the tree interface used by gtk. TreeModelFilter — a gtk. TreeModelSort — a tree model that is a sorted version of a child gtk. TreeModel gtk.
TreeModelRow — an object representing a row in a gtk. TreeModelRowIter — an object for iterating over a set of gtk. TreeModelRow objects. TreeRowReference — an object maintaining a persistent reference to a gtk. TreeSelection — the selection object for gtk. TreeSortable — an interface for sorting a gtk.
TreeStore — a model for tree widgets with columns gtk. TreeView — a widget for displaying both trees and lists. TreeViewColumn — a visible column in a gtk. TreeView widget gtk.
VBox — a vertical container box gtk. VButtonBox — a container for arranging buttons vertically. VPaned — A container with two panes arranged vertically. VRuler — a vertical ruler. VScale — a vertical slider widget used to select a value from a range.
VScrollbar — a vertical scrollbar gtk. Viewport — a widget displaying a portion of a larger widget. Widget — the base class for all PyGTK widgets gtk.
Window — a top-level window that holds one child widget. Children are added using Gtk. They can span multiple rows or columns. It is also possible to add a child next to an existing child, using Gtk. Grid can be used like a Gtk. Box by just using Gtk. Grid self. RIGHT, 2, 1 grid. The grids dimensions need to be specied in the Gtk. Table constructor. To place a widget into a box, use Gtk. Note that for columns, the space goes to the right of the column, and for rows, the space goes below the row.
Note that with these calls, the last row and last column do not get any spacing. Table 3, 3, True self. ListBox is a vertical container that contains Gtk. ListBoxRow children. These rows can by dynamically sorted and ltered, and headers can be added dynamically depending on the row content. It also allows keyboard and mouse navigation and selection like a typical list.
ListBox is often an alternative to Gtk. TreeView, especially when the list contents has a more complicated layout than what is allowed by a Gtk. CellRenderer, or when the contents is interactive i. Although a Gtk. ListBox must have only Gtk. ListBoxRow children you can add any kind of widget to it via Gtk. ListBoxRow widget will automatically be inserted between the list and the widget. ListBox listbox.
NONE hbox. Switch switch. CheckButton hbox. ComboBoxText combo. Stack is a container which only shows one of its children at a time. In contrast to Gtk. Notebook, Gtk. Stack does not provide a means for users to change the visible child. Instead, the Gtk. StackSwitcher widget can be used with Gtk.
Stack to provide this functionality. Transitions between pages can be animated as slides or fades. This can be controlled with Gtk. These animations respect the gtk-enable-animations setting. Transition speed can be adjusted with Gtk. StackSwitcher widget acts as a controller for a Gtk. Stack; it shows a row of buttons to switch between the various pages of the associated stack widget. All the content for the buttons comes from the child properties of the Gtk. It is possible to associate multiple Gtk.
StackSwitcher widgets with the same Gtk. Stack widget. Stack stack. CheckButton "Click me! HeaderBar is similar to a horizontal Gtk. Box, it allows 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. HeaderBar can be used in place of the title bar which is rendered by the Window Manager. A Gtk. HeaderBar is usually located across the top of a window and should contain commonly used controls which 5. They also provide access to window controls, including the close window button and window menu. HeaderBar hb. Button button.
Arrow Gtk. LEFT, Gtk. NONE box. Entry widget. You can specify the text in the constructor, or later with the Gtk. The width of the label will be adjusted automatically. Labels can be made selectable with Gtk. Selectable labels allow the user to copy the label contents to the clipboard. Only labels that contain useful-to-copy information such as error messages should be made selectable.