| What .1 is trying not to say is that the iconify button is owned by
the window manager, so there is no way to have it set from UIL.
You can, however, use XtParent to find the widget ID of the window
manager's window given the dialog box widget ID. Simply fetch
your popup from your hierarchy, use XtSetArg to set XtNnoIconify
to FALSE, XtSetValues to set the parameter in the parent, and then
XtManageChild to cause the widget to be realized.
If a different window manager comes along and behaves differently,
it is possible this mechanism could break, but this seems to work
OK for the current DECwindows default window manager and somewhat
for the hp window manager.
The following is some code to implement iconify buttons and icons
in the DECwindows V1 environment. The hp window manager behaves a
little differently in that I think it uses 64x64 icons, rather than
32x32, and it doesn't make use of the "iconify" pixmap, the following
code also doesn't produce an icon for the "main window" (if memory
serves me correctly) but does produce them for the popups.
static Arg args[5];
if (widget == NULL)
{
if (DwtFetchWidget(hierarchy, "my_popup", toplevel,
&widget, &dummy_class) != DRMSuccess)
{
s_error("can't fetch popup widget");
}
/* Set the title for the title bar */
XtSetArg (args[0], DwtNtitle, widget_banner);
/* Allow the window to be iconified (double negative) */
XtSetArg (args[1], XtNnoIconify, FALSE);
/* Set the name to be used beside the icon */
XtSetArg (args[2], XtNiconName, widget_icon_name);
/* Set the big icon */
XtSetArg (args[3], XtNiconPixmap, widget_icon);
/* Now set the iconify button (and small icon) */
XtSetArg (args[4], XtNiconifyPixmap, widget_iconify);
XtSetValues (XtParent (widget), args, 5);
}
XtManageChild(widget);
I wish window manager designer's had been more consistent in their
designs (like allowing XGetIconSizes to return useful information!).
-Dave
|
|
re: < Note 547.2 by LDP::WEAVER "Laboratory Data Products/Science">
I did as you suggested, I set the XtNnoIconify argument to false,
and indeed I did get the shrink to an icon box on my popup dbs.
The strange thing is that the dialog boxes exhibit unusual
behavior. For some reason, when I iconize one of the dialog
boxes, then iconize the main window, and then un-iconize the main
window the dialog box reappears as well. The shrink to an icon box
on the dialog box does not work at this stage, and the icon in the
icon box is still dark (not grayed). When I click on the icon in
the icon box focus is then moved to the dialog box. Clicking on
the icon in the icon box again will iconize the dialog box. Has
anyone else seen this peculiar behavior?
Thanks for the help so far,
William
|
| RE: .2
Ok. This code works, but I am confused.
We did an XtParent on widget, but we just said toplevel was the parent
of widget???
What is XtParent really returning? Is the parent of widget not simply
toplevel? ...and if not, I'm confused!?
Ken
|
| When you create a popup dialog box, the toolkit creates a hidden
"shell" widget in between the toplevel widget and the popup widget. The
shell widget contains the code necessary to communicate with the window
manager, and gives the dialog box its "popup" characteristics.
You can also create shell widgets explicitly, and use them as parents
of other types of windows.
The shell widgets are documented in the Toolkit Reference Manual (if I
recall correctly - I'm writing this from home). The widget that you get
back from XtParent(popup) is a shell widget - you'll see that there are
many resources that you can set on them to change the interface with
the window manager.
Kevin
|