This class models the clickTk code assistent.
$assistent = ctkAssistent->new(-parent => $mw);
$code = $assistent->Show();
if (defined $code) {
}
None
Author: marco
date: 17.08.2006
History
17.08.2006 first draft.
18.08.2006 version 1.02
09.02.2007 version 1.03
06.03.2008 version 1.05
15.10.2008 version 1.07
- new
- Show
- tkFunctions
- parent
- target
- assistedValues
- funcList
- _copyCode
- _synchHelp
- _ok
- _cancel
- _selectWidget
- _insertOrReplace
- loadFuncList
- compileFuncList
Create a new instance .
- Argument
-
parent widget
- Return
-
ref to instance.
Activate the assistent dialog window.
- Arguments
-
None.
- Return
-
Always undef
Set up the popup to select values
- Arguments
-
- self,
- ref to main window,
- ref to text widget receiving the selected value.
-
These args must be passed to the individual selection methods.
- Return
-
Ref to the popup menu
- Notes
-
- Values may be
-
global variables
Widget refs
Cursor shapes
Text index
Listbox index
Font definitions
-
- Set up Menu: $text->toplevel may also be used instead of $mw
Execute the popup menu to select values.
- Arguments
-
- self
- ref to main window
- ref to text widget receiving the selected value.
- Return
-
Always undef.
- Notes
-
- Popup has replaced Menubutton which didn't work properly.
Set up the non-modal dialog to assist entering of TK code.
- Arguments
-
parent widget
- Return
-
None
The following methods do the detail processing:
- _copyCode
- _synchHelp
- _ok
- _cancel
- _insertOrReplace
- _insertOrReplaceValue
The following methods generate specialized strings, like
widget's variables, option's values or even option's lists.
- _selectGlobalVariables
- _selectLocalVariables
- _selectWidget
- _selectCursorfont
- _selectTextIndex
- _genFontCode
Arguments
- self,
- parent widget,
- target text widget, which will receive the generated value.
Return
None.
Exception
None.
Note
- mandatory: the dialog must be modal and it must return
the generated value as a string or undef.
- mandatory: call _insertOrReplace to place the selected
value into the given target text-widget.
- install a new method:
- code a new method which do the job
- add an item to the hash $callbacks
<menu name> => \&method
Compile the given array of lines and return a ref to HASH.
Arguments
ref to array of lines (of perl code)
Return
ref to HASH
Exception
compile error $@ (message to log)
Note
will always return a ref to hash
Load the funcList definition into memory, compile it and
return a ref to HASH.
Argument
- name of the version/release i.e. '3.095'
Returns
- file definition structure as ref to HASH