[Openmcl-devel] Lisp User Interface LUI

Terje Norderhaug terje at in-progress.com
Sun Jan 4 23:01:41 UTC 2009


On Jan 2, 2009, at 11:30 AM, Alexander Repenning wrote:
> <application-window title="Currency Converter" width="300"  
> height="180">
>   <column align="stretch" valign="stretch" padding="9">
>     <row align="stretch" minimize="vertical" valign="bottom">
>      <label text="Exchange Rate per $1:" align="right" flex="2"/>
>      <editable-number name="rate" text="1.0" flex="1"/>
>     </row>
>     <row align="stretch" minimize="vertical" valign="bottom">
>      <label text="Dollars to Convert:" align="right" flex="2"/>
>      <editable-number name="dollars" text="1.0" flex="1"/>
>     </row>
>     <row align="stretch" minimize="vertical" valign="bottom">
>      <label text="Amount in the other Currency:" align="right"  
> flex="2"/>
>      <editable-number  name="amount" text="1.0" flex="1"/>
>     </row>
>     <row align="right" valign="bottom" vflex="1">
>       <button text="Convert" action="convert-currency-action"  
> default-button="true"/>
>     </row>
>   </column>
> </application-window>

We should also note that Apple has an XML based user interface  
language, XIB. A benefit of the format is that it is supported by  
Apple's Interface Builder. But it is also dense and verbose, and  
barely human readable.

http://developer.apple.com/documentation/developertools/conceptual/ 
IB_UserGuide/BuildingaNibFile/chapter_3_section_2.html

Here is XIB for a similar dialog as the Currency Converter example:

<?xml version="1.0" standalone="yes"?>
<object class="NSIBObjectData">
   <string name="targetFramework">IBCarbonFramework</string>
   <object name="rootObject" class="NSCustomObject" id="1">
     <string name="customClass">NSApplication</string>
   </object>
   <array count="8" name="allObjects">
     <object class="IBCarbonWindow" id="166">
       <string name="windowRect">51 183 411 663 </string>
       <string name="title">Window</string>
       <object name="rootControl" class="IBCarbonRootControl" id="167">
         <string name="bounds">0 0 360 480 </string>
         <string name="viewFrame">0 0 480 360 </string>
         <array count="2" name="subviews">
           <object class="IBCarbonPopupButton" id="180">
             <string name="bounds">58 57 78 177 </string>
             <string name="viewFrame">57 58 120 20 </string>
             <object name="menu" class="IBCarbonMenu" id="181">
               <string name="title">Popup</string>
               <array count="3" name="items">
                 <object class="IBCarbonMenuItem" id="184">
                   <boolean name="updateSingleItem">TRUE</boolean>
                   <string name="title">Item 1</string>
                 </object>
                 <object class="IBCarbonMenuItem" id="183">
                   <boolean name="updateSingleItem">TRUE</boolean>
                   <string name="title">Item 2</string>
                 </object>
                 <object class="IBCarbonMenuItem" id="182">
                   <boolean name="updateSingleItem">TRUE</boolean>
                   <string name="title">Item 3</string>
                 </object>
               </array>
             </object>
           </object>
           <object class="IBCarbonButton" id="185">
             <string name="bounds">127 66 147 135 </string>
             <string name="viewFrame">66 127 69 20 </string>
             <string name="title">Button</string>
           </object>
         </array>
       </object>
       <boolean name="receiveUpdates">FALSE</boolean>
       <boolean name="liveResize">TRUE</boolean>
       <boolean name="compositing">TRUE</boolean>
       <boolean name="isConstrained">FALSE</boolean>
     </object>
     <reference idRef="167"/>
     <reference idRef="180"/>
     <reference idRef="181"/>
     <reference idRef="182"/>
     <reference idRef="183"/>
     <reference idRef="184"/>
     <reference idRef="185"/>
   </array>
   <array count="8" name="allParents">
     <reference idRef="1"/>
     <reference idRef="166"/>
     <reference idRef="167"/>
     <reference idRef="180"/>
     <reference idRef="181"/>
     <reference idRef="181"/>
     <reference idRef="181"/>
     <reference idRef="167"/>
   </array>
   <dictionary count="2" name="nameTable">
     <string>File's Owner</string>
     <reference idRef="1"/>
     <string>Window</string>
     <reference idRef="166"/>
   </dictionary>
   <unsigned_int name="nextObjectID">186</unsigned_int>
</object>

-- Terje Norderhaug




More information about the Openmcl-devel mailing list