ya, but it is a background image and i think i need to set it from CSS
itself right? or, is there a way to set the background image from the
code... (Using DOM or something!!!)

On 6/13/09, Ian Bambury <ianbamb...@gmail.com> wrote:
>
> I don't think you can do it if you have to have the image name in the css
> file.
>
> I was suggesting setting the image name directly in the GWT code.
>
> Ian
>
> http://examples.roughian.com
>
>
> 2009/6/13 abhiram wuntakal <abhir...@gmail.com>
>
>> Hi Ian,
>>
>>   Thanks for the suggestion. But i am not sure, how to set the Imagename
>> (which is part of the CSS ) from my Java code.
>> Can i pass parameters to the CSS file?
>>
>> regards,
>> Abhiram
>>
>>
>> On Sat, Jun 13, 2009 at 4:54 PM, Ian Bambury <ianbamb...@gmail.com>wrote:
>>
>>> Why don't you just name the image after the widget (e.g.SaveButton has a
>>> background image of 'SaveButton.png') and have a routine to set the
>>> background image to the name of the widget plus '.png'?
>>> Ian
>>>
>>> http://examples.roughian.com
>>>
>>>
>>> 2009/6/13 abhiram wuntakal <abhir...@gmail.com>
>>>
>>> ok, i will elaborate a bit...
>>>>
>>>> there are 2 buttons, save Button1 and Button2. Button1 needs an image
>>>> Image1 and Button2 needs Image2.
>>>>
>>>> The styles of both the buttons are same except for the images that
>>>> appear on them.
>>>>
>>>>  I am writing two styles Style1 with the background-image as Image1 for
>>>> the Button1.
>>>> And the other Style2 with the background-image as Image2 for the
>>>> Button2.
>>>>
>>>> Cant I not write a single style for both the buttons and some code to
>>>> indicate which image would be used for the button (dynamically).
>>>>
>>>>  That would save me the task of creating multiple styles for all the
>>>> buttons that I have.
>>>>
>>>>  Please let me know if there is any such functionality available...
>>>>
>>>> regards,
>>>> Abhiram
>>>>
>>>>
>>>> On Sat, Jun 13, 2009 at 11:51 AM, Booth Martin <bo...@hiapes.com>wrote:
>>>>
>>>>> I do not understand why you cannot just .setStyleName(Style1) on each
>>>>> widget to have that image?  Why would they need to be different for each
>>>>> widget?
>>>>>
>>>>> abhiram wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>>   I have a requirement where in I need to add image icons for widgets
>>>>> like buttons and menu items. I am using a CSS style for this wherein I
>>>>> specify the background image this way.
>>>>>
>>>>>  .Style1 {
>>>>>        background: url(Image1.gif) no-repeat;
>>>>>        text-align: right;
>>>>> }
>>>>>
>>>>>  This works fine, but was wondering if there is a better way of doing
>>>>> it. Coz, in this approach I need to create a new Style for each and
>>>>> every widget. Although the background for all the widgets are same,
>>>>> there are multiple css styles created because of this approach. Can
>>>>> anyone tell me if there is a more optimal method of doing this.
>>>>>
>>>>> Regards,
>>>>> Abhiram
>>>>>
>>>>>
>>>>> ------------------------------
>>>>>
>>>>>
>>>>> No virus found in this incoming message.
>>>>> Checked by AVG - www.avg.com
>>>>> Version: 8.5.339 / Virus Database: 270.12.66/2172 - Release Date: 
>>>>> 06/12/09 17:56:00
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> ===============================================================
>>>>> LoChief,
>>>>> ===============================================================
>>>>>
>>>>>     _   _ _    _
>>>>>    | | | (_)  / \   _ __   ___  ___   ___ ___  _ __ ___
>>>>>    | |_| | | / _ \ | '_ \ / _ \/ __| / __/ _ \| '_ ` _ \
>>>>>    |  _  | |/ ___ \| |_) |  __/\__ \| (_| (_) | | | | | |
>>>>>    |_| |_|_/_/   \_\ .__/ \___||___(_)___\___/|_| |_| |_|
>>>>>                    |_|
>>>>> ==============================================================
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to