Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
User Data Attribute for ui elements
-
@omz, I am sorry to sound like a broken record on this Topic. But it would be so handy if ui elements had a user_data attribute. Or whatever you want to call it. I am not sure how difficult this or if it would break anything. I know this can be sort of achieved with custom classes etc. but sometimes, it would be nice just to poke a reference to some data or whatever directly into the ui.item itself. It would be nice if all elements from ui.View down had this attribute. I think it's far more useful than it sounds on the surface.
-
The beta version like 3 or 4 versions ago added this feature just for you! Check release notes... now you can add custom attributes to any ui.View instances (including ui.Buttons, etc)
-
This is my favorite kind of feature request. ;)
-
How do you get back the release notes? I knew @omz had done it but did not know how to get back the release note to prove it to myself.
-
Aren't all the release notes in
Beta Release Notes.md
-
Build 160020
[...]
-
ui.View
now supports setting arbitrary attributes, so you don't have to subclass in order to attach some auxiliary data to a view (or any subclass ofui.View
). Note that this might hide bugs/typos in your code because something likemy_view.fame = ...
(instead ofmy_view.frame
) no longer throws an exception (but this is consistent with the way most objects in Python work). -
The UI editor now supports setting custom attributes for views. You can use this to attach arbitrary data to a view or to set built-in attributes that aren't supported directly in the UI editor's inspector (e.g.
ui.TextField.keyboard_type
).
-
-
@Webmaster4o Yep. All there.
-
Wow, that's fantastic. It. Must of been done before I started using 1.6. I have been reading the release notes, but not all the history. I should have. But this is great....
Thanks guys...