home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!ucbvax!oceanroutes.ns.ca!deveau
- From: deveau@oceanroutes.ns.ca ("Terry J. Deveau")
- Newsgroups: comp.windows.x.motif
- Subject: Re: can't create another form
- Message-ID: <9208261840.AA24778@BU.EDU>
- Date: 26 Aug 92 18:40:04 GMT
- References: <moharil.714837752@judy.cs.iastate.edu>
- Sender: daemon@ucbvax.BERKELEY.EDU
- Distribution: inet
- Organization: Oceanroutes Canada Inc.
- Lines: 38
-
- > I have created one form widget to hold some push button widgets and
- > label widgets. In the callback functions of the pushbuttons, I want to
- > create another form so that it can hold some other widgets. But creating
- > another form lands me in problems:
- > I cant attach my widgets to this new form. Also attaching one widget to
- > another gives me segmentation fault.
- >
- > Why can't I create another form and use it the same way as the first
- > form. I am sure that the problem can be solved using other kind of
- > container widgets but why not form?
- >
- Don't create the new form in the callback, just manage it there; also
- your new form must be a child of an XmDialogShell, this is automatic
- if you use XmCreateFormDialog.
-
- Do the following during initialization:
-
- 1) XtAddCallback (pushbutton, XmNactivateCallback, yourCallback, NULL)
-
- 2) newform = XmCreateFormDialog (pushbutton, ...)
-
- 3) other = XmCreateOtherWidget (newform, ...) /* replace this call
- with whatever your "other widget" is */
-
- 4) XtManageChild(other)
-
- 5) repeat 3 and 4 as many times as necessary.
-
- In "yourCallback" include:
-
- 5) XtManageChild(newform)
-
- You can probably figure out the rest. OSF/Motif Programmer's Guide
- will help.
-
- Your segmentation fault is likely an error in pointer usage (C not Motif).
-
- ... Terry
-