Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

[Widgets] AutoUI - CreateUI() with arguments instead of pars

Send us your requests for enhancements (RFEs)

[Widgets] AutoUI - CreateUI() with arguments instead of pars

Postby alphamoonbase » Mon Jul 15, 2019 2:43 pm

I think it would be nice if, instead of settings the different parameter in the AutoUI first and then calling the GenerateUI() method, it would be nice to pass all the parameters as arguments to the method instead and call the GenerateUI() method when pressing the pulse-parameter.
alphamoonbase
 
Posts: 33
Joined: Fri Jun 26, 2015 3:54 pm

Re: [Widgets] AutoUI - CreateUI() with arguments instead of

Postby Ivan » Mon Jul 15, 2019 6:58 pm

Sounds sensible and pretty easy to do. What's the purpose exactly? I'd want to make sure the changes help you in the way you're looking for.
User avatar
Ivan
Staff
 
Posts: 242
Joined: Fri Mar 18, 2016 7:12 pm

Re: [Widgets] AutoUI - CreateUI() with arguments instead of

Postby alphamoonbase » Mon Jul 15, 2019 7:21 pm

It is probably more about personal coding aesthetic but I think it is nice to have the possibility to interact with comps in a more code-based way, without the in-between step of setting the parameter.
Calling the method an maybe using the pars as a fallback gives more flexibility and could make the code more readable in different styles (and reduces the ammount of written code.)

So instead (when using autoUI with a Replicator) of
Code: Select all
for c in newOps:
      targetPath = template[c.digits, 'path'].val
      op.autoUI.par.Customcomp = op(targetPath)
      op.autoUI.par.Ui = c
      op.autoUI.GenerateUI()
      pass

you could also write
Code: Select all
for c in newOps:
      op.autoUI.GenerateUI(customComp = op(template[c.digits, 'path'].val), ui = c)
      pass


And with using it as a optional argument it is still compatible to the way it is now.
alphamoonbase
 
Posts: 33
Joined: Fri Jun 26, 2015 3:54 pm


Return to Wishlist and RFEs

Who is online

Users browsing this forum: No registered users and 6 guests