This file is indexed.

/usr/share/mozart/doc/system/node95.html is in mozart-doc 1.4.0-8ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

1
2
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>29 Graphical Tools: TkTools</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node81.html#chapter.tk">&lt;&lt; Prev</A></TD><TD><A href="index.html">- Up -</A></TD><TD><A href="node96.html#chapter.objectsupport">Next &gt;&gt;</A></TD></TR></TABLE><DIV id="chapter.tktools"><H1><A name="chapter.tktools">29 Graphical Tools: <CODE>TkTools</CODE></A></H1><P> </P><DIV id="section.tktools.error"><H2><A name="section.tktools.error">29.1 Error</A></H2><A name="label1650"></A><P> The <CODE>TkTools<SPAN class="keyword">.</SPAN>error</CODE> class extends <CODE>TkTools<SPAN class="keyword">.</SPAN>dialog</CODE>. </P><DL><DT><CODE>tkInit</CODE> <A name="label1652"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>&nbsp;&nbsp;<BR>tkInit(title:&nbsp;&nbsp;</CODE><CODE>+<I>TitleTcl</I></CODE><CODE>&nbsp;&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;<SPAN class="string">'Error'</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;master:&nbsp;</CODE><CODE>+<I>MasterTcl</I></CODE><CODE>&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;NoArg<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;aspect:&nbsp;</CODE><CODE>+<I>AspectI</I></CODE><CODE>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;250<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text:&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>TextTcl</I></CODE><CODE>)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Initialise the widget object and create a new error dialog. </P><P> <CODE>+<I>AspectI</I></CODE> specifies a non-negative integer value indicating desired aspect ratio for the text. The aspect ratio is specified as 100*width/height. 100 means the text should be as wide as it is tall, 200 means the text should be twice as wide as it is tall, 50 means the text should be twice as tall as it is wide, and so on. </P></DD></DL><P> </P></DIV><DIV id="section.tktools.dialog"><H2><A name="section.tktools.dialog">29.2 Dialog</A></H2><A name="label1654"></A><P> The <CODE>TkTools<SPAN class="keyword">.</SPAN>dialog</CODE> class extends <CODE>Tk<SPAN class="keyword">.</SPAN>frame</CODE>. </P><DL><DT><CODE>tkInit</CODE> <A name="label1656"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>tkInit(title:&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>TitleTcl</I></CODE><CODE>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;master:&nbsp;&nbsp;</CODE><CODE>+<I>WidgetO</I></CODE><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;NoArg<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root:&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>Root</I></CODE><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;master<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buttons:&nbsp;</CODE><CODE>+<I>ButtonsL</I></CODE><CODE>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pack:&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>PackB</I></CODE><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;<SPAN class="keyword">true</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;focus:&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>FocusI</I></CODE><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bg:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>BackgroundA</I></CODE><CODE>&nbsp;&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;NoArg<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default:&nbsp;</CODE><CODE>+<I>DefaultI</I></CODE><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delete:&nbsp;&nbsp;</CODE><CODE>+<I>DeleteAction</I></CODE><CODE>&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;NoArg)</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Initialise the widget object and create a new dialog. This widget needs at least two informations: the title and a list of buttons. Each element of the button list is of the form: <CODE>LabelTcl&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;nullary&nbsp;procedure</CODE>. Two examples are: </P><UL><LI><P><CODE><SPAN class="string">'close'</SPAN>&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;tkClose</CODE> </P></LI><LI><P><CODE><SPAN class="string">'nothing'</SPAN><SPAN class="keyword">#</SPAN>&nbsp;<SPAN class="keyword">proc</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">$</SPAN>}&nbsp;<SPAN class="keyword">skip</SPAN>&nbsp;<SPAN class="keyword">end</SPAN></CODE> </P></LI></UL><P> A master widget is specified by <CODE>+<I>WidgetO</I></CODE>. Depending on <CODE>+<I>Root</I></CODE> the widget will be placed in relation to the master like following: </P><DL><DT><CODE>master</CODE> </DT><DD><P>The dialog will be placed in the upper left corner within the master widget. </P></DD><DT><CODE>master<SPAN class="keyword">#</SPAN>XOff<SPAN class="keyword">#</SPAN>YOff</CODE> </DT><DD><P>The dialog will be placed in the upper left corner of the master widget plus the xoffset and yoffset. </P></DD><DT><CODE>pointer</CODE> </DT><DD><P>The dialog will be placed on the current pointer position. </P></DD><DT><CODE>X<SPAN class="keyword">#</SPAN>Y</CODE> </DT><DD><P>User defined position. </P></DD></DL><P> If you want to use a focus then you describe by <CODE>+<I>FocusI</I></CODE> the button that gets the focus. By <CODE>+<I>DefaultI</I></CODE> you set the default button. </P></DD><DT><CODE>tkPack</CODE> <A name="label1658"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>&nbsp;tkPack</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Pack the dialog. </P></DD><DT><CODE>tkClose</CODE> <A name="label1660"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>&nbsp;tkClose</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Close the dialog. </P></DD></DL><P> </P></DIV><DIV id="section.tktools.menubar"><H2><A name="section.tktools.menubar">29.3 Menubar</A></H2><A name="label1662"></A><P> </P><BLOCKQUOTE class="code"><CODE>{TkTools<SPAN class="keyword">.</SPAN>menubar&nbsp;</CODE><CODE>+<I>PWidgetO</I></CODE><CODE>&nbsp;</CODE><CODE>+<I>KBWidgetO</I></CODE><CODE>&nbsp;&nbsp;</CODE><CODE>+<I>L</I></CODE><CODE>&nbsp;</CODE><CODE>+<I>R</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>Widget0</I></CODE><CODE>}</CODE></BLOCKQUOTE><P> </P><P> The <CODE>TkTools<SPAN class="keyword">.</SPAN>menubar</CODE> function creates a menubar widget. The parent is described by <CODE>+<I>PWidgetO</I></CODE>, while the KeyBinder is specified by <CODE>+<I>KBWidgetO</I></CODE>. Usually both the parent and the key binder are the toplevel window. If you press a key combination, that is an abbreviation for a menu entry, within the key binder area the associated action will be done. </P><P> Menu entries are specified by the lists <CODE>+<I>L</I></CODE> and <CODE>+<I>R</I></CODE>, one for the left and one for the right menu part. Each element of both lists is a record with the label <CODE>menubutton</CODE>. The record has four features: <CODE>text</CODE>, <CODE>underline</CODE>, <CODE>menu</CODE> and <CODE>feature</CODE>. </P><BLOCKQUOTE class="code"><CODE>menubutton(text:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>TextTcl</I></CODE><CODE>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;underline:&nbsp;</CODE><CODE>+<I>ULI</I></CODE><CODE>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;menu:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>MenuL</I></CODE><CODE>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;feature:&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>Atom</I></CODE><CODE>)</CODE></BLOCKQUOTE><P> The field under the feature <CODE>menu</CODE> describes the view of the menu. It is a list of menu entries. Each entry may be: <CODE>command</CODE>, <CODE>separator</CODE>, <CODE>ckeckbutton</CODE>, <CODE>radiobutton</CODE> or cascade. </P><P> The <CODE>separator</CODE> is just an Atom. While <CODE>checkbutton</CODE> and <CODE>radiobutton</CODE> are usual Tk widgets, the <CODE>command</CODE> button is a new element and has the following form: </P><BLOCKQUOTE class="code"><CODE>&nbsp;&nbsp;<BR>command(label:&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>TextTcl</I></CODE><CODE>&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action:&nbsp;&nbsp;</CODE><CODE>+<I>Action</I></CODE><CODE>&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;key:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>KeyTcl</I></CODE><CODE>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;feature:&nbsp;</CODE><CODE>+<I>Atom</I></CODE><CODE>)&nbsp;</CODE></BLOCKQUOTE><P> The value for the key describes the keyboard accelerator and event binding to be created. They can be used as follows: </P><TABLE align="center" bgcolor="#f0f0e0"><TR valign="top"><TH><P><CODE>key</CODE> option value</P></TH><TH><P>accelerator</P></TH><TH><P>event binding</P></TH></TR><TR valign="top"><TD><P><CODE>a</CODE></P></TD><TD><P><SPAN class="key">a</SPAN></P></TD><TD><P><CODE>a</CODE></P></TD></TR><TR valign="top"><TD><P><CODE>ctrl(a)</CODE></P></TD><TD><P><SPAN class="key">C-a</SPAN></P></TD><TD><P><CODE>&lt;Control-a&gt;</CODE></P></TD></TR><TR valign="top"><TD><P><CODE>alt(a)</CODE></P></TD><TD><P><SPAN class="key">A-a</SPAN></P></TD><TD><P><CODE>&lt;Alt-a&gt;</CODE></P></TD></TR><TR valign="top"><TD><P><CODE>alt(ctrl(a))</CODE></P></TD><TD><P><SPAN class="key">A-C-a</SPAN></P></TD><TD><P><CODE>&lt;Alt-Control-a&gt;</CODE></P></TD></TR><TR valign="top"><TD><P><CODE>ctrl(alt(a))</CODE></P></TD><TD><P><SPAN class="key">C-A-a</SPAN></P></TD><TD><P><CODE>&lt;Control-Alt-a&gt;</CODE></P></TD></TR></TABLE><P> </P><P> If you like to place a submenu you have to describe a <CODE>cascade</CODE> element, which consists only of the two features <CODE>label</CODE> and <CODE>menu</CODE>. </P><BLOCKQUOTE class="code"><CODE>cascade(label:&nbsp;</CODE><CODE>+<I>TextTcl</I></CODE><CODE>&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;menu:&nbsp;&nbsp;</CODE><CODE>+<I>MenuL</I></CODE><CODE>)</CODE></BLOCKQUOTE><P> </P></DIV><DIV id="section.tktools.popupmenu"><H2><A name="section.tktools.popupmenu">29.4 Popup Menu</A></H2><A name="label1664"></A><P> The <CODE>TkTools<SPAN class="keyword">.</SPAN>popupmenu</CODE> class extends <CODE>Tk<SPAN class="keyword">.</SPAN>menubutton</CODE>. </P><DL><DT><CODE>tkInit</CODE> <A name="label1666"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><SPAN class="keyword">meth</SPAN>&nbsp;<SPAN class="functionname">tkInit</SPAN>(parent:&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>WidgetO</I></CODE><CODE>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;entries:&nbsp;&nbsp;</CODE><CODE>+<I>EL</I></CODE><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;[empty]<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selected:&nbsp;</CODE><CODE>+<I>SelI</I></CODE><CODE>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>FontO</I></CODE><CODE>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;<SPAN class="keyword">unit</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action:&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>ActionP</I></CODE><CODE>&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;<SPAN class="keyword">proc</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">$</SPAN>&nbsp;S}&nbsp;<SPAN class="keyword">skip</SPAN>&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<SPAN class="keyword">...</SPAN>)&nbsp;&nbsp;&nbsp;</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Initialise the widget object and create a new popup menu. You always need to declare the parent of the widget. The field under the feature <CODE>entries</CODE> is a list of popup menu entries. Each entry is of the form: <CODE>LabelAtom<SPAN class="keyword">#</SPAN>ColorAtom</CODE>. Although it is possible to declare an entry as <CODE>[push<SPAN class="keyword">#</SPAN>black&nbsp;push<SPAN class="keyword">#</SPAN>green]</CODE>, you should not do this. </P><P> By <CODE>+<I>SelI</I></CODE> you declare the initial entry. If action should be performed you have to declare a unary procedure. </P></DD><DT><CODE>getCurrent</CODE> <A name="label1668"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>getCurrent(</CODE><CODE>?<I>Atom</I></CODE><CODE>)</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Return the current active entry label. </P></DD><DT><CODE>add</CODE> <A name="label1670"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>add(</CODE><CODE>+<I>E</I></CODE><CODE>)</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Add a new entry. The entry must have the form: <CODE>ColorAtom<SPAN class="keyword">#</SPAN>LabelAtom</CODE>. </P></DD><DT><CODE>rem</CODE> <A name="label1672"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>rem(</CODE><CODE>+<I>LabelA</I></CODE><CODE>)</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Remove (all) entries with the label <CODE>+<I>LabelA</I></CODE>. </P></DD></DL><P> </P></DIV><DIV id="section.tktools.textframe"><H2><A name="section.tktools.textframe">29.5 Textframe</A></H2><A name="label1674"></A><P> The <CODE>TkTools<SPAN class="keyword">.</SPAN>textframe</CODE> class extends <CODE>Tk<SPAN class="keyword">.</SPAN>frame</CODE> and has only one method. </P><DL><DT><CODE>tkInit</CODE> <A name="label1676"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>tkInit(parent:&nbsp;&nbsp;</CODE><CODE>+<I>WidgetO</I></CODE><CODE>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="string">'class'</SPAN>:&nbsp;</CODE><CODE>+<I>ClassTcl</I></CODE><CODE>&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;<SPAN class="keyword">unit</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text:&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>TextTcl</I></CODE><CODE>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font:&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>FontO</I></CODE><CODE>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;DefaultFont)</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Initialise the widget object and create a new textframe. </P></DD></DL><P> </P></DIV><DIV id="section.tktools.notebook"><H2><A name="section.tktools.notebook">29.6 Notebook</A></H2><A name="label1678"></A><P> The <CODE>TkTools<SPAN class="keyword">.</SPAN>notebook</CODE> class extends <CODE>Tk<SPAN class="keyword">.</SPAN>canvas</CODE>. </P><DL><DT><CODE>tkInit</CODE> <A name="label1680"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>tkInit(parent:&nbsp;&nbsp;</CODE><CODE>+<I>WidgetO</I></CODE><CODE>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font:&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>FontO</I></CODE><CODE>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;DefaultFont)</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Initialise the widget object and create a new notebook. </P></DD><DT><CODE>add</CODE> <A name="label1682"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>add(</CODE><CODE>+<I>NoteO</I></CODE><CODE>)</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Add a new note. </P></DD><DT><CODE>remove</CODE> <A name="label1684"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>remove(</CODE><CODE>+<I>NoteO</I></CODE><CODE>)</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Remove a note. </P></DD><DT><CODE>toTop</CODE> <A name="label1686"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>toTop(</CODE><CODE>+<I>NoteO</I></CODE><CODE>)</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Bring note <CODE>+<I>NoteO</I></CODE> to the top. </P></DD><DT><CODE>getTop</CODE> <A name="label1688"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>getTop(</CODE><CODE>?<I>NoteO</I></CODE><CODE>)</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Return the top note. </P></DD></DL><P> </P></DIV><DIV id="section.tktools.note"><H2><A name="section.tktools.note">29.7 Note</A></H2><A name="label1690"></A><P> The <CODE>TkTools<SPAN class="keyword">.</SPAN>note</CODE> class extends <CODE>Tk<SPAN class="keyword">.</SPAN>frame</CODE>. </P><DL><DT><CODE>tkInit</CODE> <A name="label1692"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>tkInit(parent:&nbsp;&nbsp;</CODE><CODE>+<I>WidgetO</I></CODE><CODE>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text:&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>TextTcl</I></CODE><CODE>)</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Initialise the widget object and create a new note. The note packs itself, thus you should avoid sending packaging commands, otherwise the system hangs. </P></DD><DT><CODE>toTop</CODE> <A name="label1694"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>toTop()</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>This is an empty method. If yo want any action to be performed you have to derive the <CODE>TkTools<SPAN class="keyword">.</SPAN>note</CODE> class and to overwrite the <CODE>toTop</CODE> method. </P></DD></DL><P> </P></DIV><DIV id="section.tktools.scale"><H2><A name="section.tktools.scale">29.8 Scale</A></H2><A name="label1696"></A><P> The <CODE>TkTools<SPAN class="keyword">.</SPAN>scale</CODE> class extends <CODE>Tk<SPAN class="keyword">.</SPAN>frame</CODE>. </P><DL><DT><CODE>init</CODE> <A name="label1698"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>init(parent:&nbsp;&nbsp;</CODE><CODE>+<I>WidgetO</I></CODE><CODE>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width:&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>WidthI</I></CODE><CODE>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;values:&nbsp;&nbsp;</CODE><CODE>+<I>ValuesL</I></CODE><CODE>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;initpos:&nbsp;</CODE><CODE>+<I>PosI</I></CODE><CODE>)</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Initialise the widget object and create a new scale.The field <CODE>+<I>ValuesL</I></CODE> describes all possible values, whereby the initial value is described by position <CODE>+<I>PosI</I></CODE>. </P></DD><DT><CODE>drawTicks</CODE> <A name="label1700"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>drawTicks()</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Draw. </P></DD><DT><CODE>get</CODE> <A name="label1702"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>get(</CODE><CODE>?<I>ValueI</I></CODE><CODE>)</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Get the current value. </P></DD></DL><P> </P></DIV><DIV id="section.tktools.numberentry"><H2><A name="section.tktools.numberentry">29.9 Number Entry</A></H2><A name="label1704"></A><P> The <CODE>TkTools<SPAN class="keyword">.</SPAN>numberentry</CODE> class extends <CODE>Tk<SPAN class="keyword">.</SPAN>frame</CODE>. </P><DL><DT><CODE>tkInit</CODE> <A name="label1706"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>tkInit(parent:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>WidgetO</I></CODE><CODE>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;min:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>MinI</I></CODE><CODE>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;<SPAN class="keyword">unit</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;max:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>MaxI</I></CODE><CODE>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;<SPAN class="keyword">unit</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;val:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>ValI</I></CODE><CODE>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;MinI<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>FontO</I></CODE><CODE>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;DefaultFont<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>WidthI</I></CODE><CODE>&nbsp;&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;6<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>+<I>ActionP</I></CODE><CODE>&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;DummyAction<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;returnaction:&nbsp;</CODE><CODE>+<I>RetActP</I></CODE><CODE>&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;<SPAN class="keyword">unit</SPAN>)</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Initialise the widget object and create a new number entry. The number entry contains all values within <CODE>+<I>MinI</I></CODE> and <CODE>+<I>MaxI</I></CODE>, and shows initially the value <CODE>+<I>ValI</I></CODE>. Allthough it is possible to set <CODE>+<I>ValI</I></CODE> less than <CODE>+<I>MinI</I></CODE> you should not do it. </P><P> By <CODE>+<I>ActionP</I></CODE> you define an unary procedure that is each time invoked, when alter the value of the number entry. Furthermore you may set a return procedure, that is invoked when you press <CODE>Return</CODE>. </P></DD><DT><CODE>tkAction</CODE> <A name="label1708"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>tkAction(</CODE><CODE>+<I>ActionP</I></CODE><CODE>&nbsp;<SPAN class="keyword">&lt;=</SPAN>&nbsp;<SPAN class="keyword">unit</SPAN>)</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Set a new action procedure. </P></DD><DT><CODE>tkSet</CODE> <A name="label1710"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>tkSet(</CODE><CODE>+<I>ValI</I></CODE><CODE>)</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Set a new value. </P></DD><DT><CODE>tkGet</CODE> <A name="label1712"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>tkGet(</CODE><CODE>?<I>ValI</I></CODE><CODE>)</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Get value. </P></DD><DT><CODE>enter</CODE> <A name="label1714"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>enter(</CODE><CODE>+<I>B</I></CODE><CODE>)</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Hm. I see no difference. </P></DD></DL><P> </P></DIV><DIV id="section.tktools.images"><H2><A name="section.tktools.images">29.10 Images</A></H2><A name="label1716"></A><P> The function </P><BLOCKQUOTE class="code"><CODE>{TkTools<SPAN class="keyword">.</SPAN>images&nbsp;</CODE><CODE>+<I>L</I></CODE><CODE>&nbsp;?</CODE><CODE>+<I>R</I></CODE><CODE>}</CODE></BLOCKQUOTE><P> takes a list of URLs as input and returns a record of images, where the fields are atoms derived naturally from the URLs. </P><P> First the basename of the URL is computed by taking the last fragment of the URL (that is, 'wp.gif' for example). The extension (the part following the period, 'gif' for example), determines the type and format of the image. The part of the basename that precedes the period yields the feature. </P></DIV><DIV id="section.tktools.resolveimages"><H2><A name="section.tktools.resolveimages">29.11 Resolve Images</A></H2><A name="label1718"></A><P> <CODE>TkTools<SPAN class="keyword">.</SPAN>resolveImages</CODE> is deprecated. Please use <CODE>TkTools<SPAN class="keyword">.</SPAN>images</CODE> instead. </P></DIV></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node81.html#chapter.tk">&lt;&lt; Prev</A></TD><TD><A href="index.html">- Up -</A></TD><TD><A href="node96.html#chapter.objectsupport">Next &gt;&gt;</A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~duchier/">Denys&nbsp;Duchier</A>, <A href="http://www.ps.uni-sb.de/~kornstae/">Leif&nbsp;Kornstaedt</A>, <A href="http://www.ps.uni-sb.de/~homik/">Martin&nbsp;Homik</A>, <A href="http://www.ps.uni-sb.de/~tmueller/">Tobias&nbsp;Müller</A>, <A href="http://www.ps.uni-sb.de/~schulte/">Christian&nbsp;Schulte</A> and&nbsp;<A href="http://www.info.ucl.ac.be/~pvr">Peter&nbsp;Van Roy</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>