PyGTK - Important Classes



The PyGTK module contains various widgets. gtk.Object class acts as the base class for most of the widgets as well as for some non-widget classes. The toplevel window for desktop applications using PyGTK is provided by gtk.Window class. The following table lists the important widgets and their functions −

S.NO Classes and Description
1

gtk.Widget

This is a gtk.base class for all PyGTK widgets. gtk.Widget provides a common set of methods and signals for the widgets.

2

gtk.Window

This is a toplevel window that holds one child widget. gtk.Window is a display area decorated with a title bar, and items to allow the user to close, resize and move the window.

3

gtk.Button

This is a pushbutton widget that issues a signal when clicked. gtk.Button is usually displayed as a pushbutton with a text label and is generally used to attach a callback function.

4

gtk.Entry

This is a single line text entry widget.

5

gtk.Label

This widget displays a limited amount of read-only text.

6

gtk.ButtonBox

This is a base class for widgets that contains multiple buttons.

7

gtk.HBox

This is a container that organizes its child widgets into a single horizontal row.

8

gtk.VBox

This is a container that organizes its child widgets into a single column.

9

gtk.Fixed

This is a container that can place child widgets at fixed positions and with fixed sizes, given in pixels.

10

gtk.Layout

This provides infinite scrollable area containing child widgets and custom drawing.

11

gtk.MenuItem

This widget implements the appearance and behavior of menu items. The derived widget subclasses of the gtk.MenuItem are the only valid children of menus. When selected by a user, they can display a popup menu or invoke an associated function or method

12

gtk.Menu

This is a dropdown menu consisting of a list of MenuItem objects which can be navigated and activated by the user to perform application functions.

13

gtk.MenuBar

This displays the menu items horizontally in an application window or dialog.

14

gtk.ComboBox

This widget is used to choose from a list of items.

15

gtk.Scale

This is a horizontal or vertical slider control to select a numeric value.

16

gtk.Scrollbar

This displays a horizontal or vertical scrollbar.

17

gtk.ProgressBar

This is used to display the progress of a long running operation.

18

gtk.Dialog

This displays a popup window for user information and action.

19

gtk.Notebook

This widget is a container whose children are overlapping pages that can be switched between using tab labels.

20

gtk.Paned

This is a base class for widgets with two panes, arranged either horizontally or vertically. Child widgets are added to the panes of the widget. The division between the two children can be adjusted by the user.

21

gtk.TextView

This widget displays the contents of a TextBuffer object.

22

gtk.Toolbar

This container holds and manages a set of buttons and widgets in a horizontal or vertical bar.

23

gtk.TreeView

This widget displays the contents of standard TreeModel (ListStore, TreeStore, TreeModelSort)

24

gtk.DrawingArea

This widget helps in creating custom user interface elements. gtk.DrawingArea is essentially a blank widget containing a window that you can draw on.

25

gtk.Calendar

This widget displays a calendar and allows the user to select a date.

26

gtk.Viewport

This widget displays a portion of a larger widget.

Advertisements