List Widget Size

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

3 posts / 0 new
Last post
List Widget Size

Submitted by Anonymous on Fri, 03/10/2006 - 19:36.

Quick question. 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?

Fri, 03/24/2006 - 23:04#1

Fri, 03/24/2006 - 23:04#1

bkat

List Widget Fixe

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))

 

Fri, 04/07/2006 - 04:52#2

Fri, 04/07/2006 - 04:52#2

bkat

Re: List Widget Fixe

Thanks to the Motif team for accepting the above bug fix (bug #1332).