[squeak-dev] How should one implement a custom window color for a custom window?

Marcel Taeumel marcel.taeumel at hpi.de
Sat Sep 16 13:34:08 UTC 2017


Hi Hannes,

I wasn't aware of these wiki pages. :) Looks good. Yet, I would rather add more application code examples:

   label color: (self userInterfaceTheme unfocusedLabelColor ifNil: [Color darkGray]).

   (self userInterfaceTheme unfocusedWindowColorModifier ifNil: [ [:color | color darker] ]) value: self paneColorToUse.

   text addAttribute: (TextFontReference toFont: (self userInterfaceTheme font ifNil: [TextStyle defaultFont])).

   (self userInterfaceTheme selectionModifier ifNil: [ [:c | c muchLighter] ]) value: (aButton valueOfProperty: #normalColor).

The code itself is a good documentation, too:
- Look at the tests in UserInterfaceThemeTest.
- Browse senders of #userInterfaceTheme.
- Browse implementors of #setDefaultParameters in conjunction with implementors of #applyUserInterfaceTheme.
- Browse implementors/senders of #themeProperties --- which is part of the update logic during theme switches BUT ALSO a  tool interface for UI-Theme-Design-Tools yet to be implemented. :-D



Programming tools are paramount for understanding code, objects, behavior, .... Especially in a live environment such as Squeak. ;-)

Best,
Marcel 
Am 16.09.2017 13:49:56 schrieb H. Hirzel <hannes.hirzel at gmail.com>:
Hello Marcel

Thank you for the clarifications about the user interface themes
(UserInterfaceTheme [1]). May we consider this as a start of a
documentation ?

Or is there more from your side?

:-)

Regards

--Hannes

[1] UserInterfaceTheme
http://wiki.squeak.org/squeak/6508

On 9/16/17, Marcel Taeumel wrote:
> Hi Tim,
>
> I am sorry that the core mechanism of the User Interface Themes confuses
> you. :) The idea of application-specific UI properties, such as window
> colors, kind of overlaps/interferes with the idea of general widget
> theming.
>
> If you want to work around the UI theming to provide a window color for your
> tool, just implement #windowColorToUse. If not, just implement
> #defaultWindowColor like all other tools in the system do. Try the
> implementors tool to verify. :-)
>
> It is not that difficult. You already found Model >> #windowColorToUse. Now
> you can use the Squeak's implementors tool to browse implementors of all the
> symbols you can find in that method: #( useColorfulWindows customWindowColor
> defaultWindowColor uniformWindowColor). I suppose that that journey ends
> after a few minutes when you discover:
>
>
> Best,
> Marcel
> Am 16.09.2017 02:00:18 schrieb tim Rowledge :
> A couple of months back Eliot asked about this and I have a few minutes to
> spend to maybe fix it.
>
> I notice that Model>windowColorToUse sends #customWindowColor, which is not
> implemented. Which would seemingly lead us to expect a debugger but I see
> some very… interesting code in UserInterfaceTheme where a dNU: is caught and
> Very Odd Things are done. Ten out of ten for creative and intriguing code,
> minus several million for completely obscured intent.
>
> At the least it would be nice to have an implementation *somewhere* that
> explains what is being done, why, and maybe even how we can move to a
> simpler scheme.
>
> Related things I noticed -
> EToys-Squeakland adds Object, StringHolder & TranscriptStream class >
> windowColorSpecification which seem to be in need of removal.
> PreferencesPanel class>windowColorSpecification is seemingly in need of the
> chop
> WindowColorRegistry, the only sender of windowColorSpecification, is in the
> deprecated categories, though yes, i nthe 5.1 deprecation pile so maybe is
> has to stay for now.
>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Strange OpCodes: WK: Write to Keyboard
>
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20170916/61945054/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 117080 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20170916/61945054/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 70334 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20170916/61945054/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 216242 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20170916/61945054/attachment-0005.png>


More information about the Squeak-dev mailing list