OK!
Here is an example of how to call one TCL/TK Application From another along with
some other tricks of the trade.

Example.
#--------------------------------------------------------------------------
# Menu.tcl
#--------------------------------------------------------------------------

set TCLHOME ""
catch {set TCLHOME $env(TCLHOME)}
if {$TCLHOME == ""} {
   puts ""
   puts "Menu: ERROR - TCLHOME Is not Set!"
   puts ""
   exit 0
   }

#----------------------------------------
# Set Globals, Environment Variables, and Defaults
#----------------------------------------
source $TCLHOME/Defaults.tcl
source $TCLHOME/balloon_msg.tcl

wm minsize . 80 5
wm title . $TCLTITLE
wm geometry . +621+171
wm iconname . PcDevTool

frame .menubar -relief raised -borderwidth 2 -height 20 -width 60

frame .menu -bg grey
pack  .menu -side top -fill x
.menu configure -width 40

global TIMESTAMP
button .menu.exit -bg $BB_BG -fg $BB_FG -font 6x13 -text "Development
Tools\nPress Here\n$TIMESTAMP" \
         -command {
                    pcdev_main_menu
                  }
pack  .menu.exit -side left  -fill x -ipady 1 -expand yes -padx 0

proc exit_program { } {
    exit
}

proc pcdev_main_menu { } {
    if {[winfo exists .popup]} { destroy .popup }
    menu .popup -font 7x14 -bg cadetblue -fg white -relief raised

    .popup add separator
    .popup add command -label "Quit Menu!" \
    -command {
               destroy .popup
             }

    .popup add separator
    .popup add command -label "Exit " \
    -command {
               destroy .popup
               exit_program
             }

    .popup add separator
    .popup add command -label "Usage Generator Tools" \
    -command {
               destroy .popup
               global TCLBIN TCLHOME env
               exec $TCLBIN/wishx -f $TCLHOME/GenMenu.tcl &
             }

    .popup add separator
    .popup add command -label "Report Tools" \
    -command {
               destroy .popup
               global TCLBIN TCLHOME env
               exec $TCLBIN/wishx -f $TCLHOME/ReportsMenu.tcl &
             }

    ### .popup add separator
    ### .popup add command -label "Test Case Tools" \
    ### -command {
    ###            destroy .popup
    ###            global TCLBIN TCLHOME env
    ###            exec $TCLBIN/wishx -f $TCLHOME/TestCaseMenu.tcl &
    ###          }

    .popup add separator
    .popup add command -label "DB Column Cross Reference Tool" \
    -command {
               destroy .popup
               global TCLBIN TCLHOME env
               exec $TCLBIN/wishx -f $TCLHOME/ColumnCrossRef.tcl &
             }

    .popup add separator
    .popup add command -label "DB Table Cross Reference Tool" \
    -command {
               destroy .popup
               global TCLBIN TCLHOME env
               exec $TCLBIN/wishx -f $TCLHOME/TableColumns.tcl &
             }

    .popup add separator
    .popup add command -label "DB Describe Table Tool" \
    -command {
               destroy .popup
               global TCLBIN TCLHOME env
               exec $TCLBIN/wishx -f $TCLHOME/Describe_table.tcl &
             }

    .popup add separator
    .popup add command -label "DB Describe Index Tool" \
    -command {
               destroy .popup
               global TCLBIN TCLHOME env
               exec $TCLBIN/wishx -f $TCLHOME/Describe_index.tcl &
             }

    .popup add separator
    .popup add command -label "Toggle Balloon Help ON/OFF" \
    -command {
               destroy .popup
               toggle_bmsg
             }

    global LOGNAME
    if { $LOGNAME == "rmccord" } {
    .popup add separator
    .popup add command -label "Test Application xrsm.tcl" \
    -command {
               destroy .popup
               global TCLBIN TCLHOME env
               exec $TCLBIN/wishx -f $TCLHOME/xrsm.tcl &
             }
    .popup add separator
    .popup add command -label "Test Application hlp.tcl" \
    -command {
               destroy .popup
               global TCLBIN TCLHOME env
               exec $TCLBIN/wishx -f $TCLHOME/hlp.tcl &
             }
    }

    tk_popup .popup  600 300
}

 global BMSG BALLOON WGT BALLOON_MSG
 if { $BMSG == "ON" } {
 set BALLOON $WGT(BALLOON)
 tixBalloon $BALLOON
 $BALLOON configure -bg red
 option add *Balloon*background yellow startupFile
 $BALLOON bind $WGT(MENU_BUTTON).exit -balloonmsg $BALLOON_MSG(TOPEXIT)
 }

 proc toggle_bmsg {} {
 global BMSG BALLOON WGT BALLOON_MSG
 if { $BMSG == "ON" } {
     set BMSG "OFF"
 destroy $BALLOON
 } else {
     set BMSG "ON"
 set BALLOON $WGT(BALLOON)
 tixBalloon $BALLOON
 $BALLOON configure -bg red
 option add *Balloon*background yellow startupFile
 $BALLOON bind $WGT(MENU_BUTTON).exit -balloonmsg $BALLOON_MSG(TOPEXIT)
 }
 }





"J.R.Suckling" <[EMAIL PROTECTED]> on 03/21/2000 10:53:12 AM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:    (bcc: Ralph McCord/CIMG/CVG)
Subject:  Re: [vtcl] anything new since 1.2.0?




Rick Macdonald wrote:
> There are some features missing for me in vTcl that I don't think are
> easily added:

This first one might not be so hard.

> - multi source file development.

The biggest deal here is that all the code that is sourced into
vtcl becomes part of the vtcl project.   By that I mean when you
save your work everything, including all the sourced code, is saved.

There is a set of code that is not saved, that is the vtcl code it's
self.  from  what I can tell is that all the code that is prefixed with
'vTcl' is not saved.  One solution might be to turn this around and
define a prefix unique to each vtcl project ( or file ).  Now use that
prefix to mark procs in the vtcl project.  This set of prefixed procs
could be the only ones saved that way an external set of procs
could be used.

> - calling one vTcl project from another.

tcl was meant to be process glue from the start.
I think that should be done in software.
open a pipe or something.

Or am I missing something.

Is this different from  multi source file development?

> - multiple instances of a toplevel, including some sort of
>   dynamic widget alias scheme.

vtcl does not do dynamic widget creation.
What I do is let vtcl make a prototype.
than I include that in a proc and a loop.
(ie. I do my self)
---------------------------------------------------------------------------
To unsubscribe from the Visual Tcl mailing list, please send a message
to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
message body (where [EMAIL PROTECTED] is your e-mail address).






---------------------------------------------------------------------------
To unsubscribe from the Visual Tcl mailing list, please send a message
to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
message body (where [EMAIL PROTECTED] is your e-mail address).

Reply via email to