~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Open Mash Cross Reference
mash/tcl/vd/vd/application-vd.tcl

Component: ~ [ mash ] ~ [ apps ] ~ [ gsm ] ~ [ lib ] ~ [ otcl ] ~ [ srm ] ~ [ tcl8.3 ] ~ [ tclcl ] ~ [ tk8.3 ] ~ [ tutorials ] ~

  1 # application-vd.tcl --
  2 #
  3 #       Creates a VirtualDirector object and gives it a frame to display in
  4 #
  5 # Copyright (c) 2000-2002 The Regents of the University of California.
  6 # All rights reserved.
  7 #
  8 # Redistribution and use in source and binary forms, with or without
  9 # modification, are permitted provided that the following conditions are met:
 10 #
 11 # A. Redistributions of source code must retain the above copyright notice,
 12 #    this list of conditions and the following disclaimer.
 13 # B. Redistributions in binary form must reproduce the above copyright notice,
 14 #    this list of conditions and the following disclaimer in the documentation
 15 #    and/or other materials provided with the distribution.
 16 # C. Neither the names of the copyright holders nor the names of its
 17 #    contributors may be used to endorse or promote products derived from this
 18 #    software without specific prior written permission.
 19 #
 20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
 21 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 23 # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
 24 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 25 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 26 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 27 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 28 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 30 
 31 Import enable
 32 
 33 import Application VirtualDirector
 34 
 35 Class VirtualDirectorApplication -superclass Application
 36 
 37 VirtualDirectorApplication instproc showUsage {} {
 38    puts stdout "usage:  vd \[-af <auto switch config file>\]"
 39 }
 40 
 41 VirtualDirectorApplication instproc init {argv} {
 42     $self instvar vd_
 43     $self next "vd"
 44 
 45     $self initArgs
 46     set options [$self options]
 47     # parse command line args
 48     $options parse_args $argv
 49 
 50     $self initUI
 51 
 52     set spec [list]
 53     # Broadcast Description Info
 54     # description file
 55     lappend spec [$options get_option descriptionFile]
 56     # DC host/port
 57     lappend spec [$options get_option dcHost] [$options get_option dcPort]
 58     # recorder host/port
 59     lappend spec [$options get_option recorderHost] [$options get_option recorderPort]
 60     lappend spec $self
 61     # question monitor host/port
 62     lappend spec [$options get_option questionMonitorHost]
 63     lappend spec [$options get_option questionMonitorPort]
 64     # add other spec stuff here
 65 
 66     set vd_ [new VirtualDirector .vdFrame $spec]
 67 }
 68 
 69 VirtualDirectorApplication instproc initUI {} {
 70     wm title . "Virtual Director"
 71     wm minsize . 200 100
 72 
 73     # make VD frame
 74     frame .vdFrame
 75     pack .vdFrame -side top
 76 
 77     # make exit button
 78     button .exit -text "Exit" -command "$self exitApp"
 79     pack .exit -side bottom
 80 }
 81 
 82 VirtualDirectorApplication instproc initArgs {} {
 83     set options [$self options]
 84 
 85     # register valid options
 86     $options register_option -df descriptionFile
 87     $options register_option -dh dcHost
 88     $options register_option -dp dcPort
 89     $options register_option -rh recorderHost
 90     $options register_option -rp recorderPort
 91     $options register_option -qh questionMonitorHost
 92     $options register_option -qp questionMonitorPort
 93 
 94     # set up defaults
 95     $options add_default descriptionFile "migs.desc.tcl"
 96     $options add_default dcHost "garfield.cs.berkeley.edu"
 97     $options add_default dcPort "6907"
 98     $options add_default recorderHost "garfield.cs.berkeley.edu"
 99     $options add_default recorderPort "6909"
100     $options add_default questionMonitorHost "garfield.cs.berkeley.edu"
101     $options add_default questionMonitorPort "6903"
102 }
103 
104 VirtualDirectorApplication instproc exitApp {} {
105     $self instvar vd_
106 
107     $vd_ onExit
108 
109     exit
110 }
111 
112 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.