module funcwin.frame_function
¶
Short summary¶
module tkinterquickhelper.funcwin.frame_function
FrameFunction
Classes¶
class |
truncated documentation |
---|---|
Creating a Frame window for a function. It will create an entry control for every parameter. If one of the parameter … |
|
Class associated to FrameFunction, it runs the function in a separate thread (in order to be able to stop its execution … |
Functions¶
function |
truncated documentation |
---|---|
Opens a tkinter window to run a function. It adds entries for the parameters, it displays the help associated … |
Properties¶
property |
truncated documentation |
---|---|
|
Internal function. |
|
A boolean value indicating whether this thread is a daemon thread. This must be set before start() is called, otherwise … |
|
Thread identifier of this thread or None if it has not been started. This is a nonzero integer. See the get_ident() … |
|
A string used for identification purposes only. It has no semantics. Multiple threads may be given the same name. … |
|
Native integral thread ID of this thread, or None if it has not been started. This is a non-negative integer. … |
Static Methods¶
staticmethod |
truncated documentation |
---|---|
Opens a tkinter window to run a function. It adds entries for the parameters, it displays the help associated … |
Methods¶
method |
truncated documentation |
---|---|
constructor |
|
Stops the thread and destroy the function. The behaviour of method Thread._stop … |
|
Returns the parameters in a dictionary. |
|
Looks forward in the history of used parameters and change the parameters. |
|
Looks back in the history of used parameters and change the parameters. |
|
Refreshes the screen. |
|
run the thread |
|
cancel |
|
Runs the function. |
|
Stops the function execution. |
|
Updates the parameters (ie |
Documentation¶
- class tkinterquickhelper.funcwin.frame_function.FrameFunction(parent, function, restore=True, width=100, raise_exception=False, overwrite=None, hide=False, command_leave=None, key_save='e')[source]¶
Bases:
Frame
Creating a Frame window for a function. It will create an entry control for every parameter. If one of the parameter is ‘password’, the window will show only stars. The windows proposes to store the value and to restore them on the next call. This functionality is disable when ‘password’ is present in the list of parameters.
- Parameters:
parent – window parent
function – function object (can be a string)
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
command_leave – if not None, this function will be called when clicking on Cancel or Leave
key_save – suffix to add to the filename used to store parameters
- __init__(parent, function, restore=True, width=100, raise_exception=False, overwrite=None, hide=False, command_leave=None, key_save='e')[source]¶
- Parameters:
parent – window parent
function – function object (can be a string)
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
command_leave – if not None, this function will be called when clicking on Cancel or Leave
key_save – suffix to add to the filename used to store parameters
- destroy()[source]¶
Stops the thread and destroy the function. The behaviour of method Thread._stop changed in Python 3.4, See the discussion.
- history_down(*args)[source]¶
Looks forward in the history of used parameters and change the parameters.
- static open_window(func, top_level_window=None, params=None, key_save='f', do_not_open=False)[source]¶
Opens a tkinter window to run a function. It adds entries for the parameters, it displays the help associated to this function, and it allows use to run the function in a window frame. Logs are also displayed. It also memorizes the latest values used (stored in <user>/TEMP folder).
- Parameters:
func – function (function object)
top_level_window – if you want this window to depend on a top level window from tkinter
params – if not None, overwrite values for some parameters
key_save – suffix added to the file used to store the parameters
do_not_open – if True, the function do not open the window but returns it
- Returns:
None or windows if do_not_open is True
The window looks like:
Example:
FrameFunction.open_window (file_head)
New in version 1.0: Parameter do_not_open was added.
- class tkinterquickhelper.funcwin.frame_function.FrameFunction_ThreadFunction(framewindow, parameter)[source]¶
Bases:
Thread
Class associated to FrameFunction, it runs the function in a separate thread (in order to be able to stop its execution from the interface).
constructor
- tkinterquickhelper.funcwin.frame_function.open_window_function(func, top_level_window=None, params=None, key_save='f', do_not_open=False)[source]¶
Opens a tkinter window to run a function. It adds entries for the parameters, it displays the help associated to this function, and it allows use to run the function in a window frame. Logs are also displayed. It also memorizes the latest values used (stored in
<user>/TEMP folder
).- Parameters:
func – function (function object)
top_level_window – if you want this window to depend on a top level window from tkinter
params – if not None, overwrite values for some parameters
key_save – suffix added to the file used to store the parameters
do_not_open – if True, the function do not open the window but returns it
- Returns:
None or windows if do_not_open is True
The window looks like:
Open a tkinter windows to run a function::
open_window_function (test_regular_expression)
The functions opens a window which looks like the following one:
The parameters
key_save
can be ignored but if you use this function with different parameters, they should all appear after a couple of runs. That is because the function useskey_save
ot unique the file uses to store the values for the parameters used in previous execution.New in version 1.0: Parameter do_not_open was added.