[comp.windows.x.motif] How can I remove sashes from window panes?

jtsillas@bubba.ma30.bull.com (James Tsillas) (04/04/91)

Hello, I am converting an app. based on Athena widgets to Motif.
One of the things it uses is the XmPanedWindow class. Once I create
the widget I wish to keep the sash from appearing for the first
child. How can I do this? A code fragment would be *greatly* appreciated.

-Jim.

meeks@osf.org (W. Scott Meeks) (04/04/91)

>Date: 3 Apr 91 19:11:38 GMT
>From: sdd.hp.com!wuarchive!hsdndev!bbn.com!mips2!bubba!jtsillas@ucsd.edu  (James Tsillas)
>
>Hello, I am converting an app. based on Athena widgets to Motif.
>One of the things it uses is the XmPanedWindow class. Once I create
>the widget I wish to keep the sash from appearing for the first
>child. How can I do this? A code fragment would be *greatly* appreciated.

All you have to do is set the XmNpaneMaximum and XmNpaneMinimum PanedWindow
constraint resources on the child to the same value.  If you're explicitly
setting the height of the child in question, then you can just set the
resources to that value.  See page 1-733, paragraph 3 of the 1.1
Programmer's Reference.  For example:

object
	push_button1 :	XmPushButton {
	  arguments {
		XmNheight = 100;
		XmNpaneMaximum = 100;
		XmNpaneMinimum = 100;
	  };
	};

If you don't explicitly set the height of the child, but rely on the
parent's size and constraints to set the child's height, then it's a little
more complicated.  You'll have to manage the widgets first, query the
XmNheight of the child and then set the panedMinimum and panedMaximum to
that value.  It may cause a brief flicker of the sash.

I hope this helps.  If you have any further questions, please let me know.

W. Scott Meeks           | We must live with the fact, true throughout recorded
Open Software Foundation | history, that our artifacts are sometimes flawed and
meeks@osf.org            | cause us to die in novel and unexpected ways, and we
(617) 621-7229           | can only do our human best to minimize the problems.

david@lta.com (David B. Lewis) (04/05/91)

> the widget I wish to keep the sash from appearing for the first
> child. How can I do this? A code fragment would be *greatly* appreciated.


Set its paneMinimum to its paneMaximum to its height.

carroll@cs.uiuc.edu (Alan M. Carroll) (04/05/91)

In article <9104041433.AA19019@clew>, meeks@osf.org (W. Scott Meeks) writes:
> >Date: 3 Apr 91 19:11:38 GMT
> >From: sdd.hp.com!wuarchive!hsdndev!bbn.com!mips2!bubba!jtsillas@ucsd.edu  (James Tsillas)
> >
> >keep the sash from appearing for the first child [ of panedwindow ]
> 
> All you have to do is set the XmNpaneMaximum and XmNpaneMinimum PanedWindow
> constraint resources on the child to the same value.
> See page 1-733, paragraph 3 of the 1.1

I was trying to do the same thing, and I couldn't get it to work under
any circumstances. Then I saw your post and noticed that you referred
to "XmNpaneMinimum" while all of my references refer to "XmNminimum".
Has this been changed since 1.0?

Here's a requested code fragment:

{
  /* assume that widget has the child widget, and it's already been realized */
  short height;  /* notice that it's a short */
  Arg argl[2];

  XtSetArg(argl[0], XmNheight, &height);
  XtGetValues(widget, argl, 1);
  /* _not_ XmNminimum or XmNmaximum */
  XtSetArg(argl[0], XmNpaneMinimum, height);
  XtSetArg(argl[1], XmNpaneMaximum, height);
  XtSetValues(widget, argl, 2);
}
-- 
Alan M. Carroll          <-- Another victim of applied metaphysics
Epoch Development Team   
Urbana Il.               "I hate shopping with the reality-impaired" - Susan

carroll@cs.uiuc.edu (Alan M. Carroll) (04/07/91)

I finally got the sash removal to work, but I still have a question.
I'm running under SunOS 4.1.1, with Motif 1.1. What I needed was to
have a Menubar in a paned window, without a sash. I did this by adding
a callback to XmNmapCallback for the menubar, which when called sets
the min and max size for the menubar to the current size. However, in
order to get this to actually work, I also had to add an X event
handler with a StructureNotifyMask, which if the event is a MapNotify,
invokes XtCallCallbacks on the widget and XmNmapCallback. My question
is, why did _I_ have to add this X event handler? Thanks!

P.S. I know a lot of X window stuff, but very little Motif.

-- 
Alan M. Carroll          <-- Another victim of applied metaphysics
Epoch Development Team   
Urbana Il.               "I hate shopping with the reality-impaired" - Susan