Nictk 2.2.0
An easy to use pyton GUI
RowFrame Class Reference

A container in which you can stack rows vertically. More...

Inheritance diagram for RowFrame:
Widget Container Misc RowScrollFrame

Public Member Functions

def __init__ (self, parent, x, y, w, h, pad=0, content="")
 The constructor. More...
 
def add_row (self, h)
 Adds a row to the frame. More...
 
def del_row (self, n)
 Deletes a row from the frame. More...
 
def get_active (self)
 Returns the number of the active row in the frame. More...
 
def num_rows (self)
 Returns the total number of the rows in the frame. More...
 
def set_active (self, n)
 Sets the n-th row as active. More...
 
- Public Member Functions inherited from Widget
def activate (self)
 Sets the state of the widget to NORMAL. More...
 
def deactivate (self)
 Sets the state of the widget to DISABLED. More...
 
def destroy (self)
 Overrides the BaseWidget method, unmapping the widget if its parent is a _embedVerFrame. More...
 
def enabled (self)
 Returns True if the widget is enabled. More...
 
def get_content (self)
 Returns the content of the widget as a string. More...
 
def hide (self)
 Hides the widget. More...
 
def init_content (self, content)
 Sets the content type for the widget. More...
 
def resize (self, x=None, y=None, w=None, h=None, pad=None)
 Changes the dimensions of the widget. More...
 
def set_content (self, content)
 Sets the content of the widget. More...
 
def show (self)
 Shows a previously hidden widget. More...
 
def visible (self)
 Returns True if the widget is visible. 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 container in which you can stack rows vertically.

Each row behaves like a HorFrame, allowing to stack children widgets horizontally (using PACK as the x parameter in their constructor). You can add rows to the frame, obtaining thus a disposition similar to a matrix. When you add widgets you must indicate the RowFrame object (not the row) as their parent. The widgets will be added to the active row, which is the last constructed or the one set with the set_active() method. The frame is initialized with the same color of its parent and no border, being so invisible. However you can set a border and also a label to be shown on it.

Warning
setting a border reduces the space inside the frame
See also
RowFrame.py, Combobox.py Window.py example files

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  parent,
  x,
  y,
  w,
  h,
  pad = 0,
  content = "" 
)

The constructor.

The frame has initially no rows, and you must add them with the add_row() method.

Parameters
parentthe frame parent
x,y,w,hsee Placing the widgets
padthis is ignored, you cannot have a padding on frames
contenta string you can put as label

Reimplemented from Container.

Reimplemented in RowScrollFrame.

Member Function Documentation

◆ add_row()

def add_row (   self,
  h 
)

Adds a row to the frame.

Rows are stacked vertically from top to bottom. This also sets the new row as the active one: newly created widgets (which have the RowFrame as their parent) will belong to this row.

Parameters
hthe height of the row (the width coincides with the frame one); see Placing the widgets for the various options you have

◆ del_row()

def del_row (   self,
  n 
)

Deletes a row from the frame.

If the row is not the last one subsequent rows are moved up, if it was the active row the previous row becomes active.

Parameters
nthe number of the row (if it is not in the appropriate range an error is raised).

◆ get_active()

def get_active (   self)

Returns the number of the active row in the frame.

◆ num_rows()

def num_rows (   self)

Returns the total number of the rows in the frame.

◆ set_active()

def set_active (   self,
  n 
)

Sets the n-th row as active.

Newly created widgets (which have the RowFrame as their parent) will belong to this row. When you use add_row() the newly created row is automatically set as active.

Parameters
nthe row number (starting from 0)

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