module funcwin.main_window

Inheritance diagram of tkinterquickhelper.funcwin.main_window

Short summary

module tkinterquickhelper.funcwin.main_window

building windows to use a function and specify its parameter based on a python function

source on GitHub

Classes

class

truncated documentation

MainFrame

Creates a Frame window to select within a list of functions, FrameFunction. The class requires to run tix.Tk()

Functions

function

truncated documentation

main_loop_functions

Uses MainFrame as the main window.

Properties

property

truncated documentation

_windowingsystem

Internal function.

Methods

method

truncated documentation

__init__

change_frame_function

Updates the frame FrameFunction to select a new function.

change_selection

Functions called when the selection changes.

get_title

Returns the default title.

run_cancel

cancel

Documentation

building windows to use a function and specify its parameter based on a python function

source on GitHub

class tkinterquickhelper.funcwin.main_window.MainFrame(parent, functions, first=None, restore=True, width=100, raise_exception=False, overwrite=None, hide=False)[source]

Bases: tkinter.Frame

Creates a Frame window to select within a list of functions, FrameFunction. The class requires to run tix.Tk() and not tkinter.Tk(). Otherwise, you will see the following error:

_tkinter.TclError: invalid command name "tixComboBox"

It is required by the use of ComboBox. main_loop_functions to see what the window will look like.

source on GitHub

Parameters
  • parent – window parent

  • functions – dictionary with a list of functions { name: function }

  • first – first function to select

  • restore – if True, check if existing saved parameters are present

  • width – number of characters in every Entry field

  • raise_exception – raise an exception instead of catching it

  • overwrite – parameters to overwrite

  • hide – if True, hide the window after clicking on OK

source on GitHub

__init__(parent, functions, first=None, restore=True, width=100, raise_exception=False, overwrite=None, hide=False)[source]
Parameters
  • parent – window parent

  • functions – dictionary with a list of functions { name: function }

  • first – first function to select

  • restore – if True, check if existing saved parameters are present

  • width – number of characters in every Entry field

  • raise_exception – raise an exception instead of catching it

  • overwrite – parameters to overwrite

  • hide – if True, hide the window after clicking on OK

source on GitHub

change_frame_function(function)[source]

Updates the frame FrameFunction to select a new function.

Parameters

function – a function (a pointer)

source on GitHub

change_selection(event)[source]

Functions called when the selection changes.

source on GitHub

get_title()[source]

Returns the default title.

Returns

string

source on GitHub

run_cancel(*args)[source]

cancel

source on GitHub

tkinterquickhelper.funcwin.main_window.main_loop_functions(functions, first=None, restore=True, width=100, raise_exception=False, overwrite=None, hide=False, title=None, ico=None, init_pos=None, mainloop=True)[source]

Uses MainFrame as the main window.

Parameters
  • functions – dictionary with a list of functions { name: function }

  • first – first function to select

  • restore – if True, check if existing saved parameters are present

  • width – number of characters in every Entry field

  • raise_exception – raise an exception instead of catching it

  • overwrite – parameters to overwrite

  • hide – if True, hide the window after clicking on OK

  • title – if not None, overwrite the default title

  • ico – (str) an icon or None

  • init_pos – location of the window (x,y) or None

  • mainloop – run the mainloop

Returns

main window

Open a window to run a function from a predefined list of functions

functions = {"test_regular_expression":test_regular_expression,
             "test_edit_distance":file_grep,
             "file_head":file_head }
main_loop_functions(functions, title="title: TestMakeWindow2")
../../_images/open_functionl.png

source on GitHub