View Single Post
Old 10-21-2019, 11:46 AM   #530
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

Quote:
Originally Posted by babag View Post
is whether it's possible to have two lines of text on a button. i literally JUST tried the library for the first time so i very likely missed something. how would one do this?
It's been a while, but I think you just have to type \n in the label to get a line break.

Quote:
the second question would be about editing a toolbar once it's been made. would that be possible? or, would it have to be rebuilt from the ground up? didn't see an import option.
You can have it create the toolbar dynamically from a list when the script starts. Something like:
Code:
local toolbar_buttons = {
  { label: "thing", command: 12345 },
  { label: "stuff", command: 67890 },
}

local button_width = 48

for k, v in ipairs(toolbar_buttons) do
  GUI.New("btn_"..k, "Button", (k - 1) * button_width, 0, button_width, 24, caption = v.label, func = function() reaper.Main_OnCommand(v.command, 0) end)
end
(This example might be a bit rough... I don't have Reaper on this machine and I haven't used v2 of the library in a while)

The list could also be a separate text file if that's easier, you just have to get Lua to read it in. Regardless, editing your toolbar would just be a matter of editing the list.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote