hwt:: {args}
Hello
I'm just going through the 'TK Widget Tour' built in HyperMesh.
using hwt is a new stuff for me and I'm a bit confused. Please forgive me if my questions are booring or lame-type /emoticons/default_smile.png' alt=':)' srcset='/emoticons/smile@2x.png 2x' width='20' height='20'>
set auto_path ''
lappend auto_path {'C:/Altairwin64/hw10.0/hw/tcl'}
package require hwt
hwt::CreateWindow mytoplevel \
-windowtitle 'Dialog Title' \
-noGeometrySaving \
-cancelButton Cancel \
-acceptButton OK \
-acceptFunc applyFXN \
-defaultButton Accept \
-minsize 470 300 \
-post;
proc applyFXN {args} {
tk_messageBox -message 'The CreateWindow function passes the\
toplevel window to the procedure listed \
so you must have args in the procedure.\
Args is $args';
destroy $args;
}
$args value is .mytoplevel. Where exactly this value is being assigned to variable $args?
other thing which is not very clear for me is recess
set recess [hwt::WindowRecess mytoplevel];
why do I need create recess? Why I can not refer directly to .mytoplevel as I used to in all macros I have done so far?
Many thanks for any help
Kind Regards
Souaveck
Answers
-
1. Actually args value is assigned inside the hwt::CreateWindow command. (written in \hw\tcl\hwt\window.tbc) but not human readable.
Why: Sometimes it is needed to know about toplevel path of button. This sometimes is defined by scope n requirement of script.
2. Followings are some motives.
i) Many times toplevel path is very long (abcp1.abcp2.abcp3.abcp4.abcp5.abcc6) so better to have one variable to manage and use.
ii) Later modification in script will be easy.
thats all.
0