docs icon indicating copy to clipboard operation
docs copied to clipboard

`on-created` actor was never documented

Open hiiamboris opened this issue 6 years ago • 7 comments

https://doc.red-lang.org/en/view.html

There's a mention of on-create (with single face argument). But not a word about on-created and that it also accepts a single argument only.

hiiamboris avatar Jan 22 '20 13:01 hiiamboris

Per old discussion with @dockimbel:

on-create is supposed to be triggered before the widget creation (but after the face creation). I vaguely remember on-created that we wanted to rename it maybe to on-show, so that's why we didn't make it official yet.

9214 avatar Jan 22 '20 15:01 9214

on-show name would imply on every show though ;)

hiiamboris avatar Jan 22 '20 16:01 hiiamboris

On-create seems more accurate, and we can document it with a note that the name is still under consideration.

greggirwin avatar Jan 22 '20 18:01 greggirwin

@greggirwin except that on-create is already taken.

on-create and on-created both are triggered on face creation, but the former comes before OS-make-view call, which allocates low-level resources and establishes a two-way binding between face and widget, while the latter comes after the call.

9214 avatar Jan 22 '20 18:01 9214

I meant that on-create is better than on-show. The current names are fine, because otherwise we start down the path of on-pre-create/on-post-create, which isn't definitively better. Though it does make the names more obviously different.

greggirwin avatar Jan 22 '20 19:01 greggirwin

@greggirwin on-show is an alternative proposal for on-created, not for on-create. That's why it hasn't been documented.

9214 avatar Jan 22 '20 20:01 9214

Thanks for catching that. Let's see if I can get it right this time. On-created seems fine, as I agree with Boris that on-show implies it will happen on every showing of the face.

greggirwin avatar Jan 23 '20 17:01 greggirwin