With more tests, I got the following:

within my Xul:
                <scrollbox id="scrollboxID" class="AppBar" flex="2">
                        <appicon id="icon1" image="images/tv.png"/>
                        <appicon id="icon2" image="images/youtube.png"/>
                        <appicon id="icon3"
image="images/Weather_changes.gif"/>
                        <appicon id="icon4" image="images/twitter.png"/>
                        <appicon id="icon5" image="images/maps.png"/>
                        <appicon id="icon6" image="images/pacman.png"/>
                        <appicon id="icon7" image="images/tv.png"/>
                        <appicon id="icon8" image="images/youtube.png"/>
                        <appicon id="icon9"
image="images/Weather_changes.gif"/>
                        <appicon id="icon10" image="images/twitter.png"/>
                        <appicon id="icon11" image="images/maps.png"/>
                        <appicon id="icon12" image="images/pacman.png"/>
                </scrollbox>

and within the binder it's inheriting the id and image:

<content>
<xul:button xbl:inherits="id,image" />
 </content>

but within the handler it says that:

getElementById('icon1').image


does not exist (null), but the images are showing well..  and

getElementById('icon1').style.width


prints nothing..


*
Wellington B. de Carvalho
*


On Mon, Sep 27, 2010 at 12:37 PM, Tom Brito <[email protected]> wrote:

> Hi, thanks for answering!
>
> As the event occurs inside the button binding, it looks to have no
> anonymous nodes,
> I asked it for printing:
>
> *(document.getAnonymousNodes(this)[0].style.width == true)*
>
> and it prints *false*, so looks like it is not the scroll I'm dealing
> with. And it's not a button either, I don't know what "this" object is.
>
>
> *
> Wellington B. de Carvalho
> *
>
>
>
> On Mon, Sep 27, 2010 at 12:22 PM, Evgeny <[email protected]> wrote:
>
>> Hi
>> It doesn't know what 'image' is in that context.
>> Actually after inheritance, you have a button with attribute 'image' which
>> gets value from 'img' attribute if element.
>> You can get xul:button element via
>> document.getAnonymousNodes(this)[0]
>> so, you write something like
>> document.getAnonymousNodes(this)[0].style.width ='128px';
>> document.getAnonymousNodes(this)[0].style.height ='128px';
>>
>> And if you change elements order (now you have only one element) you
>> should change indexes or get your button with childNodes
>> https://developer.mozilla.org/en/XUL_Tutorial%3aXBL_Example
>>
>> On Mon, Sep 27, 2010 at 6:53 PM, Tom Brito <[email protected]> wrote:
>>
>>> Hello folks,
>>>
>>> I have a Xul app that have buttons with images, and I want the images to
>>> grow when the button is focused.
>>>
>>> If I do it in a css file, it works nice:
>>>
>>> button:focus image {
>>>
>>>
>>>
>>>
>>>
>>>     width: 128px;
>>>
>>>
>>>
>>>
>>>
>>>     height: 128px;
>>>
>>>
>>>
>>>
>>> }
>>>
>>>
>>>
>>>
>>>  but if I try it in javascript, within my binder, it doesn't work:
>>>
>>> <binding id="appicon_bind">
>>>
>>>
>>>
>>>
>>>
>>>     <content>
>>>
>>>
>>>
>>>
>>>
>>>         <xul:button xbl:inherits="image=img" />
>>>
>>>
>>>
>>>
>>>
>>>     </content>
>>>
>>>
>>>
>>>
>>>
>>>     <handlers>
>>>
>>>
>>>
>>>
>>>
>>>         <handler event="focus">
>>>
>>>
>>>
>>>
>>>
>>>             <![CDATA[
>>>                 image.style.width='128px';
>>>                 image.style.height='128px';
>>>             ]]>
>>>         </handler>
>>>
>>>
>>>
>>>
>>>
>>>     </handlers>
>>>
>>>
>>>
>>>
>>> </binding>
>>>
>>>
>>>
>>>
>>>  Why it says *"image is not defined"*? Isn't this focus event occurring
>>> within the button object?
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Start uncovering the many advantages of virtual appliances
>>> and start using them to simplify application deployment and
>>> accelerate your shift to cloud computing.
>>> http://p.sf.net/sfu/novell-sfdev2dev
>>> _______________________________________________
>>> XUL News Wire      - http://xulnews.com
>>> XUL Job Postings   - http://xuljobs.com
>>> Open XUL Alliance - http://xulalliance.org
>>> _______________________________________________
>>> xul-talk mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/xul-talk
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Start uncovering the many advantages of virtual appliances
>> and start using them to simplify application deployment and
>> accelerate your shift to cloud computing.
>> http://p.sf.net/sfu/novell-sfdev2dev
>> _______________________________________________
>> XUL News Wire      - http://xulnews.com
>> XUL Job Postings   - http://xuljobs.com
>> Open XUL Alliance - http://xulalliance.org
>> _______________________________________________
>> xul-talk mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/xul-talk
>>
>>
>
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
XUL News Wire      - http://xulnews.com
XUL Job Postings   - http://xuljobs.com
Open XUL Alliance - http://xulalliance.org  
_______________________________________________
xul-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xul-talk

Reply via email to