Nictk 2.2.0
An easy to use pyton GUI
Misc Class Reference

Base class for windows and widgets. More...

Inheritance diagram for Misc:
BaseWindow Menu Widget Main Window Button Canvas Checkbutton Combobox Entry HorFrame Label Listbox Notebook Radiobutton RowFrame Scale Spinbox Text VerFrame

Public Member Functions

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...
 

Static Public Attributes

def winfo_h = winfo_height
 Alias for winfo_height() More...
 
def winfo_w = winfo_width
 Alias for winfo_width() More...
 

Detailed Description

Base class for windows and widgets.

It defines methods common for windows and interior widgets, it is used only as a mixin (you should not use it directly). It doesn't inherit from tk.Misc, because it's always mixed in with other classes that already do it.

Member Function Documentation

◆ bind()

def bind (   self,
  sequence = None,
  func = None,
  add = None 
)

Redefines the tk.Misc.bind() method.

This allows events bound with the bind() method (and not only with the command option, as in tkinter) to be ignored when the widget is in DISABLED state

◆ config()

def config (   self,
  cnf = None,
**  kw 
)

Configures resources of a widget.

The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method keys(). This method redefine tkinter config() to allow some changes in resource names; for detail see Widgets properties.

Parameters
cnf,kwthe options.
See also
WidgetOptions.py example file

Reimplemented in Entry, and Listbox.

◆ get_config()

def get_config (   self,
  key 
)

Returns the value for the key resource.

Parameters
keya string which indicates what we want to know.

Reimplemented in Entry, and Listbox.

◆ get_winfo()

def get_winfo (   self,
  key 
)

Returns the widget info for the item key.

Parameters
keya string which indicates what we want to know. See Getting widget informations for a list
See also
winfo.py example file

◆ has_option()

def has_option (   self,
  opt = None 
)

Returns True if the widget admits the given option.

Parameters
optif you leave None the method returns a list of all its options as strings. If you give an option (string) returns True or False

◆ parent()

def parent (   self)

Returns the widget parent.

See Getting widget informations

◆ toplevel()

def toplevel (   self)

Returns the widget toplevel container (a Window or Main).

See Getting widget informations

◆ unbind()

def unbind (   self,
  sequence,
  funcid = None 
)

Redefines the tk.Misc.unbind() method.

This allows a correct unbinding for some class with particular bindings.

◆ winfo_bh()

def winfo_bh (   self)

Returns the height of the widget bounding box.

See winfo_bx() for details.

◆ winfo_bpad()

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.

◆ winfo_bw()

def winfo_bw (   self)

Returns the width of the widget bounding box.

See winfo_bx() for details

◆ winfo_bx()

def winfo_bx (   self)

Returns the x coordinate of the widget bounding box topleft corner.

Note
This is not the widget x if you have set a pad for the x; however this is the effective x which the library uses for packing widgets horizontally.

◆ winfo_by()

def winfo_by (   self)

Returns the y coordinate of the widget bounding box topleft corner.

See winfo_bx() for details.

◆ winfo_height()

def winfo_height (   self)

Returns the widget height.

It redefines the tk function, and is aliased by winfo_h(). See winfo_x() for details.

◆ winfo_width()

def winfo_width (   self)

Returns the widget width.

It redefines the tk function, and is aliased by winfo_w(). See winfo_x() for details.

◆ winfo_x()

def winfo_x (   self)

Returns the x coordinate of the topleft corner of the widget with respect to the parent.

It redefines the tk function, because it returns wrong values until you call update() or update_idletasks(), while this gives the value calculated by the constructor.

Note
This method takes into account the pad you indicate in the constructor, so if you must use it for spacing widgets you may want to use the value of the widget bounding box with winfo_bx()

◆ winfo_y()

def winfo_y (   self)

Returns the y coordinate of the topleft corner of the widget with respect to the parent.

See winfo_x() for details.

Member Data Documentation

◆ winfo_h

def winfo_h = winfo_height
static

Alias for winfo_height()

◆ winfo_w

def winfo_w = winfo_width
static

Alias for winfo_width()


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