🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #37616

XmNvalue accuracy problems with motif ScrollBars

#37616
From: chris ross
Date: Fri, 02 Mar 1990 23:27
58 lines
2801 bytes
I recently started using Motif and UIL, and am seeing some weird
behavior in ScrollBar widgets.  I have a small application that sets
up a MenuBar, two ScrollBars, and a DrawingArea as children of a Form,
in an arrangement similar to that of a MainWindow widget.

	-----------------------------------------
	|  menu bar				|
	-----------------------------------------
	|				      |^|
	|				      | |
	|				      |Y|
	|	drawing area		      |b|
	|				      |a|
	|				      |r|
	|				      | |
	|				      |v|
	-----------------------------------------
	|<              Xbar                 >| |
	-----------------------------------------

The idea is to use the scroll bars to pan around a world coordinate
system of arbitrary bounds.  To prevent loss of panning accuracy, I
have the XmNmaximum resources for the scroll bars set to some
ridiculous value like 100000 (the XmNminimum resources are 0.)  The
0-100000 ranges are mapped to world coordinates as needed.  The
XmNprocessingDirection is XmMAX_ON_TOP for Ybar, since the world
system has 0,0 at the lower left.

With such large values for XmNmaximum, Motif seems to be unable to
handle the boundary conditions at the ends of the scrollbars.  Moving
the Xbar or Ybar slider *all* the way to the left or bottom sometimes
produces a slider value of 0, but more often that not it comes out as
33, 400, 1090, or some other random value.  Likewise, moving them all
the way to the right or top can produce a value which is not equal to
XmNmaximum - XmNsliderSize.

To make matters worse, growing the window sometimes causes the Ybar
slider to snap to the top end of the range.  I also occasionally get
the following error from the toolkit, usually when the "snap" behavior
occurs.  Nowhere do I set the XmNvalue resource for either scrollbar;
I assume this is Motif's doing.

  X Toolkit Warning: Name: tmw_yScrollBar	Class: XmScrollBar
    The specified scrollbar value is greater than the maximum
    scrollbar value minus the scrollbar slider size.


Has anyone else seen this problem?  Is there a workaround (other than
decreasing the XmNmaxima?)

My system configuration is:
	Masscomp 5600 running RTU 4.0A, 
	X11R3, Motif 1.0

thanx for your time.

_______________________________
chris ross  <0>  cjross@bbn.com
Technical Details
Message-ID: <52945@bbn.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!emory!mephisto!bbn!bbn.com!cjross

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!emory!mephisto!bbn!bbn.com!cjross
From: cjross@bbn.com (chris ross)
Newsgroups: comp.windows.x
Subject: XmNvalue accuracy problems with motif ScrollBars
Summary: large XmNmaximum causes problems at ends of scroll bar
Message-ID: <52945@bbn.COM>
Date: 2 Mar 90 23:27:12 GMT
Sender: news@bbn.COM
Reply-To: cjross@BBN.COM (chris ross)
Organization: Bolt Beranek and Newman Inc., Cambridge MA
Lines: 58