Using html as buttons in editor

I noticed the clever technique used in the Antetype tutorials with html buttons triggering the next screen:

onclick="Antetype.gotoScreenWithIDEditMode(screenWidgets)"

Is there a similar thing I can do to

  • Change the state of a particular widget?
  • Change a property, like width (using text input)?

It would help me when I supply ready made components to colleagues.

The Antetype-object is the same as the at-Variable implicitly defined in Script-Actions. Therefor you can use everything here too.

We have examples for it in our JavaScript Widget & States documation. Just exchange at with Antetype and find a way to get to the cell you want to manipulate. (targetCells is only defined in Script-Actions). There are numerous ways to get a cell, all with their advantages/disadvantages. It depends what you want to do.

You can use the Cell ID, or find a DOM-Element and get it via the figure-property

Could you elaborate what do you have in mind? Maybe we can find a solution how to reference a cell.

Sure, basically, I am thinking of a custom-popover for widgets with edit behaviour. Example: We have a configuration option for control sizes (macOS allows mini, small and normal for menus, buttons etc…). I set the control sizes via css variables in a widget that wraps around a palette (for example). Finding the top-level widget and changing its state is not very discoverable for new users. In order to make onboarding easier (like you have done perfectly in your tutorials), I am thinking I could just add a popover to a widget that lets users switch its state while still in edit mode.

Ah ok, then I think I misunderstood you. Using methods on Antetype only changes it in your current WebView/Browser but does not change it in the document (like change the active state in the Style-Inspector or Style Bar). We currently only have internal APIs to send the changes made by direct-manipulation (change size with handles, move cell to different container etc.) back to the application.

Ok it was worth a try. Thanks!

it is an interesting idea though. For complex widgets (as you described) it is not always easy to understand how to use it.