This file is indexed.

/usr/share/mozart/doc/wp/node20.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>5.1 Buttons and Actions</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="node19.html">- Up -</A></TD><TD><A href="node21.html#section.widgets-2.otherbuttons">Next &gt;&gt;</A></TD></TR></TABLE><DIV id="section.widgets-2.button"><H2><A name="section.widgets-2.button">5.1 Buttons and Actions</A></H2><P> </P><DIV class="apropos"><P class="margin">actions</P><P> <A name="label204"></A><EM>Button</EM> widgets are similar to label widgets: they display text, bitmaps, or images. Additionally, they provide for <A name="label205"></A><EM>actions</EM>: pressing the mouse button over the button widget, invokes an action. An action is either a procedure or a pair of object and message. If the action is a procedure, pressing the widget button creates a thread in which the procedure is applied. Otherwise, a thread is created that applies the object to the message provided. Actions are discussed in more detail in <A href="node25.html#section.widgets-2.action">Section&nbsp;5.6</A>. </P></DIV><P> <A href="node20.html#figure.widgets-2.buttons">Figure&nbsp;5.1</A> shows a program which creates two buttons and attaches actions to them. Pressing button <CODE>B1</CODE> browses the atom <CODE>pressed</CODE>, whereas pressing button <CODE>B2</CODE> closes the toplevel widget object&nbsp;<CODE>T</CODE>. </P><P> </P><DIV id="figure.widgets-2.buttons"><HR><P><A name="figure.widgets-2.buttons"></A></P><P> </P><DIV align="center"><IMG alt="" src="button.gif"></DIV><P> <A name="label207"></A> </P><DL class="anonymous"><DD class="code"><CODE>B1={New&nbsp;Tk<SPAN class="keyword">.</SPAN>button&nbsp;tkInit(parent:&nbsp;W&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text:&nbsp;&nbsp;&nbsp;<SPAN class="string">'Press&nbsp;me!'</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action:&nbsp;<SPAN class="keyword">proc</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">$</SPAN>}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{Browse&nbsp;pressed}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>)}<BR>B2={New&nbsp;Tk<SPAN class="keyword">.</SPAN>button&nbsp;tkInit(parent:&nbsp;W&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bitmap:&nbsp;error<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action:&nbsp;W<SPAN class="keyword">#</SPAN>tkClose)}<BR>{Tk<SPAN class="keyword">.</SPAN>send&nbsp;pack(B1&nbsp;B2&nbsp;fill:x&nbsp;padx:1<SPAN class="keyword">#</SPAN>m&nbsp;pady:1<SPAN class="keyword">#</SPAN>m)}</CODE></DD></DL><P> </P><P class="caption"><STRONG>Figure&nbsp;5.1:</STRONG> Buttons with attached actions.</P><HR></DIV><P> </P><DIV class="apropos"><P class="margin">action values</P><P> The <CODE>action</CODE> option is different from other options in that it has not a generic translation as explained in <A href="node8.html#section.widgets-1.tickles">Section&nbsp;3.2</A>. Valid values for this option are not tickles, but as already mentioned, procedures or object message pairs. </P></DIV><P> Internally, an object providing for the <CODE>action</CODE> option, creates a Tcl script which when executed invokes the Oz procedure or object. This script is used then as value for the configuration option <CODE>command</CODE>. All widgets which provide for the <CODE>command</CODE> option in Tk, provide for the <CODE>action</CODE> option in Oz. </P><DIV class="apropos"><P class="margin">changing actions</P><P> Actions can be deleted or changed by the method <CODE>tkAction</CODE>. For example, deleting the action for button <CODE>B1</CODE> and changing the action for <CODE>B2</CODE> can be done by executing: </P><DL class="anonymous"><DD class="code"><CODE>{B1&nbsp;tkAction}<BR>{B2&nbsp;tkAction(action:&nbsp;B1&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;tkClose)}</CODE></DD></DL><P> </P></DIV><P> More information on buttons can be found in <A href="../tcltk/TkCmd/button.htm"><KBD>button</KBD></A>. </P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node19.html">- Up -</A></TD><TD><A href="node21.html#section.widgets-2.otherbuttons">Next &gt;&gt;</A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~schulte/">Christian&nbsp;Schulte</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>