Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 51f7de0838007e2876221e819c82d833 > files > 581

sketch-0.6.13-2mdk.ppc.rpm

<html>
<head>
<title>Developer's Guide: User Interface
</title>
</head>
<body bgcolor=white text=black link=blue vlink=navy alink=red>
<TABLE WIDTH="100%">
<TR>
<TH ALIGN="left" WIDTH="33%"><img SRC="Images/arrow-left.png" WIDTH="16" HEIGHT="16" ALIGN="top" ALT="Prev"></TH>
<TH ALIGN="center" WIDTH="33%"><img SRC="Images/arrow-up.png" WIDTH="16" HEIGHT="16" ALIGN="top" ALT="Up"></TH>
<TH ALIGN="right" WIDTH="33%"><img SRC="Images/arrow-right.png" WIDTH="16" HEIGHT="16" ALIGN="top" ALT="Next"></TH>
</TR>
<TR>
<TD ALIGN="left"><A HREF="devguide-20.html">Plugins
</A></TD>
<TD ALIGN="center"><A HREF="devguide.html">Developer's Guide</A></TD>
<TD ALIGN="right"><A HREF="devguide-26.html">Message Passing</A></TD>
</TR>
</TABLE>
<HR NOSHADE>
<H1><FONT face="Helvetica,Arial"><A NAME="N1"></A>User Interface
</font></H1>


<H2><FONT face="Helvetica,Arial"><A NAME="N2"></A>Commands</font></H2>

<P><EM>Commands</EM> (or command objects), represent a command that can be
invoked by the user. Menu items and buttons are not directly connected
to methods of the canvas or the document, but are connected to these
commands.</P>
<P>A command object knows how to invoke the command (i.e. which method of
which object to call with which arguments) and how to update itself.
This update is done by calling several callbacks. The following
attributes are updated:
<DL>
<DT><B>Menu Name</B><DD>
<P>The text to display in a menu entry. The only commands that use
this currently are Undo and Redo. They use it to indicate what
action would be undone or redone.</P>

<DT><B>Sensitivity</B><DD>
<P>Whether the command is available at the moment or not. Most
commands have a callback for this because this attribute
determines whether the associated widgets (menu items or
buttons) are grayed out or not.</P>

<DT><B>Value</B><DD>
<P>The value is used by check command objects to determine whether
they are checked or not. In the current implementation this
value is used as the value of a Tkinter IntVar which is
associated with a widget (or menu item), so it should be true
for `checked' and false for `unchecked'.</P>
</DL>

Whenever, during an update, at least one of the attributes change, all
menu items or other associated widgets are notified and also updated.</P>
<P>A command object can be associated with any number of widgets or menu
items.</P>


<HR NOSHADE>
<TABLE WIDTH="100%">
<TR>
<TD ALIGN="left"><A HREF="devguide-20.html">Plugins
</A></TD>
<TD ALIGN="center"><A HREF="devguide.html">Developer's Guide</A></TD>
<TD ALIGN="right"><A HREF="devguide-26.html">Message Passing</A></TD>
</TR>
<TR>
<TH ALIGN="left" WIDTH="33%"><img SRC="Images/arrow-left.png" WIDTH="16" HEIGHT="16" ALIGN="top" ALT="Prev"></TH>
<TH ALIGN="center" WIDTH="33%"><img SRC="Images/arrow-up.png" WIDTH="16" HEIGHT="16" ALIGN="top" ALT="Up"></TH>
<TH ALIGN="right" WIDTH="33%"><img SRC="Images/arrow-right.png" WIDTH="16" HEIGHT="16" ALIGN="top" ALT="Next"></TH>
</TR>
</TABLE>
</body>
</html>