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 −
Type paramter takes one of the following values −
|gtk.WINDOW_TOPLEVEL (default)||This window has no parent. The Toplevel windows are the main application 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 listed below −
|S.NO||Methods and Description|
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.
This returns the title of a window if set.
This sets the position of window. The predefined position constants are −
This sets the widget specified to be the focus widget for the window.
This is true by default. set_resizable() helps the user to set the size of a window.
This is true by default. If false, the title bar and the resizing controls of window will be disabled.
If true, window becomes modal and the interaction with other windows is prevented. This is used for the Dialog widgets.
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.|