![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/share/doc/renaissance-doc/html/manual/ |
Upload File : |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2002-2-1 (1.71) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>2.9 Example</TITLE> <META NAME="description" CONTENT="2.9 Example"> <META NAME="keywords" CONTENT="manual"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="manual.css"> <LINK REL="previous" HREF="node22.html"> <LINK REL="up" HREF="node14.html"> <LINK REL="next" HREF="node24.html"> </HEAD> <BODY BGCOLOR="#FFFFFF" text="#000000" link="#0000FF" vlink="#4444FF" alink="#3388FF"> <B> Next: <A NAME="tex2html892" HREF="node24.html">3. Additional portability facilities</A> </B> <B>Up: <A NAME="tex2html888" HREF="node14.html">2. The GNUstep Markup</A> </B> <B> Previous: <A NAME="tex2html884" HREF="node22.html">2.8 Connector tag reference</A> </B> <BR> <P> <!--End of Navigation Panel--> <H1><A NAME="SECTION00390000000000000000"> 2.9 Example</A> </H1> <P> FIXME: this example should be replaced with a better one. <P> FIXME: add examples of advanced outlets. <P> <PRE> <?xml version="1.0"?> <!DOCTYPE gsmarkup> <gsmarkup> <objects> <!-- the main window --> <window title="Calculator" resizable="no" closable="no"> <vbox> <textfield editable="no" id="TextField" /> <hbox> <button title="1" target="#Controller" action="digit:" /> <button title="2" target="#Controller" action="digit:" /> <button title="3" target="#Controller" action="digit:" /> </hbox> <hbox> <button title="4" target="#Controller" action="digit:" /> <button title="5" target="#Controller" action="digit:" /> <button title="6" target="#Controller" action="digit:" /> </hbox> <hbox> <button title="7" target="#Controller" action="digit:" /> <button title="8" target="#Controller" action="digit:" /> <button title="9" target="#Controller" action="digit:" /> </hbox> <hbox> <button title="+" target="#Controller" action="add:" /> <button title="0" target="#Controller" action="digit:" /> <button title="=" target="#Controller" action="total:" /> </hbox> </vbox> </window> <!-- an object of a custom class, which is instantiated when the nib is loaded. Key-value coding is used to set textField to #TextField. In other words, the textField attribute is equivalent to having a NSNibOutletConnector with source #Controller, target #TextField, and key textField --> <instance instanceOf="CalculatorController" id="Controller" textField="#TextField" /> </objects> <!-- in this example, connectors are not actually needed (or better all connectors are embedded in the objects section) - but we add the connectors section as an example. --> <connectors> <!-- an example of a standalone connector, needed to connect the Controller to the controller ivar (or setController: method) of the NSOwner (the object which loaded the nib). This connector must be standalone because #NSOwner is not inside the nib. (you can reference objects totally outside the nib in a connector, which are provided by the nameTable dictionary when the nib is loaded) --> <outlet source="#NSOwner" target="#Controller" key="controller" /> </connectors> </gsmarkup> </PRE> <BR><HR> <ADDRESS> 2008-03-19 </ADDRESS> </BODY> </HTML>