module 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
Classes¶
class |
truncated documentation |
---|---|
Creates a Frame window to select within a list of functions, |
Functions¶
function |
truncated documentation |
---|---|
Uses |
Properties¶
property |
truncated documentation |
---|---|
|
Internal function. |
Methods¶
method |
truncated documentation |
---|---|
Updates the frame |
|
Functions called when the selection changes. |
|
Returns the default title. |
|
cancel |
Documentation¶
building windows to use a function and specify its parameter based on a python function
- class tkinterquickhelper.funcwin.main_window.MainFrame(parent, functions, first=None, restore=True, width=100, raise_exception=False, overwrite=None, hide=False)[source]¶
Bases:
Frame
Creates a Frame window to select within a list of functions,
FrameFunction
. The class requires to runtix.Tk()
and nottkinter.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.- 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
- __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
- change_frame_function(function)[source]¶
Updates the frame
FrameFunction
to select a new function.- Parameters:
function – a function (a pointer)
- 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")