Old 07-18-2017, 12:47 AM   #1
Gianfini
Human being with feelings
 
Join Date: Jan 2015
Posts: 794
Default HELP ON LUA: scrollable list

Hi. Little question here: how can I create a scrollable list within a window in .lua?

I want to show a set of strings in a window pane that is scrollable depending on the number of items

thanks for the support

g
Gianfini is offline   Reply With Quote
Old 07-18-2017, 01:24 AM   #2
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

There are at least two ways to do this:
  1. Draw the scrollable content in an in-memory buffer and copy the desired part of it on the window, depending on scroll. Search for "blit" and gfx.dest in the ReaScript documentation.
  2. An alternative way is to manually determine which items to show depending on the scroll and only draw those at an appropriate Y position. (I use this method in my GUI scripts "Interactive ReaScript" and "Song Switcher".)
See also gfx.mouse_wheel.

Last edited by cfillion; 07-18-2017 at 02:46 PM.
cfillion is offline   Reply With Quote
Old 07-18-2017, 05:14 AM   #3
Gianfini
Human being with feelings
 
Join Date: Jan 2015
Posts: 794
Default

Quote:
Originally Posted by cfillion View Post
There are at least two ways to do this:
  1. Draw the scrollable content in an in-memory buffer and copy the desired part of it on the window, depending on scroll. Search for "blit" and gfx.dest in the ReaScript documentation.
  2. An alternative way is to manually determine which items to show depending on the scroll and only draw those at an appropriate X position. (I use this method in my GUI scripts "Interactive ReaScript" and "Song Switcher".)
See also gfx.mouse_wheel.
thanks, I was hoping there was a library doing it based on a list.. but ok will try that.
g
Gianfini is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:15 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.