/*
 * This file contains routines to draw and update the screen.
 *
 * Copyright 1990 by the Massachusetts Institute of Technology.
 *
 * For copying and distribution information, please see the file
 * <mit-copyright.h>.
 *
 * Tom Coppeto
 * MIT Network Services
 * 8 August 1990
 *
 *    $Source: /afs/net.mit.edu/tools/src/xport/RCS/xstuff.c,v $
 *    $Author: tom $
 *    $Locker: tom $
 *    $Log:	xstuff.c,v $
 * Revision 1.2  90/08/19  16:19:18  tom
 * *** empty log message ***
 * 
 * Revision 1.1  90/08/15  01:13:17  tom
 * Initial revision
 * 
 */

#ifndef lint
static char *rcsid = "$Header: /afs/net.mit.edu/tools/src/xport/RCS/xstuff.c,v 1.2 90/08/19 16:19:18 tom Exp Locker: tom $";
#endif

#include <X11/Xatom.h>
#include <X11/IntrinsicP.h>
#include <X11/CompositeP.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>
#include <X11/Xaw/Paned.h>
#include <X11/Xaw/Form.h>
#include <X11/Xaw/Command.h>
#include <X11/Xaw/Toggle.h>
#include <X11/Xaw/Box.h>
#include <X11/Xaw/Viewport.h>
#include <X11/Xaw/Label.h>
#include <X11/Xaw/StripChart.h>
#include <X11/Xaw/Cardinals.h>
#include <X11/Xaw/AsciiText.h>
#include <X11/cursorfont.h>
#include <X11/Xaw/Dialog.h>
#include <X11/cursorfont.h>
#include <X11/Xaw/MenuButton.h>
#include <X11/Xaw/SimpleMenu.h>
#include <X11/Xaw/Sme.h>
#include <X11/Xaw/SmeBSB.h>
#include <X11/Xaw/Repeater.h>
#include <X11/Xaw/ScrollbarP.h>
#include <X11/Xaw/Viewport.h>
#include <X11/Xaw/ViewportP.h>

#include <X11/Xtw/Rolo.h>
#include <X11/Xtw/Frame.h>
#include <X11/Xtw/Digit.h>
#include <X11/Xtw/Chooser.h>

XtAppContext app_con;
Widget toplevel;
Widget header;
Widget buffer;


/*
 *   Function:    draw_screen()
 *   Description: draws the initial screen
 *   Returns:     none
 */



main(argc, argv)
     int argc;
     char **argv;
{
  Widget mainForm;
  Widget form;
  Widget widget;
  Widget view;
  Widget menu;
  Arg args[5];

  /*
   * initialize the application
   */

  toplevel    = XtAppInitialize(&app_con, "XTEST", NULL, 0, 
				&argc, argv, NULL, NULL, 0);

  make_rolo_popup(toplevel, "foo", "bar");
  XtRealizeWidget(toplevel);
  XtAppMainLoop(app_con);
}


make_rolo_popup(w, title, stuff)
     Widget w;
     char   *title;
     char   *stuff;
{
  Widget      popup;
  Widget      rolo;
  Widget      form;
  Widget      widget;
  Position    x, y;
  Dimension   width, height;
  Cardinal    n;
  Arg         args[10];
  static char  *choice[] = {"red", "green", "blue", (char *) NULL};

  n = 0;
  XtSetArg(args[n], XtNlabel, (XtArgVal) "title");    n++;
  form  = XtCreateManagedWidget("frame", frameWidgetClass, w, args, n);
  n = 0;
  XtSetArg(args[n], XtNwidth,  (XtArgVal) 100);       n++;
  XtSetArg(args[n], XtNheight, (XtArgVal) 250);       n++;
  XtSetArg(args[n], XtNborderWidth, (XtArgVal) 0);    n++;
  rolo = XtCreateManagedWidget("rolo", roloWidgetClass, form, args, n);
  
  XtCreateManagedWidget("label", labelWidgetClass, rolo, args, n);
  XtCreateManagedWidget("command", commandWidgetClass, rolo, args, n);

  n = 0;
  XtSetArg(args[n], XtNwidth,  (XtArgVal) 100);       n++;
  XtSetArg(args[n], XtNheight, (XtArgVal) 30);        n++;
  XtCreateManagedWidget("toggle", toggleWidgetClass, rolo, args, n);

  n = 0;
  XtSetArg(args[n], XtNwidth,  (XtArgVal) 100);       n++;
  XtSetArg(args[n], XtNheight, (XtArgVal) 250);       n++;
  XtSetArg(args[n], XtNeditType, XawtextEdit);        n++;
  XtCreateManagedWidget("editor", asciiTextWidgetClass, rolo, args, n);


  XtCreateManagedWidget("digit", digitWidgetClass, rolo, args, 0);
  
  n = 0;
  XtSetArg(args[n], XtNborderWidth, 0);               n++;
  widget = XtCreateManagedWidget("chooser", boxWidgetClass, rolo, args, 1);
  n = 0;
  XtSetArg(args[n], XtNchoices, choice);              n++;
  XtCreateManagedWidget("chooser", chooserWidgetClass, widget, args, n);

  n = 0;
  XtSetArg(args[n], XtNlabel, "hello");               n++;
  XtwAddFrameCommand("command", commandWidgetClass, form, args, n);

  return;
}


