home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!think.com!ames!agate!ucbvax!oceanroutes.ns.ca!deveau
- From: deveau@oceanroutes.ns.ca ("Terry J. Deveau")
- Newsgroups: comp.windows.x.motif
- Subject: Re: POSITIONING of dialog boxes. How do I do that ???
- Message-ID: <9211161528.AA28029@BU.EDU>
- Date: 16 Nov 92 15:26:57 GMT
- References: <MAN.92Nov14190555@imrryr.at>
- Sender: daemon@ucbvax.BERKELEY.EDU
- Distribution: inet
- Organization: Oceanroutes Canada Inc.
- Lines: 48
-
- Andreas Manessinger <man@magwien.gv.at> writes:
- >
- > What I want (ideally) is, that new boxes are always created in the
- > proximity of the mouse pointer.
- >
- > What I tried is:
- >
- > Creating the widgets as children of the box that contains the
- > initiating push button and setting `XmNdefaultPosition' to
- > `true'. This works quite well, the widgets appear in a
- > position centered to their parent, but I look for a solution
- > that works NOT ONLY AT CREATION TIME. Besides from that, I
- > couldn't iconify my whole application by iconifying the main
- > window any more.
- >
- I don't know how to solve your main problem; however, on the question
- of the whole application iconifying with the main window or not, what
- I have noticed is that this works properly when each XmDialogShell is
- made the child of the container widget which is the sole child of the
- XmDialogShell one level higher up. Any other relationships seem to
- mess-up the iconification.
-
- If you are using XmCreateFormDialog (for example), you will have to
- do something like this:
-
- app_shell = XtInititalize (...)
- main_win = XmCreateMainWindow (app_shell, ...)
- work_area = XmCreateForm (main_win, ...)
- level2 = XmCreateFormDialog (work_area, ...)
- level3 = XmCreateFormDialog (level2, ...)
-
- Note that I have not shown the widgets (pushbuttons, menus, etc.) that
- are needed to have the user open the dialogs, the XmCreateFormDialog
- calls would go in the callback functions of those widgets.
-
- Note also that XmCreateMainWindow works a little differently from the
- general rule; can omit it if you don't need it.
-
- Doing things this way, the dialogs usually come up centred on the
- widget that generated the callback (even though it's not formally
- in the hierarchy for the new dialog), whether the mouse or keyboard
- was used to generate the callback. On some callbacks triggered by
- the keyboard (in particular the Help() action), the triggering
- widget is unmanaged before the new dialog is created; the new dialog
- then seems to come up almost as far away as possible from the location
- where the triggering widget used to be. Isn't motif wonderful!
-
- ... Terry
-