Motif/Xt: Dynamically resize the visible item count of an XmList
Holger Sebert
holger.sebert at ruhr-uni-bochum.de
Wed Jan 12 22:57:37 UTC 2022
On 12/16/21 00:22, Chris Sorenson wrote:
>>
>
>> Tried it out, but it not yield the desired result, unfortunately.
>>
>> The list widget gets resized but it does not update the visible item
>> count property.
>>
>> I need to somehow catch the resize event and update it manually, but
>> I don't find any suitable callback.
>>
> Hrm, do you have XmNvisualPolicy set to XmVARIABLE on the scrolled window?
I investigated the issue further. As it turns out, the ScrolledList
behaves correctly, i.e. if it is resized by the parent widget, then
the visible item count is re-calculated and updated.
The problem is the RowColumn: With orientation set to XmVERTICAL (the
default), the widgets are only resized along the x-axis. Their height,
however, remains fixed. Therefore, the ScrolledList widget inside
that RowColumn gets its height never properly updated and cannot
adjust its visible item cound.
When setting the RowColumn's orientation to XmHORIZONTAL, the behavior
is mirrored: The heights of the childrens are updated, but their
respective width remains fixed.
Setting the orientation to both XmVERTICAL and XmHORIZONTAL to somehow
"merge" these two ways of behavior is not possible.
I also tried using a Form-Widget instead of a RowColumn and use
XmATTACH_FORM for all directions (top, bottom, left and right), but
the Form would not resize the ScrollList widget either.
I have attached a small example program to illustrate the behavior.
Just try to resize the main window and observe how the ScrolledList
widget is NOT properly resized.
Maybe it's a feature, I don't know. But it looks like I'll have
to write my own manager widget to accomplish the task.
Best,
Holger
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scrolled_list_rowcol.c
Type: text/x-csrc
Size: 1894 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg/attachments/20220112/ce18ee38/attachment.c>
More information about the xorg
mailing list