toga icon indicating copy to clipboard operation
toga copied to clipboard

Migrate style property syntax in docs

Open HalfWhitt opened this issue 10 months ago • 1 comments

What is the problem or limitation you are having?

With #3107 merged, style properties can be set directly on widgets, even in constructors. Currently, all the docs and examples are shown setting them explicitly via widget.style, with a note added to the bottom of base Widget explaining that one can also access them directly.

Describe the solution you'd like

Since the motivation is not only less typing but also simplicity for beginners, it would probably be best if this were flipped — use the newly added syntax most places, with a separate explanation of the underlying mechanism. It might still be worth using the "old" way in some places — with an explanation, or link to one — if it shows something useful, like reusing the same set of properties on several widgets.

Describe alternatives you've considered

All the code shown still works just fine.

Additional context

No response

HalfWhitt avatar Jan 29 '25 03:01 HalfWhitt

Agreed this would make sense. We should keep a couple of "old style" examples kicking around, but agreed that the overall focus of Toga's examples should be the new syntax. Depending on the discussion around #3134, that might involve some related work.

freakboy3742 avatar Jan 30 '25 03:01 freakboy3742

I plan on doing this issue

lanpham09 avatar May 19 '25 15:05 lanpham09

Toga docs are updated; let's leave this open until the examples and the main BeeWare tutorial have been updated as well.

mhsmith avatar May 19 '25 16:05 mhsmith

I am currently going through the Toga examples to update the style syntax.

kattni avatar Jul 05 '25 00:07 kattni