royale-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Ent <>
Subject Re: Thoughts on ToggleButton
Date Thu, 07 Dec 2017 13:26:53 GMT
I’ve felt that way on occasion too. What we did was create view beads for SWF and not JS
in some cases because the createElement function was enough. Not sure what to do in these


> On Dec 7, 2017, at 5:52 AM, Piotr Zarzycki <> wrote:
> Hi Harbs,
> I would also place the logic which changes the image into the View bead. If
> I correct understand your thoughts. I think if it is possible it would be
> great reuse ImageButton in somehow, cause actually it is doing for one
> state what you want.
> It is the matter of handling states in the view.
> Thanks, Piotr
> 2017-12-07 11:46 GMT+01:00 Harbs <>:
>> I need a toggle button which displays images (i.e. ImageToggleButton).
>> Right now, the way ImageButton works is that the main component modifies
>> the element to show an image. This works only if you want a single image no
>> matter what the state of the button is. If you want different images on
>> hover, active, selected, etc. that requires a separate component.
>> Additionally, I wanted a button in an app which uses images for states. I
>> ended up just using a plain old div and setting the background image via
>> css for the different states. Adding components for each and every use case
>> seems broken.
>> Ideally, with Royale architecture, the component should really be much
>> more about the behavior of the component and the view should be delegated
>> to a bead.
>> I’m thinking that the logic which sets the html of the element should be a
>> a view bead. Any thoughts about reworking this?
>> Harbs
> -- 
> Piotr Zarzycki
> Patreon: *
> <>*
View raw message