[comp.windows.x.motif] Help - I've lost the Examples...

rep@odin.icd.ab.com (Robert E. Pappenhagen) (02/28/91)

Help - I/ve lost the posting that said where to get the Motif examples....

I,m a new unix user who's trying to convert a small Athena Widget application
to Motif...

At the moment my call to XtAddCAllback() says it 
X Toolkit Warning: Cannot find callback list in XtAddCallbacks

Station()
{
	exit(0); 
}

main(argc,argv)
int argc;
char **argv;
{
        Arg     toparg[10];
        Widget  toplevel,box,boxes[64];
        int i;
        int Station();

        toplevel = XtInitialize(
                argv[0],
                "Xboxes",
                NULL,
                0,
                &argc,
                argv
                );
 
         box = XtCreateManagedWidget(
                "box",
                 xmRowColumnWidgetClass,
                 toplevel,
                 NULL,
                 0);
/*
 *      Create Some boxes
 */
        for(i = 0 ; i < 64 ; ++i)
        {
           XtSetArg(toparg[0],XtNwidth,100);
           boxes[i] = XtCreateManagedWidget(
                 "stations",
                 xmPushButtonWidgetClass,
                 box,
                 toparg,
                 1);

           XtAddCallback( boxes[i], XtNcallback, Station, 0);
         }

/* POP THE WINDOWS */

        XtRealizeWidget(toplevel);
        XtMainLoop();
}

Any help or advice would be most help full - this is only a small part of the
application - details leftout but it works using the Athena widget set

If anyone has a 1:1 relationship between Athena and Motif I'd appreciate it

Thanks.... Bob

Bob Pappenhagen - Currently owned by Tasha, a 1 year old Bernese Mtn Dog 
All opinions expressed are hers

:

gjf00@duts.ccc.amdahl.com (Gordon Freedman) (03/02/91)

In article <2070@abvax.UUCP> rep@odin.icd.ab.com (Robert E. Pappenhagen) writes:
>
>Help - I/ve lost the posting that said where to get the Motif examples....
>
>I,m a new unix user who's trying to convert a small Athena Widget application
>to Motif...
>
>At the moment my call to XtAddCAllback() says it 
>X Toolkit Warning: Cannot find callback list in XtAddCallbacks
>
>
>           XtAddCallback( boxes[i], XtNcallback, Station, 0);
>
>Thanks.... Bob
>
>Bob Pappenhagen - Currently owned by Tasha, a 1 year old Bernese Mtn Dog 
>All opinions expressed are hers
>
>:

Look in the Motif man page for the widget you want to add a callback to. In
this case you probably want to do:

	XtAddCallback (boxes[i], XmNactivateCallback, Station, 0) ;

or something like that (the operative change here is XmNactivateCallback).
You don't specify XtNcallback since that resource doesn't usually exist
for motif widgets. The man page will list all of the types of callbacks,
what is passed to the callbacks/etc.
--
Gordon Freedman: gjf00@duts.ccc.amdahl.com
Disclaimer: My opinions! Not my employers!