Charles.Forsyth20060303-partialeea662d19 years agoHistory
134 lines · 4.3 KB · Text
RawDownload
.TH INTRO 9.SH NAMEintro \- introduction to Inferno Tk.SH DESCRIPTIONThis section of the manual provides a reference for the InfernoTk implementation,which is accessed by Limbo programs via.IR tk (2),and from.IR sh (1)via.IR sh-tk (1)..PPThe following pages were derived by Vita Nuova from documentation that is.IPCopyright © 1990 The Regents of the University of California.brCopyright © 1994-1996 Sun Microsystems, Inc..brSee.IR copyright (9)for the full copyright notice..PPThe format of the pages has changed to follow the format of the rest ofthis manual, but more important, the content has been changed(typically in small ways) to reflect the variant of Tk implemented byInferno..SS Programming InterfaceThe interface to Inferno Tk is exclusively through the.IR tk (2)module; all the Tk commands described in this section ofthe manual are excecuted by passing them as strings to the.B cmdfunction in that module.The Inferno Tk implementation is based on the Tk 4.0 documentation,but there are many differences, probably the greatest of which is thatthere is no associated Tcl implementation, so almost everyInferno application using Tk will need to have some Limbo codeassociated with it (the.IR sh-tk (1)shell module can also fulful this rôle). See ``An Overview of Limbo/Tk''in Volume 2 for a tutorial-style introduction to the use of Inferno Tkwhich summarises the differences from Tk 4.0..SS Tk CommandsThe command string passed to.B tk->cmdmay contain one or more Tk commands, separated by semicolons.A semicolon is not a command separator when it is nested in braces.RB ( {} )or brackets.RB ( [] )or it is escaped by a backslash.RB ( \e ).Each command is divided into.IR words :sequences of characters separated by one or moreblanks and tabs..PPThere is also a `super quote' convention: at any point in the commandstring a single quote mark.RB ( ' )means that the entire rest of the string should be treated as one word..PPA word beginning with an opening brace.RB ( { )continues until the balancing closing brace.RB ( } )is reached. The outer brace characters are stripped. A backslashcan be used to escape a brace in this context. Backslashcharacters not used to escape braces are left unchanged..PPA word beginning with an opening bracket.RB ( [ )continues until the balancing closing bracket.RB ( ] )is reached. The enclosed string is then evaluated as if itwere a command string, and the resulting valueis used as the contents of the word..PPSingle commands are executed in order until they are all doneor an error is encountered. By convention, an error is signaled by areturn value starting with an exclamation mark.RB ( ! ).The return value from.B tk->cmdis the return value of the first error-producingcommand or else the return value of the final single command..PPTo execute a single command, the first word is examined. Itmust either begin with dot.RB ( . )in which case it must name an existing widget, which willinterpret the rest of the command according to its type,or one of the following words, each of which isdocumented in a manual page of that name in this section:.EX bind         focus        lower        scrollbarbutton       frame        menu         seecanvas       grab         menubutton   sendcheckbutton  grid         pack         textcursor       image        radiobutton  updatedestroy      label        raise        variableentry        listbox      scale.EE.SS Widget OptionsEach manual page in this section documents the optionsthat a particular command will accept. A number of optionsare common to several of the widgets and are named as``standard options'' near the beginning of the manual pagefor each widget. These options are documented in.IR options (9).The types of value required as arguments to options withinInferno Tk are documented under.IR types (9)..SH SEE ALSO.IR options (9),.IR types (9),.IR tk (2),.IR sh-tk (1),.IR tkcmd (1),.IR wmlib (2),.IR draw-intro (2),``An Overview of Limbo/Tk'' in Volume 2..SH BUGSThe bracket.RB ( [] )command interpretation is not applied consistently throughoutthe Inferno Tk commands (notably, the argument tothe.IR send (9)command will not interpret this correctly).Moreover, if the string to be substituted is significantly biggerthan the command it was substituting, then it will be truncated.