This seems complex at first, but the names don't matter much if you can change
them in the commands given next.
We must be sure the radiobuttons have the same variable formcapture with value 1 for
the labeled "external" and 0 for the other.
The toplevel (.formcontrol) will have a binding to initialize this variable:
bind .formcontrol <Activate> {set formcapture 0}Finally, the buttons will have the following commands:
button | command |
---|---|
.formcontrol.f2.saveform | store_form [.formcontrol.f3.name get] $formcapture |
.formcontrol.f2.exec | doForm [.formcontrol.f3.name get] |
.formcontrol.f2.quit | exit |
After drawing this form in vtcl, select TEST mode (a small label where it's written
EDIT otherwise). You must have the PostgreSQL server running with you as a user.
You must also have created the 2 tables discussed last week: frm_form and
frm_objects.
Then execute TkCon and source this text file to setup some
variables, load the postgres/tcl interface and open the database (loja).
set kstore(dir) /path/to/where/your/libraries/are set auto_path [linsert $auto_path 0 $kstore(dir)/lib] db_open loja load libpgtcl.so set conn [pg_connect loja] wm withdraw .
Then you're ready to save your newly created form. Execute:
store_form formcontrol 1The first arg is the form name, the second is "true" for the capturing of vtcl toplevel drawn. Answer the question for a query with OK. We are not going to do any query with this form.
doForm formcontrolto invoke your control panel. Congratulations!
The library directory must have the previously given inputbox.tcl and form.tcl files (the 2 last weeks).