> From: "A.Sloman" <A.Sloman@cs.bham.ac.uk>
>
> [...]
> I would be gratefile if someone using Poplog with Motif would
> test my guess for me by trying the following, after running Pop-11
>
> uses propsheet; ;;; should be already part of Pop-11, but in case not....
There should also be a call to -propsheet_init- here.
> ;;; create a propbox with four buttons labelled A, B, C, D.
> vars propbox = propsheet_new_box('TEST', false, false, [A B C D]);
>
> ;;; show it on screen (buttons should come out horizontal)
> propsheet_show(propbox);
>
> ;;; Now try to change its orientation:
>
> ;;; First load macro definitions for Motif
>
> uses XmConstants
#_IF pop_internal_version > 142200
loadinclude XmConstants;
#_ELSE
uses XmConstants;
#_ENDIF
Will make it work under later Poplog versions. The undocumented
XmConstants library will become a documented include file post 14.2.
> ;;; Now change the orientation (I hope). Mark and load this:
>
> XmVERTICAL ->
> XptValue(
> propbox.XptChildren.hd.XptChildren.hd.XptChildren.tl.hd,
> XtN orientation, TYPESPEC(:int)
> );
>
> ;;; Does that change the alignment?
Nope. The widget hierarchy is different under Motif so the
"propbox.XptChildren[...]" won't work.
I should also point out that the widget trees produced by LIB *
PROPSHEET are currently *not* documented and may well change in future
Propsheet versions. Writing code that depends on these widget trees is
likely to break (and yes --- I was guilty of this with some of the code
I gave to Aaron, I should have used propsheet_subpart, see next sentence
:-)
People should use the (undocumented as yet... Jon, where's that REF
file? :-) -propsheet_subpart- procedure to access the widgets in a
propbox. You can use
propsheet_subpart(propbox, "lower_controls")
to get the parent of the buttons.
Anyway... now we have the widget. Will
XmVERTICAL ->
XptValue(
propsheet_subpart(propbox, "lower_controls"),
XtN orientation
);
work?
Unfortunately not, since the parent of the buttons is an XmForm widget
which organises its children via a more complex mechanism. Those who are
interested should refer to:
man 3 XmForm
Basically, you will have to alter the constraint resources of the
button widgets (which you can get with
propsheet_subpart(propbox,"buttons") -> BUTTON_WIDGET_LIST
..)
Whether LIB * PROPSHEET should provide support for this kind of thing is
a moot point. IMHO we're exceeding the areas Propsheet was originally
designed to cope with here quite a bit. To do this kind of thing
properly would probably involve writing a more general Garnet-esque
library. Something I'd love to do if somebody will give me some money
:-)
> ;;; Also see if you can change its location, width and height
>
> (500, 20, 50, 200) -> XptWidgetCoords(propbox);
This will work. It's completely general and should work on any widget.
aids (email: adrianh@cogs.susx.ac.uk, phone: [+44] (0)273-678367)
ObDisclamer: Poplog pay my wages
|