Hi all,

Alexander Mai suggested that I acquire the "Hello World" program used for 
the toolkit size comparisons so that they could be run using lesstif. 
Stuart Anderson of Metro Link kindly provided me with the code which I've 
attached below. I asked Stuart on details of the linking (shared vs static) 
and he was unclear on it because someone else performed the tests for him.

Regards,

Mark
---

#include <Xm/XmAll.h>


#define APP_CLASS "Foo"



static Widget toplevel ;  /* used in OKCB for set its size */


int main(int argc, char *argv[])
{
     XtAppContext app_context;
     int i ;
     Widget mainw, nb ;


     XtSetLanguageProc(NULL, NULL, NULL);
     toplevel = XtVaAppInitialize(&app_context, APP_CLASS, NULL, 0,
                                &argc, argv, NULL, NULL);


     /*** create utility widgets */
     mainw = CreateMainWindowWithMenuBar(toplevel);
     XtManageChild(mainw);


     XtRealizeWidget(toplevel);
     XtAppMainLoop(app_context);


     return (0);
}


static void
QuitCB (Widget w, XtPointer client_data, XtPointer call_data)
{
     exit (0);
}


CreateMainWindowWithMenuBar(Widget toplevel)
{
     Widget      main_window, pb;

     Arg         args[20];
     Cardinal    n;



     /*  Create MainWindow.
      */
     n = 0;
     main_window = XmCreateMainWindow (toplevel, "main_window", args, n);
     XtManageChild (main_window);


     /*  Create MenuBar in MainWindow.
      */
     n = 0;
     pb = XmCreatePushButtonGadget (main_window, "Hello Motif", args, n);
     XtManageChild (pb);
     XtAddCallback (pb, XmNactivateCallback, QuitCB, NULL);

         return (main_window);
}




DEBUGFLAGS=-O2
         DEPLIBS = XmClientDepLibs
LOCAL_LIBRARIES = XmClientLibs


SRCS = hello_motif.c
OBJS = hello_motif.o


NormalLibraryObjectRule()


MSimpleProgramTarget(hello_motif)


InstallProgram(hello_motif,$(BINDIR))

-
Integrated Computer Solutions, Inc.
Visual Development Tools for Professionals

617-621-0060 x108 (voice)
617-621-9555 (fax)

201 Broadway
Cambridge, MA 02139

Visit the MotifZone (www.motifzone.org) for info on Motif!

Reply via email to