- PyGTK - Drag and Drop
- PyGTK - Timeout
- PyGTK - Ruler Class
- PyGTK - Clipboard Class
- PyGTK - Calendar Class
- PyGTK - SpinButton Class
- PyGTK - DrawingArea Class
- PyGTK - Image Class
- PyGTK - Arrow Class
- PyGTK - Scrolledwindow Class
- PyGTK - Viewport Class
- PyGTK - ProgressBar Class
- PyGTK - Statusbar Class
- PyGTK - Paned Class
- PyGTK - TreeView Class
- PyGTK - AspectFrame Class
- PyGTK - Frame Class
- PyGTK - Notebook Class
- PyGTK - File Chooser Dialog
- PyGTK - Color Selection Dialog
- PyGTK - Font Selection Dialog
- PyGTK - AboutDialog Class
- PyGTK - MessageDialog Class
- PyGTK - Dialog Class
- PyGTK - Scrollbar Class
- PyGTK - Scale Class
- PyGTK - Range Class
- PyGTK - Adjustment Class
- PyGTK - Toolbar Class
- PyGTK - MenuBar, Menu & MenuItem
- PyGTK - RadioButton Class
- PyGTK - CheckButton Class
- PyGTK - ToggleButton Class
- PyGTK - ComboBox Class
- PyGTK - Layout Class
- PyGTK - EventBox Class
- PyGTK - Alignment Class
- PyGTK - ButtonBox Class
- PyGTK - Box Class
- PyGTK - Containers
- PyGTK - Event Handling
- PyGTK - Signal Handling
- PyGTK - Entry Class
- PyGTK - Label CLass
- PyGTK - Button Class
- PyGTK - Window Class
- PyGTK - Important Classes
- PyGTK - Hello World
- PyGTK - Environment
- PyGTK - Introduction
- PyGTK - Home
PyGTK Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
PyGTK - Window Class
An object of the gtk.Window class provides a widget that users commonly think of as a Wwindow. This widget is a container hence, it can hold one child widget. It provides a displayable area decorated with title bar and resizing controls.
gtk.Window class has the following constructor −
gtk.Window(type)
Type paramter takes one of the following values −
gtk.WINDOW_TOPLEVEL (default) | This window has no parent. The Toplevel windows are the main apppcation window and dialogs. |
gtk.WINDOW_POPUP | This window has no frame or decorations. A popup window is used for menus and tooltips. |
Some of the important methods of the gtk.Window class are psted below −
S.NO | Methods and Description |
---|---|
1 | set_title(string) This sets the "title" property of the gtk.window to the value specified by the title. The title of a window will be displayed in its title bar. |
2 | get_title() This returns the title of a window if set. |
3 | set_position() This sets the position of window. The predefined position constants are − gtk.WIN_POS_NONE gtk.WIN_POS_CENTER gtk.WIN_POS_MOUSE gtk.WIN_POS_CENTER_ALWAYS gtk.WIN_POS_CENTER_ON_PARENT |
3 | set_focus() This sets the widget specified to be the focus widget for the window. |
4 | set_resizable() This is true by default. set_resizable() helps the user to set the size of a window. |
5 | set_decorated() This is true by default. If false, the title bar and the resizing controls of window will be disabled. |
6 | set_modal() If true, window becomes modal and the interaction with other windows is prevented. This is used for the Dialog widgets. |
7 | set_default_size() This sets the default size of the window to the specified width and height in pixels. |
The gtk.Window widget emits the following signals −
activate-default | This is emitted when the default child widget of window is activated usually by the user pressing the Return or Enter key. |
activate-focus | This is emitted when the child widget with the focus is activated usually by the user pressing the Space key. |
move-focus | This is emitted when the focus is changed within the window s child widgets when the user presses the Tab, the Shift+Tab or the Up, Down, Left or Right arrow keys. |
set-focus | This is emitted when the focus changes to widget in window. |