Hi,
how is set the background color of a morph? I could access directly "Smalltalk ui theme backgroundColor" from within the Morph, but I don't see anywhere that something is using themed colors this way. So I assume there is some other way; what am I missing? Note that I don't want to use the color for background of the morph but I need to make a decision based on the color in the morph. Thanks, Peter |
2015-05-01 22:22 GMT+02:00 Peter Uhnák <[hidden email]>:
A morph has the fillStyle/color attribute, but this does not mean it uses this color for its drawing method. (for example ActiveHand color -> Color blue, and the hand/cursor is not blue).
this returns always the same color, it is actually the desktop backgroundcolor.
It depends on the morph, or the type of widget this morph represents. A button has a theme dependent color, that may depend on the type and state (enabled/disabled) of the button. A list morph may have different colors for even and odd index, selected, enabled, disabled ... A label model font/color may depend on its use (window title/menu title/ button label ...). Look at the xxxFillStyleFor: messages in UITheme
|
Thank's for the pointers. It seems to me that they access it via 'self theme'; in any case my problem is, for the moment, solved. Thanks, Peter On Fri, May 1, 2015 at 11:11 PM, Nicolai Hess <[hidden email]> wrote:
|
2015-05-01 23:54 GMT+02:00 Peter Uhnák <[hidden email]>:
Yes but, 'self theme' is 'the theme engine that defines all theme settings' and 'self theme backgroundColor' is 'what this theme defines as general backgroundColor' It does not mean that self (the morph) is actually using this theme setting for anything. For a panel morph, that normally uses 'Color transparent' for its color, would answer to 'self theme backgroundColor' with the same answer as any other morph. It is the 'theme backgroundColor' not the morphs background color.
|
no, it is not. it is the general background color (that should be applied *by default* to all morphs that recognises the background property), as Nicolai pointed. Now… all that is really messy and bad structured (and worst documented)… so do not expect it works all the time. Esteban
|
I know, I don't care if the morph itself uses it somewhere or not, I wanted color that _should_ be used as a background, so I can apply it to some part of the morph myself.
Yes, that is what I was looking for. I used the self theme backgroundColor and it works for the time being. Peter |
On 03/05/15 12:45, Peter Uhnák wrote:
> Yes, that is what I was looking for. > I used the self theme backgroundColor and it works for the time being. In your application you probably want to centralize this. Stephan |
Free forum by Nabble | Edit this page |