ways of formatting uiLCDLabel

Home Forums General Using Ctrlr ways of formatting uiLCDLabel

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #5342
    SWB
    Participant
    • Topics: 35
    • Replies: 157
    • Total: 192
    • ★★

    I’m trying to familiarize with the component ‘uiLCDLabel’. The way it works is already quite amazing, but I’m wondering if there are more format variables and ways to construct a format then what is provided. What I want to do (for example) is fill the component with names of presets given a certain preset number. Before i turn to Lua is this also possible without the use of Lua? If I need Lua which function(s) do I need? Any input much appreciated.

    #5343
    SWB
    Participant
    • Topics: 35
    • Replies: 157
    • Total: 192
    • ★★

    Well, a visit to http://lua-users.org/wiki/StringLibraryTutorial (as somewhere in this forum advised by Atom) revealed more ways of ‘string.format’. But I couldn’t find %n, %N, %v… Are these specific to Ctrlr?

    #5344
    atom
    Keymaster
    • Topics: 159
    • Replies: 2945
    • Total: 3104
    • ★★★★★

    yes they are. The field for the uiLabel/uiLCDLabel is Ctrlr formatted LUA is not used for it. I’m afraid you won’t be able to pass custom long strings to it without some LUA usage, if you can describe an exact scenario i can help you with some examples.

    #5348
    SWB
    Participant
    • Topics: 35
    • Replies: 157
    • Total: 192
    • ★★

    Diving a bit deeper into Lua I managed to get the actual text of the ‘component’ using the following code:

    aa = panel:getComponent(“LCDLabel-1”):getComponentText()

    BUT when trying to set the text using this code:

    panel:getComponent(“LCDLabel-1”):setComponentText(“Hello”)

    nothing happens, not even an error message. What is the right code to set the text of a component in Lua?

    #5349
    SWB
    Participant
    • Topics: 35
    • Replies: 157
    • Total: 192
    • ★★

    I wrote the above massage before reading your reply Atom, but in fact what I wrote there is what I want to do. The text to set will be a variable containing the string I want the Label to show. This text could of course be anything, depending on the used modulator.

    #5352
    atom
    Keymaster
    • Topics: 159
    • Replies: 2945
    • Total: 3104
    • ★★★★★

    That should work, the only other way is to set the property like (assuming you have the latest nightly)

    panel:getComponent("lcd"):setProperty("uiLabelText", "washa", false)
    

    But your code works for me here, i don’t see anything obviously wrong with it.

    #5364
    SWB
    Participant
    • Topics: 35
    • Replies: 157
    • Total: 192
    • ★★

    Hi Atom,

    I’m on a Mac (10.7.5.) and use the latest stable version, because there are no recent nightly builds for Mac, right?  So I downloaded the latest Windows version (December 31, 23:59, nice timing :-)) and with this version indeed ‘setComponentText’ works as expected.

    BTW I noticed that this Windows version looks more “mature” (and certainly more ‘clean’ because of the menu options without the big icons…), and assume that it is further developed than the Mac version, so I wonder if you plan to update so it is on par with the Windows version. (In the meantime I will try to work with Ctrlr and MIDI on Windows…)

    #5365
    atom
    Keymaster
    • Topics: 159
    • Replies: 2945
    • Total: 3104
    • ★★★★★

    I didn’t build for the MAC cause i wanted to get some stability. But the nigtlies are too old, so i just uploaded a nighlty build for the mac. Give it a try.

    #5368
    SWB
    Participant
    • Topics: 35
    • Replies: 157
    • Total: 192
    • ★★

    This build works, at least for the ‘setComponentText’. Also the interface looks much better! I will use this version and let you (and this forum) know how things work out. Thanks for answering my questions and the new upload!

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘Using Ctrlr’ is closed to new topics and replies.
There is currently 0 users and 30 guests online
No users are currently active
Forum Statistics
Threads: 2,495, Posts: 17,374, Members: 77,605
Most users ever online was 12 on January 22, 2019 3:47 pm
Ctrlr