ban2/png

tutor/gif
Home

cell/gif

Attaching objects

Certain objects allow other objects to be attached to them. When an object is created, all of its attached objects are also created. In this example a window is attached to the Iconbar and a popup menu is attached to the window

cell/gif
1/gif Create a new AppBasic shell application
2/gif Create a window template and attach it to the iconbar object
  1. Open the resfile display and add a window template
    resf/gif
  2. Double-click the iconbar object to open its edit dbox
    window/gif
    In the “Select button” section of the dbox select the Show object option . Now drag the window template to the writeable icon. (This is a fast way to insert the name of the object to be shown when the iconbar is selected).
stop/gif N.B. Objects must NEVER be attached to themselves!
When an application, which has a resfile with an object attached to itself (either directly or in a chain of attachments), is run the computer may 'freeze', resulting in the need to switch off the power supply.
3/gif Create a menu template and attach it to the window
  1. Add a menu template to the resfile display
  2. Open the window's main edit dbox
    menu/gifDouble-click the window template followed by double-clicking the window which opens
  3. Select the Show menu option and drag the menu template to the writeable icon
4/gif Save the resfile and run the application
5/gif Select the iconbar and popup the window's menu
The menu is automatically created because it is attached to an object (Window) which was itself auto-created.
6/gif Worked solution