📄 tknl.tcl
字号:
#!S_WISHBINARY_S#=======================================================================# Newtonlink - transfer data between a Apple Newton Message Pad and# Unix applications## Copyright (C) 1996-1998 The Newtonlink Developers# (newtonlink@newton.bawue.de)## This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2 of the License, or# (at your option) any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.#=======================================================================# $Id: tknl.tcl,v 1.13 1998/09/06 10:44:31 reinhold Exp $# $Author: reinhold $# $Date: 1998/09/06 10:44:31 $# $Revision: 1.13 $# $Log: tknl.tcl,v $# Revision 1.13 1998/09/06 10:44:31 reinhold# Letzte Aenderungen an doc Files fuer Version 1.29## Revision 1.12 1998/09/02 13:58:05 kalli# *** empty log message ***## Revision 1.11 1998/03/27 20:43:57 kalli# Aufruf Online-Help jetzt per newtonlink -onlinehelp## Revision 1.10 1998/03/16 15:03:04 kalli# Last version for 1.27## Revision 1.9 1998/03/06 19:58:30 kalli# Option -lpkg dazu# Optik veraendert## Revision 1.8 1998/03/02 21:20:48 kalli# Aenderungen von Peter W : Button-Helpline# Option -kjots dazu## Revision 1.6 1997/12/17 12:26:54 kalli# Option webadr dazugefuegt## Revision 1.5 1997/12/17 09:36:00 kalli# Aenderungen wg. neuer Installationsroutine## Revision 1.4 1997/12/16 09:06:38 kalli# Icon dazugefuegt## Revision 1.3 1997/12/06 17:10:08 kalli# Umstellung auf Sloup## Revision 1.2 1997/11/18 18:48:30 kalli# Option xfadr dazu## Revision 0.56 1997/09/15 09:33:43 andrew# Fixed a bug in proc Runf# Unbuffered read from the pipe now works Hurray.# Now we have a simular output as in the commandline# version. Hurray Hurray## Revision 0.55 1997/09/06 15:16:36 andrew# Help now works# changed name of tknl.gif to about.gif in the "About Box"# Hopefully a candidate to release## Revision 0.54 1997/09/05 08:55:16 andrew# Fixed a typo, added a nonmodal fileselection box# this file selction Box uses the standard tk_fileOpenBox. This makes# it more portable amongst platforms (e.g. Windows arrghh)## Revision 0.53 1997/09/03 19:18:10 andrew# Bug fixes, mainly typos or mishaps## Revision 0.52 1997/09/02 21:20:12 andrew# changed the about box, now uses a gif# therefore it is not modal anymore (should be changed)## Revision 0.51 1997/09/02 12:22:28 andrew# enable and disable of buttons for options that take a file## Revision 0.5 1997/09/02 12:18:24 andrew# Many changes:# - added comments# - added stadard GPL header# - enable and disable menus and buttons when newtonlink is# runnung to prevent further user interaction# - set the cursur to watch when newtonlink is busy# - added many spelling mistakes in this log## Revision 0.1 1997/09/01 07:56:08 andrew# initial version## TK Newtonlink# A TK interface for Newtonlink# Code shamelessly stolen from Brent Welch# version 0.1global PREFIX, BROWSER, HELPDOCset PREFIX "S_NEWTONLINK_INSTALLDIR_S"set HELPDOC "$PREFIX/doc/newtonlink-doc-en.html" ################################################### ## Set the some variables concerning the gifs ## and commadline options of Newtonlink ## ###################################################wm iconbitmap . @$PREFIX/newtonlink.xbmset quit_img [image create photo\ -file $PREFIX/icons/exit.gif -format gif]set update -updateset update_img [image create photo \ -file $PREFIX/icons/update.gif -format gif]set fax -faxset fax_img [image create photo \ -file $PREFIX/icons/fax.gif -format gif]set pr -prset print_img [image create photo \ -file $PREFIX/icons/print.gif]set plan -planset plan_img [image create photo \ -file $PREFIX/icons/Plan.gif -format gif]set xrolo -xroloset xrolo_img [image create photo \ -file $PREFIX/icons/xrolodex.gif -format gif]set ksendfax -ksendfaxset ksendfax_img [image create photo \ -file $PREFIX/icons/ksendfax.gif -format gif]set adr -adrset adr_img [image create photo \ -file $PREFIX/icons/addressbook.gif -format gif]set nsmail -nsmailset nsmail_img [image create photo \ -file $PREFIX/icons/NetscapeMail.gif -format gif]set nsadr -nsadrset nsadr_img [image create photo \ -file $PREFIX/icons/NetscapeAddressbook.gif -format gif]set webadr -webadrset webadr_img [image create photo \ -file $PREFIX/icons/webaddress.gif -format gif]set xfadr -xfadrset xfadr_img [image create photo \ -file $PREFIX/icons/XfmailAddressbook.gif -format gif] set kjots -kjotsset kjots_img [image create photo \ -file $PREFIX/icons/kjots.gif -format gif] set mail -mailset mail_img [image create photo \ -file $PREFIX/icons/mail.gif -format gif] set inst -instset inst_img [image create photo \ -file $PREFIX/icons/install.gif -format gif]set lpkg -lpkgset lpkg_img [image create photo \ -file $PREFIX/icons/lpkg.gif -format gif] set onlinehelp -onlinehelpset help_img [image create photo \ -file $PREFIX/icons/help.gif -format gif] set getpnam -getpnamset getpnam_img [image create photo \ -file $PREFIX/icons/getpnam.gif -format gif]set getpkg -getpkgset send -sendset send_img [image create photo \ -file $PREFIX/icons/send.gif -format gif] ################################################### ## create the main window ## #################################################### Set title and allow window resizing.wm title . {Newtonlink}################################################### ## Crate the menubar ## ###################################################frame .menubar -relief raisedpack .menubar -fill x################################################### ## Create the "File" menu ## ###################################################menubutton .menubar.filem -text File -menu .menubar.filem.menu -underline 0 set m [menu .menubar.filem.menu]#$m add command -label Preferences -underline 0 -command SelectPreferences$m add command -label Preferences -underline 0 -command notImplementedBox$m add command -label Quit -underline 0 -command exit################################################### ## Create the "Update" menu ## ###################################################menubutton .menubar.update -text Update -menu .menubar.update.menu -underline 0set m [menu .menubar.update.menu]$m add command -label {Update all} -command {Run $update}################################################### ## Create the "Cards" menu ## ###################################################menubutton .menubar.cards -text Cards -menu .menubar.cards.menu -underline 0set mnl [menu .menubar.cards.menu]$mnl add command -label {Cards -> Addressbook} -command {Run $adr} -underline 0$mnl add command -label {Cards -> Netscape Addressbook} -command {Run $nsadr} -underline 0$mnl add command -label {Cards -> Xfmail Addressbook} -command {Run $xfadr} -underline 0$mnl add command -label {Cards -> WebAddress} -command {Run $webadr} -underline 0$mnl add command -label {Cards -> Ksendfax} -command {Run $ksendfax} -underline 0################################################### ## Create the "Notes" menu ## ###################################################menubutton .menubar.notes -text Notes -menu .menubar.notes.menu -underline 0set mnl [menu .menubar.notes.menu]$mnl add command -label {Notes -> Xrolodex} -command {Run $xrolo}$mnl add command -label {Notes -> Kjots} -command {Run $kjots}################################################### ## Create the "Dates" menu ## ###################################################menubutton .menubar.dates -text Dates -menu .menubar.dates.menu -underline 0set mnl [menu .menubar.dates.menu]$mnl add command -label {Dates -> Plan} -command {Run $plan}################################################### ## Create the "Outbox" menu ## ###################################################menubutton .menubar.outbox -text Outbox -menu .menubar.outbox.menu -underline 0set mnl [menu .menubar.outbox.menu]$mnl add command -label {Outbox -> Fax} -command {Run $fax}$mnl add command -label {Outbox -> Print} -command {Run $pr}################################################### ## Create the "Mail" menu ## ###################################################menubutton .menubar.mail -text Mail -menu .menubar.mail.menu -underline 0set mnl [menu .menubar.mail.menu]$mnl add command -label {Mail -> Netscape Mail} -command {Run $nsmail}$mnl add command -label {Mail -> Sendmail} -command {Run $mail}################################################### ## Create the "Install" menu ## ###################################################menubutton .menubar.install -text Install -menu .menubar.install.menu -underline 0set mnl [menu .menubar.install.menu]$mnl add command -label {Install Package...} -command {Runf $inst}$mnl add command -label {Install Package (using lpkg)...} -command {Runf $lpkg}################################################### ## Create the "Misc" menu ## ###################################################menubutton .menubar.misc -text Misc -menu .menubar.misc.menu -underline 1set mnl [menu .menubar.misc.menu]$mnl add command -label {Get Package Names} -command {Run $getpnam} -underline 12#$mnl add command -label {Get Package...} -command getpackage -underline 4$mnl add command -label {Get Package...} -command notImplementedBox -underline 4$mnl add command -label {Send file...} -command {Runf $send} -underline 0################################################### ## Create the "Help" menu ## ###################################################menubutton .menubar.helpm -text Help -menu .menubar.helpm.menu -underline 0set m [menu .menubar.helpm.menu]$m add command -label "Help..." -command {Run $onlinehelp} -underline 0$m add command -label "About..." -command aboutBox -underline 0pack .menubar.filem .menubar.update -side leftpack .menubar.filem .menubar.cards -side leftpack .menubar.filem .menubar.notes -side leftpack .menubar.filem .menubar.dates -side leftpack .menubar.filem .menubar.outbox -side leftpack .menubar.filem .menubar.mail -side leftpack .menubar.filem .menubar.install -side leftpack .menubar.filem .menubar.misc -side leftpack .menubar.helpm -side right################################################### ## Create the top frame for buttons and entry. # # ###################################################frame .top -borderwidth 1pack .top -side top -fill x################################################### ## Create the command buttons for the top row ## ###################################################button .top.nsadr -text "NsAddr" -image $nsadr_img \ -width 20 -height 20 -command {Run $nsadr}bind .top.nsadr <Motion> { .hintline.status configure -text "Get Newton card entrys for Netscape email addressbook"}bind .top.nsadr <Leave> { .hintline.status configure -text ""}button .top.webadr -text "WebAddr" -image $webadr_img \ -width 20 -height 20 -command {Run $webadr}bind .top.webadr <Motion> { .hintline.status configure -text "Get Newton cards for WebAddress files"}bind .top.webadr <Leave> { .hintline.status configure -text ""}button .top.update -text "Update" -image $update_img \ -width 20 -height 20 -command {Run $update}bind .top.update <Motion> { .hintline.status configure -text "Update all selected applications"}bind .top.update <Leave> { .hintline.status configure -text ""}button .top.nsmail -text "NsMail" -image $nsmail_img \ -width 20 -height 20 -command {Run $nsmail}bind .top.nsmail <Motion> { .hintline.status configure -text "Get Newton outbox entrys for Netscape email"}bind .top.nsmail <Leave> { .hintline.status configure -text ""} button .top.adr -text "Address" -image $adr_img \ -width 20 -height 20 -command {Run $adr}bind .top.adr <Motion> { .hintline.status configure -text "Get Newton cards for Addressbook file"}bind .top.adr <Leave> { .hintline.status configure -text ""}button .top.ksendfax -text "Ksendfax" -image $ksendfax_img \ -width 20 -height 20 -command {Run $ksendfax}bind .top.ksendfax <Motion> { .hintline.status configure -text "Get Newton cards for Ksendfax phonebook"}bind .top.ksendfax <Leave> { .hintline.status configure -text ""} button .top.xrolo -text "Xrolo" -image $xrolo_img \ -width 20 -height 20 -command {Run $xrolo}bind .top.xrolo <Motion> {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -