[prev in list] [next in list] [prev in thread] [next in thread]
List: freedesktop-xorg
Subject: Re: Motif/Xt: Dynamically resize the visible item count of an XmList
From: "Chris Sorenson" <csoren () cpinternet ! com>
Date: 2021-12-06 0:41:55
Message-ID: 1638751315.tvm3q11yosg8g004 () webmail ! mycci ! net
[Download RAW message or body]
>
> Hi,
>
> I have an XmList (actually a ScrolledList) inside a RowColumn widget.
>
> The visible item count of the list is configured at widget creation
> time. When the RowColumn widget is resized, I would like to adapt that
> visible item count to the new size of the parent widget.
>
> Is there an easy way to do this?
>
> What I have come up with so far in theroy is to do the following:
> Listen to the resize event of the RowColumn widget, recompute the
> visible line count in a callback and then set it explicitly using
> XtSetValues(XmNvisibleItemCount).
>
> Unfortunately, I have not found any callback resource in the RowColumn
> widget.
>
> How can I listen to resize events of a widget?
>
> Best,
> Holger
>
I'm sure this is an oversimplification, but tell me what you think:
Widget rc, list;
rc = XtVaCreateManagedWidget ("rowcol",
xmRowColumnWidgetClass, toplevel,
XmNwidth, 200,
XmNheight, 200,
NULL);
list = XtVaCreateManagedWidget ("list",
xmListWidgetClass, rc,
XmNrightAttachment, XmATTACH_WIDGET,
XmNrightWidget, rc,
XmNleftAttachment, XmATTACH_WIDGET,
XmNleftWidget, rc,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, rc,
NULL);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic