home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / Microline3.0 / examples / folder1.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.1 KB  |  73 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. /*
  20.  * The following source code is part of the Microline Widget Library.
  21.  * The Microline widget library is made available to Mozilla developers
  22.  * under the Netscape Public License (NPL) by Neuron Data.  To learn
  23.  * more about Neuron Data, please visit the Neuron Data Home Page at
  24.  * http://www.neurondata.com.
  25.  */
  26.  
  27.  
  28. #include <Xm/Xm.h>
  29. #include <Xm/Label.h>
  30. #include <XmL/Folder.h>
  31.  
  32. main(argc, argv)
  33. int argc;
  34. char *argv[];
  35. {
  36.     XtAppContext app;
  37.     Widget shell, folder, form;
  38.     XmString str;
  39.     char buf[20];
  40.     int i;
  41.  
  42.     shell =  XtAppInitialize(&app, "Folder1", NULL, 0,
  43.         &argc, argv, NULL, NULL, 0);
  44.  
  45.     folder = XtVaCreateManagedWidget("folder",
  46.         xmlFolderWidgetClass, shell,
  47.         NULL);
  48.  
  49.     for (i = 0; i < 3; i++)
  50.     {
  51.         /* Add a tab and Form managed by the tab to the Folder */
  52.         sprintf(buf, "Tab %d", i);
  53.         str = XmStringCreateSimple(buf);
  54.         form = XmLFolderAddTabForm(folder, str);
  55.         XmStringFree(str);
  56.  
  57.         /* Add a Label as a child of the Form */
  58.         sprintf(buf, "Form %d", i);
  59.         XtVaCreateManagedWidget(buf,
  60.             xmLabelWidgetClass, form,
  61.             XmNmarginWidth, 100,
  62.             XmNmarginHeight, 80,
  63.             XmNtopAttachment, XmATTACH_FORM,
  64.             XmNbottomAttachment, XmATTACH_FORM,
  65.             XmNleftAttachment, XmATTACH_FORM,
  66.             XmNrightAttachment, XmATTACH_FORM,
  67.             NULL);
  68.     }
  69.  
  70.     XtRealizeWidget(shell);
  71.     XtAppMainLoop(app);
  72. }
  73.