[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: QT5 ListBox Problem


On 2/28/26 1:00 PM, Lee wrote:
On 2/28/26 2:42 AM, Benoît Minisini wrote:
Le 28/02/2026 à 06:25, Lee a écrit :
On 2/27/26 7:19 PM, Benoît Minisini wrote:
Le 27/02/2026 à 21:25, Lee a écrit :
Does the problem occur with the master branch?


Yes, the issue persists on 3.21.99 409093b (master) with all three of those GUI toolkits.

It occurs only if ListBox.ScrollBar is set to include Horizontal with either Scroll.Horizontal or Scroll.Both.



I asked because I can't reproduce the problem. Can you send me a little project that shows the bug?


I've discovered that the issue occurs if ListBox.Scrollbar is set to include Scroll.Horizontal *prior* to ListBox.List being populated (which would include setting it via the IDE's property sheet). A project that shows the bug is very simple.

Merely add a ListBox to a form, set its Scrollbar property to None so it can be controlled programmatically, and then use just this code in FMain.class:

[code]
Public Sub Form_Open()

     ' ListBox1.ScrollBar = Scroll.Both ' Setting it here causes the issue
     ListBox1.List = ["One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten"]
     ' ListBox1.ScrollBar = Scroll.Both ' Setting it here does not cause the issue

End
[/code]



Thanks, it should be fixed in master now.

Regards,


Unfortunately, no, it is not fixed in version 3.21.99 cc76782 (master).

I tried using ListBox1.Refresh after setting the List, but that didn't help.

I found that setting ListBox1.Wrap = True prior to populating the List causes the ListBox to behave as expected.

In the gb.gui.base source code for the UpdateLayout() subroutine: if $bWrap is true, line 230 sets $hView.AutoResize = True, else if the Scroll.Horizontal bit is set, line 238 sets $hView.AutoResize = False.

I commented out line 238 and recompiled with `make install`. That fixes it. But, I don't know what other issues that may cause.


--
Lee

--- Gambas User List Netiquette [https://gambaswiki.org/wiki/doc/netiquette] ----
--- Gambas User List Archive [https://lists.gambas-basic.org/archive/user] ----


Follow-Ups:
Re: QT5 ListBox ProblemBruce Steers <bsteers4@xxxxxxxxx>