cancel
Showing results for 
Search instead for 
Did you mean: 

Assign a different Scrollbar width to a scrollableContainer

User2025
Associate II

I am working with TouchGFX Designer 4.24.2
If I assign a different Scrollbar width to a scrollableContainer in     Screen1view::setupScreen()
after or before the command     Screen1ViewBase::setup();

      scrollableContainerMainMenu.setScrollbarWidt(50);
      scrollableContainerMainMenu.invalidate();

 

the scrollbar is only 50 pixels wide after you click into the ScrollableContainer.
What do you have to do so that it is displayed in the correct width from the start?

6 REPLIES 6
GaetanGodart
ST Employee

Hello @User2025 and welcome to the community!

 

Simply call 

scrollableContainerName.childGeometryChanged();

and your new scrollbar width will be shown before you even touch the scrollableContainer.

 

If this comment answer your question, I invite you to select it as "best answer".

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)
GaetanGodart
ST Employee

Hello @User2025 ,

 

Have you been able to solve your issue?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)
User2025
Associate II

Hello GaetanGodart,

thank you very much for your help. It works well.

I try it with

scrollableContainerMainMenu.doScroll(0, 0);

but this only works with Y values not equal to 0 (e.g. -1).

scrollableContainerMainMenu.doScroll(0, -1);

 

Regards,

Hello @User2025 ,

 

This seems to be a completely different question here.

scrollableContainerMainMenu.doScroll(x, y) is used to scroll the container up/down and left/right.

Therefore, using 0 as a value will scroll 0 pixels.

So I don't see what is the issue here.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)
User2025
Associate II

Hello Gaetan Godart,
I had used the command scrollableContainer.doScroll(0, -1) as a substitute to force a redraw of the scrollbar, but did not realize that (0,0) corresponds to the actual state at the start time and is therefore nonsense.
Many thanks for your help.

My pleasure @User2025 !

 

Can you select the comment that helped you the most as "best answer"?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)