Control; 'name_unique' option #16

Closed
BrodyB opened this Issue Aug 17, 2015 · 2 comments

Projects

None yet

2 participants

@BrodyB
BrodyB commented Aug 17, 2015

Currently, if a Mint control is added into a Luxe scene with a duplicate name, the scene will throw a warning.

It'd be great if Mint control options had the 'name_unique' parameter like Luxe objects have, so this is handled in the constructor.

@underscorediscovery

Will consider a good option but name+Luxe.utils.uniqueid() should get you there

@underscorediscovery
Member
underscorediscovery commented Sep 6, 2016 edited

Upon further thought, it seems more sensible to default to a good name + unique id and the explicit name override to be what it's intended: explicit.

What that means is previously, the defaults were sensible plain names:

  • button
  • progress

Now:

  • button.2F6xWQ
  • progress.8FCHj

This means that you can create controls freely without naming overlaps, since the name is not a function of the library usage, unless explicitly required to be, in which case the application implementation detail will handle both of those and the library provides the option to be explicit. This alleviates what you were seeing in practice, the rendering creating multiple visuals named the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment