1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

Solved Switch that changes the height of the user interface (set_ui_height_px)?

Discussion in 'Scripting Workshop' started by Chromo Fonic, Nov 15, 2021.

  1. Chromo Fonic

    Chromo Fonic New Member

    Messages:
    10
    Use case: I want to toggle between a 350px and a 150px version of the UI.
    I can achieve this by using two script slots. However, I would like to avoid using the grey tabs, at the bottom, for switching between the two UI versions. Is it possible to script a switch within one script slot that redefines the UI height?
    Alternatively, is there another way to switch between two different UI heights within an instrument?
    I know that probably the (set_ui_height_px) can only be defined once per script. I tried to think of intelligent ways of circumventing this. Albeit my programming skills are not good enough to implement the idea.

    Thank you
     
  2. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    You can definitely have a switch that chooses a different UI height and only then you do set_ui_height_px(). However in that case the user will need to restart the audio engine (press "!" button in top right of Kontakt) in order to apply that change. Some libraries out there use this method (Red Room Audio Palette, Luftrum Bioscape). That's the only way for now.
     
    • Informative Informative x 1
  3. Chromo Fonic

    Chromo Fonic New Member

    Messages:
    10
    Thank you Evil Dragon, for the explanation. My purpose was to switch to a smaller GUI height, making the instrument more conducive to a "multi" setup in one click that is obvious and elegant (big button), thus improving the user experience.
    I understand the neat "<> />< " and " ! " trick from Red Room Audio Palette (I have their primary colours free edition). However, since watching the walkthrough, I thought it was an afterthought on the developers part to utilize the extra space afforded by Kontakt 6 (probably they designed the original GUI on an older version of Kontakt).
    Since I can not avoid the "define and set" two-click way, I will probably redesign my GUI to smoothen out the interface between the grey tab at the bottom and the GUI itself. On that note, is it possible to change the grey colour of the tabs at the bottom?
     
  4. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    Nope.
     
    • Like Like x 1