SquareBracketAssociates / BuildingApplicationWithSpec2

A book to build user interfaces using the Spec 2.0 framework.
20 stars 12 forks source link

Add documentation on focus #100

Closed jecisc closed 7 hours ago

jecisc commented 1 month ago

I am currently building an UI and I would like to change the way the focus works. I would like for example to have my window open with the focus on its second element. But I cannot find the way to do that (or maybe that does not work?)

It would be great to add a section on the focus management and maybe add a little thing in the example of most of spec parts.

jecisc commented 1 month ago

Oh, I found the way to do what I wanted with this:

initializeWindow: aWindowPresenter

    super initializeWindow: aWindowPresenter.
    aWindowPresenter title: 'New protocol name'.

    aWindowPresenter whenOpenedDo: [ protocolNameField takeKeyboardFocus ]

Leaving this here as an example.

We should also document the focus order