/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 >></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 5.6</A>. </P></DIV><P> <A href="node20.html#figure.widgets-2.buttons">Figure 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 <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 Tk<SPAN class="keyword">.</SPAN>button tkInit(parent: W <BR> text: <SPAN class="string">'Press me!'</SPAN> <BR> action: <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">$</SPAN>}<BR> {Browse pressed}<BR> <SPAN class="keyword">end</SPAN>)}<BR>B2={New Tk<SPAN class="keyword">.</SPAN>button tkInit(parent: W <BR> bitmap: error<BR> action: W<SPAN class="keyword">#</SPAN>tkClose)}<BR>{Tk<SPAN class="keyword">.</SPAN>send pack(B1 B2 fill:x padx:1<SPAN class="keyword">#</SPAN>m pady:1<SPAN class="keyword">#</SPAN>m)}</CODE></DD></DL><P> </P><P class="caption"><STRONG>Figure 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 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 tkAction}<BR>{B2 tkAction(action: B1 <SPAN class="keyword">#</SPAN> 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 >></A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~schulte/">Christian Schulte</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>
|