/* Written by Dave Brennan.
 * Copyright 1994, O'Reilly & Associates, Inc.
 * Permission to use, copy, and modify this program without
 * restriction is hereby granted, as long as this copyright
 * notice appears in each copy of the program source code.
 * This program is freely distributable without licensing fees and
 * is provided without guarantee or warrantee expressed or implied.
 * This program is -not- in the public domain.
 */

/* hello_world.uil -- Illustrate basic UIL programming concepts */
                       
module hello_world
  objects = { XmPushButton = gadget; }
                       
value
  form_margin : 3;     ! Value for all-around form margins.

object hello_main : XmForm {
  controls {
    XmLabel       world;
    XmPushButton  hello;
  };
  arguments {
    XmNshadowThickness = 0;
    XmNresizePolicy = XmRESIZE_GROW;
    XmNmarginHeight = form_margin;
    XmNmarginWidth  = form_margin;
  };
};

value
  hello_string : "Hello, World!";
  hello_font   : font ('-adobe-helvetica-medium-r-normal-*-*-140-*');
  world_colors : color_table (background color = '*',
                              foreground color = ' ');
  world_icon   : icon (color_table = world_colors,
    '     ******     ',
    '   ** ***  **   ',
    '  *** **  *  *  ',
    ' ****    ***  * ',
    ' * ********* ** ',
    '* ****** *** ***',
    '* *********   **',
    '* *********   **',
    '*  ********   **',
    '*   ****  *    *',
    '*    **     *  *',
    ' *    **      * ',
    ' *    *****   * ',
    '  *  ******* *  ',
    '   **********   ',
    '     ******     '  );

procedure
  quit (string);

object world : XmLabel {
  arguments {
    XmNlabelType        = XmPIXMAP;
    XmNlabelPixmap      = world_icon;

    ! Form constraint resources
    XmNleftAttachment   = XmATTACH_FORM;
    XmNtopAttachment    = XmATTACH_FORM;
    XmNbottomAttachment = XmATTACH_FORM;
  };
};

object hello : XmPushButton {
  arguments {
    XmNlabelString      = hello_string;
    XmNfontList         = hello_font;
    XmNmarginHeight     = 2;
    XmNmarginWidth      = 3;

    ! Form constraint resources
    XmNleftAttachment   = XmATTACH_WIDGET;
    XmNleftWidget       = world;
    XmNtopAttachment    = XmATTACH_FORM;
    XmNbottomAttachment = XmATTACH_FORM;
    XmNrightAttachment  = XmATTACH_FORM;
  };
  callbacks {
    XmNactivateCallback = procedure quit ("Goodbye!");
  };
};
     
end module;

