home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x.motif
- Path: sparky!uunet!enterpoop.mit.edu!paperboy.osf.org!moonshine!daniel
- From: daniel@moonshine.osf.org (Daniel Dardailler)
- Subject: Re: Motif 1.2 widgets with non-Motif parents
- Message-ID: <1993Jan4.204131.13775@osf.org>
- Sender: daniel@moonshine (Daniel Dardailler)
- Organization: Open Software Foundation, Motif Team
- References: <FELIX.93Jan4180727@idefix.laas.fr>
- Distribution: comp
- Date: Mon, 4 Jan 1993 20:41:31 GMT
- Lines: 71
-
- 1.2 has introduced a bug that precludes mixing of Motif and non-Motif
- widgets.
-
- The problem is a blind access of the core class extension
- record without proper checking.
-
- The bug has been fixed in 1.2.2.
-
- In the mean time, if you have the problem,
- you need to do one of the following:
- - subclass out of a Motif widget
- - add a Motif core class extension to your widget
-
- I already post something describing how to implement option 2 in the past.
- Here it is again:
-
- In your widget JoeWidget.c, you need to create a Motif extension record.
- (the typedef you already get with XmP.h I think)
-
- static XmBaseClassExtRec baseClassExtRec = {
- NULL,
- NULLQUARK,
- XmBaseClassExtVersion,
- sizeof(XmBaseClassExtRec),
- NULL, /* InitializePrehook */
- NULL, /* SetValuesPrehook */
- NULL, /* InitializePosthook */
- NULL, /* SetValuesPosthook */
- NULL, /* secondaryObjectClass */
- NULL, /* secondaryCreate */
- NULL, /* getSecRes data */
- { 0 }, /* fastSubclass flags */
- NULL, /* getValuesPrehook */
- NULL, /* getValuesPosthook */
- NULL, /* classPartInitPrehook */
- NULL, /* classPartInitPosthook*/
- NULL, /* ext_resources */
- NULL, /* compiled_ext_resources*/
- 0, /* num_ext_resources */
- FALSE, /* use_sub_resources */
- NULL, /* widgetNavigable */
- NULL /* focusChange */
- };
-
- /******* then you stuck it in your class record: *******/
-
- JoeClassRec joeClassRec =
- {
- { /* core_class fields */
- (WidgetClass) &superJoeClassRec, /* superclass */
- "Joe", /* class_name */
- sizeof(JoeRec), /* widget_size */
- ClassInitialize, /* class_initialize */
- ClassPartInitialize, /* class_part_init */
- ..........
- QueryGeometry, /* query_geometry */
- NULL, /* display_accelerator*/
- (XtPointer)&baseClassExtRec, /* extension */
- },
-
-
- /******* and you also initialize the record_type
- (can't be done statically becasue it's a variable *******/
-
- static void ClassInitialize( void )
- {
- baseClassExtRec.record_type = XmQmotif ;
- }
-
-
- I haven't actually test this code, tell me if there is a problem.
-