Dynamically change from toggle to momentary?

This forum is for developers of Rack Extensions to discuss the RE SDK, share code, and offer tips to other developers.
User avatar
Murf
RE Developer
Posts: 670
Joined: 21 Jun 2019
Location: Brisbane, Australia

Post 28 Apr 2023

Hi All,
I think I am barking up the wrong tree here but I need to dynamically change the functionality of a button depending on another programmatic state.

Since the UI elements are static and cant change at runtime, I thought maybe I could have two overpaying buttons , one a toggle and one a momentary and switch the visibility of them programmaticly.

So far I have had no success, has anyone achieved this (or an alternative) before please?"

Thanks,
Murf.

_andreypetr_
Posts: 173
Joined: 11 Aug 2021

Post 28 Apr 2023

Hello! I'm not an expert but cannot you send a value with programming state that dynamically changes the algorithm that is used to handle the value of the button? For example, button is always momentary but you have another something that lights up depending of an algorithm results.
By the way, Hamu's Newtrol have ability to change buttons from momentary to toggle so maybe it is possible yet.

User avatar
Murf
RE Developer
Posts: 670
Joined: 21 Jun 2019
Location: Brisbane, Australia

Post 28 Apr 2023

_andreypetr_ wrote:
28 Apr 2023
Hello! I'm not an expert but cannot you send a value with programming state that dynamically changes the algorithm that is used to handle the value of the button? For example, button is always momentary but you have another something that lights up depending of an algorithm results.
By the way, Hamu's Newtrol have ability to change buttons from momentary to toggle so maybe it is possible yet.
Yes that could work but not really the UI experience I was going for.
I will check out Newtrol first thanks!

User avatar
pongasoft
RE Developer
Posts: 483
Joined: 21 Apr 2016
Location: Las Vegas

Post 29 Apr 2023

Murf wrote:
28 Apr 2023
Since the UI elements are static and cant change at runtime, I thought maybe I could have two overpaying buttons , one a toggle and one a momentary and switch the visibility of them programmaticly.

So far I have had no success, has anyone achieved this (or an alternative) before please?"
I don't see why this approach would not work:

* it is perfectly valid to have 2 overlapping widgets as long as they are not visible at the same time
* it is perfectly valid to have the same property represented by 2 (or more) widgets, even if they are different (like a momentary button and a toggle button)
* it is perfectly valid for the visibility property to be a RT property, and changed by RT

So when you say "So far I have had no success", what do you mean exactly? Did you set everything up properly?

I'll try to build a little POC, but I really don't see why it would not work...

Yan

User avatar
buddard
RE Developer
Posts: 1255
Joined: 17 Jan 2015
Location: Stockholm

Post 29 Apr 2023

pongasoft wrote:
29 Apr 2023
* it is perfectly valid for the visibility property to be a RT property, and changed by RT
Hmm, I might be wrong, but I'm pretty sure that it must be a doc or gui scope property?

User avatar
pongasoft
RE Developer
Posts: 483
Joined: 21 Apr 2016
Location: Las Vegas

Post 29 Apr 2023

@buddard LOL I just tried...
Screen Shot 2023-04-29 at 10.36.52.png

So I guess I was wrong and indeed that is not possible.

That being said, I am pretty sure you can implement your own button behavior by using a custom display since a custom display CAN have a RT property in its list of dependent properties...

I have implemented something that needed similar concepts in my A/B 12 switch (check the source)
You do not have the required permissions to view the files attached to this post.

User avatar
Murf
RE Developer
Posts: 670
Joined: 21 Jun 2019
Location: Brisbane, Australia

Post 29 Apr 2023

pongasoft wrote:
29 Apr 2023
@buddard LOL I just tried...



So I guess I was wrong and indeed that is not possible.

That being said, I am pretty sure you can implement your own button behavior by using a custom display since a custom display CAN have a RT property in its list of dependent properties...

I have implemented something that needed similar concepts in my A/B 12 switch (check the source)
Thanks Yan, yes thats the error I got, it is the same one you get if you try and change a UI element state programatically.
I have changed approach and getting the job done a different way now, but thanks for taking the time everyone.

  • Information
  • Who is online

    Users browsing this forum: CommonCrawl [Bot] and 2 guests