Nictk 2.2.0
An easy to use pyton GUI
Window Class Reference

A common window (derived from the tkinter Toplevel class) which is directly managed by the windows manager. More...

Inheritance diagram for Window:
BaseWindow Misc Container

Public Member Functions

def __init__ (self, parent, x, y, w, h, title="", modal=NORMAL)
 The constructor. More...
 
def hide (self)
 Hides the window. More...
 
def set_modal (self, modal)
 Changes the mode of the window, making it normal, modal or persistent. More...
 
def show (self)
 Shows the window, making it visible. More...
 
def visible (self)
 Returns True if the window is visible. More...
 
- Public Member Functions inherited from BaseWindow
def onclose (self, command)
 Defines a callback to call when the window is closed. More...
 
- Public Member Functions inherited from Misc
def bind (self, sequence=None, func=None, add=None)
 Redefines the tk.Misc.bind() method. More...
 
def config (self, cnf=None, **kw)
 Configures resources of a widget. More...
 
def get_config (self, key)
 Returns the value for the key resource. More...
 
def get_winfo (self, key)
 Returns the widget info for the item key. More...
 
def has_option (self, opt=None)
 Returns True if the widget admits the given option. More...
 
def parent (self)
 Returns the widget parent. More...
 
def toplevel (self)
 Returns the widget toplevel container (a Window or Main). More...
 
def unbind (self, sequence, funcid=None)
 Redefines the tk.Misc.unbind() method. More...
 
def winfo_bh (self)
 Returns the height of the widget bounding box. More...
 
def winfo_bpad (self)
 Returns the list of the four pad amounts (E-N-W-S) of the widget with respect to its bounding box. More...
 
def winfo_bw (self)
 Returns the width of the widget bounding box. More...
 
def winfo_bx (self)
 Returns the x coordinate of the widget bounding box topleft corner. More...
 
def winfo_by (self)
 Returns the y coordinate of the widget bounding box topleft corner. More...
 
def winfo_height (self)
 Returns the widget height. More...
 
def winfo_width (self)
 Returns the widget width. More...
 
def winfo_x (self)
 Returns the x coordinate of the topleft corner of the widget with respect to the parent. More...
 
def winfo_y (self)
 Returns the y coordinate of the topleft corner of the widget with respect to the parent. More...
 
- Public Member Functions inherited from Container
def config_children (self, which, **kw)
 Configures resources for all children. More...
 

Additional Inherited Members

- Static Public Attributes inherited from Misc
def winfo_h = winfo_height
 Alias for winfo_height() More...
 
def winfo_w = winfo_width
 Alias for winfo_width() More...
 

Detailed Description

A common window (derived from the tkinter Toplevel class) which is directly managed by the windows manager.

You can hide or show it mantaining all the internal widgets states, or destroy and re-create it if you want all widgets to be reinitialized. You can choose three possible modes for it: normal, modal or persistent (see Window.__init__())

Common options (see Widgets properties)

borderwidth, relief, bcolor, cursor, hbcolor, hfcolor, takefocus

Less common options

class, menu, screen, use, colormap, container, highlightthickness, 
padx, pady, visual

see anzeljg reference for the class tkinter.Toplevel

See also
Window.py example file

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  parent,
  x,
  y,
  w,
  h,
  title = "",
  modal = NORMAL 
)

The constructor.

Parameters
parentyou can indicate None or your Main
x,y,w,hsee Placing the widgets
titlethe window title
modalone of these three:
  • "normal" (or NORMAL) this is a normal window
  • "modal" the window will grab the focus until it is closed, preventing to switch to other windows: can be used for dialogs
  • "persistent" the window can lose the focus but will remain on top until it is closed.

Reimplemented from BaseWindow.

Member Function Documentation

◆ hide()

def hide (   self)

Hides the window.

It will not be displayed, but its data remain managed and the internal widgets state do not change; use show() to newly display it. If the window was already hidden it does nothing.

◆ set_modal()

def set_modal (   self,
  modal 
)

Changes the mode of the window, making it normal, modal or persistent.

This will have effect on the next call of show().

Parameters
modalsee init()

◆ show()

def show (   self)

Shows the window, making it visible.

◆ visible()

def visible (   self)

Returns True if the window is visible.


The documentation for this class was generated from the following file: