home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x.motif
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!haven.umd.edu!darwin.sura.net!wupost!csus.edu!netcom.com!richm
- From: richm@netcom.com (Richard Mauri)
- Subject: Re: Need subclassing help!?
- Message-ID: <1992Nov20.152129.27705@netcom.com>
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- References: <4312@cvbnetPrime.COM>
- Date: Fri, 20 Nov 1992 15:21:29 GMT
- Lines: 76
-
- In article <4312@cvbnetPrime.COM> dhukill@esprit.prime.com (Dave Hukill x4056 5-1) writes:
- >I'm having a problem with a widget I've subclassed under motif. I get the
- >following error:
- >
- >Warning:
- > Name: menubar
- > Class: XmRowColumn
- > Attempt to add wrong type child to a homogeneous RowColumn widget
- >
- >The code looks like this:
- >
- > shell = XtAppInitialize(&appContext,
- > "myWidgetApp",
- > NULL,
- > 0,
- > &argc,
- > argv,
- > NULL,
- > NULL,
- > 0);
- >
- > menuBar = XmCreateMenuBar(shell,
- > "menubar",
- > NULL,
- > 0);
- > XtManageChild(menuBar);
- >
- > menuPulldown = XmCreatePulldownMenu(menuBar,
- > "menuPulldown",
- > NULL,
- > 0);
- >
- > menuItem = XtVaCreateManagedWidget("menu item",
- > xmPushButtonWidgetClass,
- > menuPulldown,
- > NULL);
- > XtAddCallback(menuItem, XmNactivateCallback, menuItemCallback, NULL);
- >
- > menuButton = XtVaCreateManagedWidget("menu button",
- > myMenuButtonWidgetClass,
- > menuBar,
- > XmNsubMenuId, menuPulldown,
- > NULL);
- >
- >Obviously, my class is 'muMenuButtonWidgetClass'. The strange thing is that
- >the widget works properly. I'm running Quest Motif version 1.1.4 on Sun SPARC.
- >I've checked and double-checked the class initializations in the class record,
- >and they appear to be fine. I've successfully sub-classed this widget under
- >OLIT, but other than the 'core' class, they're quite different.
- >
- >Any input on this problem would be greatly appreciated!
- >
- >advTHANKSance -
- >Dave Hukill <dhukill@esprit.prime.com>
-
- Here are some observations:
- 1. Your RowColumn does not explicitly set the XmNisHomogeneous
- resource, since you use the menubar convenience function, you
- let it set the resource to True for you. Try setting it to
- False after creating the menubar.
- 2. Normally you add cascade buttons as children of menubar's
- but you add a pulldown menu and your myMenuButtonWidgetClass
- which are not nomogeneous.
- 3. Have you stepped through in synchronous mode to find out
- which is the offending call. Sounds like the problem isn't
- in your myMenuButtonWidgetClass but it is different than
- the first rowcolumn child and as such appears to be you
- widget class. It is the row column that is screaming.
- 4. Try using homogeneous children of the rowcolumn
- or setting the resource to False.
- Rich Mauri
- --
- Richard Mauri // Not ready to face the winter.
- SW Eng / X hack // Pray for wind.
- Trimble Navigation Ltd. // Pay the bills.
- richm@netcom.com // Hope nothing breaks
-