Home | Software Map | Motif Forums | Bug Home sponsored by ICS 
Full Text Bug Listing
 
XmList item default size set to 0 instead of 1
Bug#: 1331 Product: OpenMotif Version: 2.3.0 Beta 1 Platform: All
OS/Version: Linux Status: CLOSED Severity: normal Priority: Medium
Resolution: FIXED Assigned To: openmotif-devel@motifzone.net Reported By: yura@ics.com
Component: MotifCode Target milestone:2.3.0
URL: 
Summary: XmList item default size set to 0 instead of 1
Description:
From MotifZone forum:

I have an XmList widget that has XmNvisibleItemCount set to 5 with no items
actually stored in the widget. With openmotif 2.2.3, it respecits the
visiibleItemCount when calculating the height.

With openMotif 2.3 beta 2, the widget is basically zero pixels high. If I put an
empty string in the widget, it does resize to be one row high.

What's the correct behavior for XmList when XmNvisibleItemCount is greater than
XmNitemCount?

-----------------

I figured out what was causing my tiny height list widget. It seems to me that a
patch that went in for Motif 2.3''s List.c ihad an incorrect check in it.
Specifically, in SetDefaultSize if
USE_XFT is defined, we do the following:
#if USE_XFT
int height;

XmRenderTableGetDefaultFontExtents(lw->list.font, &height, NULL, NULL);

lw->list.MaxItemHeight = (Dimension)height;
if (lw->list.MaxItemHeight)
lw->list.MaxItemHeight = 1;
#else

If believe that if test above should have been checking if MaxItemHeight was
equal to zero instead if checking if its not zero. My gigantic patch to this is

--- openmotif-2.3.0/lib/Xm/List.c.vizcount 2006-03-24 16:45:01.000000000 -0600
+++ openmotif-2.3.0/lib/Xm/List.c 2006-03-24 16:45:35.000000000 -0600
@@ -2672,7 +2672,7 @@
XmRenderTableGetDefaultFontExtents(lw->list.font, &height, NULL, NULL);

lw->list.MaxItemHeight = (Dimension)height;
- if (lw->list.MaxItemHeight)
+ if (lw->list.MaxItemHeight == 0)
lw->list.MaxItemHeight = 1;
#else
if (XmeRenderTableGetDefaultFont(lw->list.font, &fs))


------- Additional Comments From Yura Syrota 2006-03-29 06:13 -------
Fixed as proposed


------- Additional Comments From Yura Syrota 2006-03-29 07:56 -------
*** Bug 1330 has been marked as a duplicate of this bug. ***


------- Additional Comments From Yura Syrota 2007-10-17 09:15 -------
*** Bug 1349 has been marked as a duplicate of this bug. ***


------- Additional Comments From Alexa 2014-02-02 21:23 -------
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen live from the domain http://volichat.com/adult-chat-rooms
Marked for reference. Resolved as fixed @bugzilla.


Update this bug

Submit a Patch for this bug

Note: All patches are submitted under the MIT License.