bwidgetapplicationframework.tcl

来自「是TCL的另外一个编译(解释)器」· TCL 代码 · 共 47 行

TCL
47
字号
#!/bin/sh
# The next line is executed by /bin/sh, but not by tcl \
exec wish "$0" ${1+"$@"}

################################################################################
# This is a standard template for executable Tk-applications using
# the BWidget package. Please copy the complete BWidget-directory
# from Ased磗 installation-directory to your applications directory or
# adopt this code to your needs.
################################################################################

package require Tk

global AppRootDir

set AppRootDir [file dirname [info script]]
if { [file type $argv0] == "link" } {
    set AppRootDir [file dirname [file readlink $argv0]]
} else {
    set AppRootDir [file dirname $argv0]
}

################################################################################
# If you don磘 use BWidget 1.4.0 please change the following lines appropriate
################################################################################

set path_to_BWidget [file join $AppRootDir BWidget-1.4.0]
lappend auto_path $path_to_BWidget

package require -exact BWidget 1.4.0
Bitmap::get cut
# this used for loading Bitmap namespace into the interpetator
namespace eval Bitmap {
lappend path [file join $AppRootDir images]
}

proc initApp {argc argv} {
    if {$argc >= 1} {
        foreach arg $argv {
            #enter code here if application was started with additional args
        }
    } else  {
        #enter code here if application was started without args
    }
}

initApp $argc $argv

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?