pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: Styles as an Element.
Date Wed, 05 Aug 2009 02:32:01 GMT
OK, scratch the styles element suggestion. It doesn't work - I knew I  
should have done a little more due diligence before replying to your  
email.  :-)

When an element refers to a read-only dictionary, we can't determine  
the type of the properties referred to by the element's attributes  
(because Dictionary doesn't provide a "getType()" method). So, we  
can't coerce it to the appropriate type. As a result, read-only  
dictionary properties are set as strings, since that is how attribute  
values are inherently typed. You should be seeing an error in the  
console telling you that "padding is not a valid style" - correct?  
That's because we're trying to call a string setter for padding, and  
it doesn't exist.

So, kudos to you for pushing WTKX to see what you can and can't do.  
Unfortunately, you can't do this.  :-)

On Aug 4, 2009, at 7:47 PM, Scott Lanham wrote:

> Tried right/left top/bottom and the buttons were up against the  
> window border.
> On Wed, 5 Aug 2009 09:22:34 am Greg Brown wrote:
>> You might not see the effect padding has since you are using center
>> alignments. Try right or left (or top/bottom).
>> On Aug 4, 2009, at 6:43 PM, Scott Lanham wrote:
>>> I am playing with the Toggle Buttons part of the tutorial. After
>>> changes the
>>> WTKX file looks like:
>>> <Window title="Toggle Buttons" maximized="true"
>>>   xmlns:wtkx="http://pivot.apache.org/wtkx"
>>>   xmlns:content="org.apache.pivot.wtk.content"
>>>   xmlns="org.apache.pivot.wtk">
>>>   <content>
>>>       <BoxPane>
>>>           <styles padding="100" horizontalAlignment="center"
>>> verticalAlignment="center"/>
>>>           <PushButton toggleButton="true">
>>>               <buttonData>
>>>                   <content:ButtonData text="Anchor"
>>> icon="@clock.png"/>
>>>               </buttonData>
>>>           </PushButton>
>>>           <PushButton toggleButton="true">
>>>               <buttonData>
>>>                   <content:ButtonData text="Cup"/>
>>>               </buttonData>
>>>           </PushButton>
>>>           <PushButton toggleButton="true">
>>>               <buttonData>
>>>                   <content:ButtonData text="Star"/>
>>>               </buttonData>
>>>           </PushButton>
>>>       </BoxPane>
>>>   </content>
>>> </Window>
>>> Even with a padding of 100 it doesn't appear to do anything
>>> different from not
>>> having padding specified at all.
>>> And yes I do like to try and break code, it makes it more fun to
>>> learn that
>>> way :-)
>>> On Wed, 5 Aug 2009 08:36:10 am Todd Volkert wrote:
>>>>> Just a quick question, what does padding do? I change the values  
>>>>> and
>>>>> nothing
>>>>> appears to change.
>>>> To what component are you applying the padding style?  The
>>>> component's skin
>>>> defines what styles it supports, by virtue of providing bean
>>>> properties, so
>>>> note that there are some component's for which padding is not a
>>>> supported
>>>> style.  For containers that support it, it generally means that the
>>>> child
>>>> component(s) will be laid out inset from the container, and for
>>>> non-containers that support it (such as Label), it generally means
>>>> that
>>>> their content (such as a label's text) will be inset from the
>>>> boundaries of
>>>> the component.
>>>> -T

View raw message