Tkinter :: Wm :: Class Wm
[hide private]
[frames] | no frames]

Class Wm

source code

Known Subclasses:
Tk, Toplevel

Provides functions for the communication with the window manager.

Instance Methods [hide private]
  aspect(self, minNumer=None, minDenom=None, maxNumer=None, maxDenom=None)
Instruct the window manager to set the aspect ratio (width/height) of this widget to be between MINNUMER/MINDENOM and MAXNUMER/MAXDENOM.
  attributes(self, *args)
This subcommand returns or sets platform specific attributes
  client(self, name=None)
Store NAME in WM_CLIENT_MACHINE property of this widget.
  colormapwindows(self, *wlist)
Store list of window names (WLIST) into WM_COLORMAPWINDOWS property of this widget.
  command(self, value=None)
Store VALUE in WM_COMMAND property.
  deiconify(self)
Deiconify this widget.
  focusmodel(self, model=None)
Set focus model to MODEL.
  frame(self)
Return identifier for decorative frame of this widget if present.
  geometry(self, newGeometry=None)
Set geometry to NEWGEOMETRY of the form =widthxheight+x+y.
  grid(self, baseWidth=None, baseHeight=None, widthInc=None, heightInc=None)
Instruct the window manager that this widget shall only be resized on grid boundaries.
  group(self, pathName=None)
Set the group leader widgets for related widgets to PATHNAME.
  iconbitmap(self, bitmap=None)
Set bitmap for the iconified widget to BITMAP.
  iconify(self)
Display widget as icon.
  iconmask(self, bitmap=None)
Set mask for the icon bitmap of this widget.
  iconname(self, newName=None)
Set the name of the icon for this widget.
  iconposition(self, x=None, y=None)
Set the position of the icon of this widget to X and Y.
  iconwindow(self, pathName=None)
Set widget PATHNAME to be displayed instead of icon.
  maxsize(self, width=None, height=None)
Set max WIDTH and HEIGHT for this widget.
  minsize(self, width=None, height=None)
Set min WIDTH and HEIGHT for this widget.
  overrideredirect(self, boolean=None)
Instruct the window manager to ignore this widget if BOOLEAN is given with 1.
  positionfrom(self, who=None)
Instruct the window manager that the position of this widget shall be defined by the user if WHO is "user", and by its own policy if WHO is "program".
  protocol(self, name=None, func=None)
Bind function FUNC to command NAME for this widget.
  resizable(self, width=None, height=None)
Instruct the window manager whether this width can be resized in WIDTH or HEIGHT.
  sizefrom(self, who=None)
Instruct the window manager that the size of this widget shall be defined by the user if WHO is "user", and by its own policy if WHO is "program".
  state(self, newstate=None)
Query or set the state of this widget as one of normal, icon, iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only).
  title(self, string=None)
Set the title of this widget.
  transient(self, master=None)
Instruct the window manager that this widget is transient with regard to widget MASTER.
  withdraw(self)
Withdraw this widget from the screen such that it is unmapped and forgotten by the window manager.
  wm_aspect(self, minNumer=None, minDenom=None, maxNumer=None, maxDenom=None)
Instruct the window manager to set the aspect ratio (width/height) of this widget to be between MINNUMER/MINDENOM and MAXNUMER/MAXDENOM.
  wm_attributes(self, *args)
This subcommand returns or sets platform specific attributes
  wm_client(self, name=None)
Store NAME in WM_CLIENT_MACHINE property of this widget.
  wm_colormapwindows(self, *wlist)
Store list of window names (WLIST) into WM_COLORMAPWINDOWS property of this widget.
  wm_command(self, value=None)
Store VALUE in WM_COMMAND property.
  wm_deiconify(self)
Deiconify this widget.
  wm_focusmodel(self, model=None)
Set focus model to MODEL.
  wm_frame(self)
Return identifier for decorative frame of this widget if present.
  wm_geometry(self, newGeometry=None)
Set geometry to NEWGEOMETRY of the form =widthxheight+x+y.
  wm_grid(self, baseWidth=None, baseHeight=None, widthInc=None, heightInc=None)
Instruct the window manager that this widget shall only be resized on grid boundaries.
  wm_group(self, pathName=None)
Set the group leader widgets for related widgets to PATHNAME.
  wm_iconbitmap(self, bitmap=None)
Set bitmap for the iconified widget to BITMAP.
  wm_iconify(self)
Display widget as icon.
  wm_iconmask(self, bitmap=None)
Set mask for the icon bitmap of this widget.
  wm_iconname(self, newName=None)
Set the name of the icon for this widget.
  wm_iconposition(self, x=None, y=None)
Set the position of the icon of this widget to X and Y.
  wm_iconwindow(self, pathName=None)
Set widget PATHNAME to be displayed instead of icon.
  wm_maxsize(self, width=None, height=None)
Set max WIDTH and HEIGHT for this widget.
  wm_minsize(self, width=None, height=None)
Set min WIDTH and HEIGHT for this widget.
  wm_overrideredirect(self, boolean=None)
Instruct the window manager to ignore this widget if BOOLEAN is given with 1.
  wm_positionfrom(self, who=None)
Instruct the window manager that the position of this widget shall be defined by the user if WHO is "user", and by its own policy if WHO is "program".
  wm_protocol(self, name=None, func=None)
Bind function FUNC to command NAME for this widget.
  wm_resizable(self, width=None, height=None)
Instruct the window manager whether this width can be resized in WIDTH or HEIGHT.
  wm_sizefrom(self, who=None)
Instruct the window manager that the size of this widget shall be defined by the user if WHO is "user", and by its own policy if WHO is "program".
  wm_state(self, newstate=None)
Query or set the state of this widget as one of normal, icon, iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only).
  wm_title(self, string=None)
Set the title of this widget.
  wm_transient(self, master=None)
Instruct the window manager that this widget is transient with regard to widget MASTER.
  wm_withdraw(self)
Withdraw this widget from the screen such that it is unmapped and forgotten by the window manager.

Method Details [hide private]

aspect(self, minNumer=None, minDenom=None, maxNumer=None, maxDenom=None)

source code 
Instruct the window manager to set the aspect ratio (width/height) of this widget to be between MINNUMER/MINDENOM and MAXNUMER/MAXDENOM. Return a tuple of the actual values if no argument is given.

attributes(self, *args)

source code 

This subcommand returns or sets platform specific attributes

The first form returns a list of the platform specific flags and their values. The second form returns the value for the specific option. The third form sets one or more of the values. The values are as follows:

On Windows, -disabled gets or sets whether the window is in a disabled state. -toolwindow gets or sets the style of the window to toolwindow (as defined in the MSDN). -topmost gets or sets whether this is a topmost window (displays above all other windows).

On Macintosh, XXXXX

On Unix, there are currently no special attribute values.

client(self, name=None)

source code 
Store NAME in WM_CLIENT_MACHINE property of this widget. Return current value.

colormapwindows(self, *wlist)

source code 
Store list of window names (WLIST) into WM_COLORMAPWINDOWS property of this widget. This list contains windows whose colormaps differ from their parents. Return current list of widgets if WLIST is empty.

command(self, value=None)

source code 
Store VALUE in WM_COMMAND property. It is the command which shall be used to invoke the application. Return current command if VALUE is None.

deiconify(self)

source code 
Deiconify this widget. If it was never mapped it will not be mapped. On Windows it will raise this widget and give it the focus.

focusmodel(self, model=None)

source code 
Set focus model to MODEL. "active" means that this widget will claim the focus itself, "passive" means that the window manager shall give the focus. Return current focus model if MODEL is None.

frame(self)

source code 
Return identifier for decorative frame of this widget if present.

geometry(self, newGeometry=None)

source code 
Set geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return current value if None is given.

grid(self, baseWidth=None, baseHeight=None, widthInc=None, heightInc=None)

source code 
Instruct the window manager that this widget shall only be resized on grid boundaries. WIDTHINC and HEIGHTINC are the width and height of a grid unit in pixels. BASEWIDTH and BASEHEIGHT are the number of grid units requested in Tk_GeometryRequest.

group(self, pathName=None)

source code 
Set the group leader widgets for related widgets to PATHNAME. Return the group leader of this widget if None is given.

iconbitmap(self, bitmap=None)

source code 
Set bitmap for the iconified widget to BITMAP. Return the bitmap if None is given.

iconify(self)

source code 
Display widget as icon.

iconmask(self, bitmap=None)

source code 
Set mask for the icon bitmap of this widget. Return the mask if None is given.

iconname(self, newName=None)

source code 
Set the name of the icon for this widget. Return the name if None is given.

iconposition(self, x=None, y=None)

source code 
Set the position of the icon of this widget to X and Y. Return a tuple of the current values of X and X if None is given.

iconwindow(self, pathName=None)

source code 
Set widget PATHNAME to be displayed instead of icon. Return the current value if None is given.

maxsize(self, width=None, height=None)

source code 
Set max WIDTH and HEIGHT for this widget. If the window is gridded the values are given in grid units. Return the current values if None is given.

minsize(self, width=None, height=None)

source code 
Set min WIDTH and HEIGHT for this widget. If the window is gridded the values are given in grid units. Return the current values if None is given.

overrideredirect(self, boolean=None)

source code 
Instruct the window manager to ignore this widget if BOOLEAN is given with 1. Return the current value if None is given.

positionfrom(self, who=None)

source code 
Instruct the window manager that the position of this widget shall be defined by the user if WHO is "user", and by its own policy if WHO is "program".

protocol(self, name=None, func=None)

source code 
Bind function FUNC to command NAME for this widget. Return the function bound to NAME if None is given. NAME could be e.g. "WM_SAVE_YOURSELF" or "WM_DELETE_WINDOW".

resizable(self, width=None, height=None)

source code 
Instruct the window manager whether this width can be resized in WIDTH or HEIGHT. Both values are boolean values.

sizefrom(self, who=None)

source code 
Instruct the window manager that the size of this widget shall be defined by the user if WHO is "user", and by its own policy if WHO is "program".

state(self, newstate=None)

source code 
Query or set the state of this widget as one of normal, icon, iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only).

title(self, string=None)

source code 
Set the title of this widget.

transient(self, master=None)

source code 
Instruct the window manager that this widget is transient with regard to widget MASTER.

withdraw(self)

source code 
Withdraw this widget from the screen such that it is unmapped and forgotten by the window manager. Re-draw it with wm_deiconify.

wm_aspect(self, minNumer=None, minDenom=None, maxNumer=None, maxDenom=None)

source code 
Instruct the window manager to set the aspect ratio (width/height) of this widget to be between MINNUMER/MINDENOM and MAXNUMER/MAXDENOM. Return a tuple of the actual values if no argument is given.

wm_attributes(self, *args)

source code 

This subcommand returns or sets platform specific attributes

The first form returns a list of the platform specific flags and their values. The second form returns the value for the specific option. The third form sets one or more of the values. The values are as follows:

On Windows, -disabled gets or sets whether the window is in a disabled state. -toolwindow gets or sets the style of the window to toolwindow (as defined in the MSDN). -topmost gets or sets whether this is a topmost window (displays above all other windows).

On Macintosh, XXXXX

On Unix, there are currently no special attribute values.

wm_client(self, name=None)

source code 
Store NAME in WM_CLIENT_MACHINE property of this widget. Return current value.

wm_colormapwindows(self, *wlist)

source code 
Store list of window names (WLIST) into WM_COLORMAPWINDOWS property of this widget. This list contains windows whose colormaps differ from their parents. Return current list of widgets if WLIST is empty.

wm_command(self, value=None)

source code 
Store VALUE in WM_COMMAND property. It is the command which shall be used to invoke the application. Return current command if VALUE is None.

wm_deiconify(self)

source code 
Deiconify this widget. If it was never mapped it will not be mapped. On Windows it will raise this widget and give it the focus.

wm_focusmodel(self, model=None)

source code 
Set focus model to MODEL. "active" means that this widget will claim the focus itself, "passive" means that the window manager shall give the focus. Return current focus model if MODEL is None.

wm_frame(self)

source code 
Return identifier for decorative frame of this widget if present.

wm_geometry(self, newGeometry=None)

source code 
Set geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return current value if None is given.

wm_grid(self, baseWidth=None, baseHeight=None, widthInc=None, heightInc=None)

source code 
Instruct the window manager that this widget shall only be resized on grid boundaries. WIDTHINC and HEIGHTINC are the width and height of a grid unit in pixels. BASEWIDTH and BASEHEIGHT are the number of grid units requested in Tk_GeometryRequest.

wm_group(self, pathName=None)

source code 
Set the group leader widgets for related widgets to PATHNAME. Return the group leader of this widget if None is given.

wm_iconbitmap(self, bitmap=None)

source code 
Set bitmap for the iconified widget to BITMAP. Return the bitmap if None is given.

wm_iconify(self)

source code 
Display widget as icon.

wm_iconmask(self, bitmap=None)

source code 
Set mask for the icon bitmap of this widget. Return the mask if None is given.

wm_iconname(self, newName=None)

source code 
Set the name of the icon for this widget. Return the name if None is given.

wm_iconposition(self, x=None, y=None)

source code 
Set the position of the icon of this widget to X and Y. Return a tuple of the current values of X and X if None is given.

wm_iconwindow(self, pathName=None)

source code 
Set widget PATHNAME to be displayed instead of icon. Return the current value if None is given.

wm_maxsize(self, width=None, height=None)

source code 
Set max WIDTH and HEIGHT for this widget. If the window is gridded the values are given in grid units. Return the current values if None is given.

wm_minsize(self, width=None, height=None)

source code 
Set min WIDTH and HEIGHT for this widget. If the window is gridded the values are given in grid units. Return the current values if None is given.

wm_overrideredirect(self, boolean=None)

source code 
Instruct the window manager to ignore this widget if BOOLEAN is given with 1. Return the current value if None is given.

wm_positionfrom(self, who=None)

source code 
Instruct the window manager that the position of this widget shall be defined by the user if WHO is "user", and by its own policy if WHO is "program".

wm_protocol(self, name=None, func=None)

source code 
Bind function FUNC to command NAME for this widget. Return the function bound to NAME if None is given. NAME could be e.g. "WM_SAVE_YOURSELF" or "WM_DELETE_WINDOW".

wm_resizable(self, width=None, height=None)

source code 
Instruct the window manager whether this width can be resized in WIDTH or HEIGHT. Both values are boolean values.

wm_sizefrom(self, who=None)

source code 
Instruct the window manager that the size of this widget shall be defined by the user if WHO is "user", and by its own policy if WHO is "program".

wm_state(self, newstate=None)

source code 
Query or set the state of this widget as one of normal, icon, iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only).

wm_title(self, string=None)

source code 
Set the title of this widget.

wm_transient(self, master=None)

source code 
Instruct the window manager that this widget is transient with regard to widget MASTER.

wm_withdraw(self)

source code 
Withdraw this widget from the screen such that it is unmapped and forgotten by the window manager. Re-draw it with wm_deiconify.