core-extra/wiki/TclTkOverview.wiki
2012-01-24 23:44:39 +00:00

32 lines
No EOL
1.6 KiB
Text

#summary brief guide to the Tcl/Tk GUI code
= GUI =
The CORE GUI uses Tcl/Tk 8.5. This page has a brief guide to the source files. The GUI can be found in the source tarball under the `core/gui/` directory.
= Tcl/Tk files =
*`core`*: this is a shell script that launches the GUI. First it sets some environment variables relating to the CORE directories and then launches `wish8.5 core.tcl`.
*`core.tcl`*: main entry point for Tcl/Tk code. This file uses `source` to include all of the other tcl source files. Some important global variables are set here. Preferences and config files are loaded (some procs from filemgmt.tcl). The file `initgui.tcl` is sourced, and initializes more global variables, builds the menus, and sets up the main canvas window. Control is passed to `proc setOperMode` from `exec.tcl` to build the GUI toolbar and menus.
*`initgui.tcl`*: see `core.tcl` above; this initializes the main GUI window.
*`editor.tcl`*: this is the largest Tcl source file. It has procs for building various configuration dialogs for editing typologies.
*`api.tcl`*: the Tcl/Tk implementation of the CORE API, for communicating with the Python CORE daemon back-end.
*`cfgparse.tcl`*: imn file loading and saving.
*`nodecfg.tcl`*: procs for manipulating the Tcl representation of node and link objects.
= Debugger =
Choose _Debugger..._ from the _Tools_ menu for a text entry for executing arbitrary Tcl code. This is a great tool for testing changes you may be making to certain procedures.
Here are some code snippets you might try in the debugger (cut and paste one at a time):
{{{
puts $node_list
puts $link_list
getNodeCoords n3
hideNode n4
setGuiTitle "hello world"
}}}