[Sugar-devel] Features: Background image in Home View

Gonzalo Odiard gonzalo at laptop.org
Mon Mar 25 06:26:04 EDT 2013


Good catch.

Replaced by the more pythonic:

    def _update_background_image(self, *args):
        self._background_pixbuf = None
        if BACKGROUND_IMAGE_PATH and os.path.exists(BACKGROUND_IMAGE_PATH):
            try:

Gonzalo



On Fri, Mar 22, 2013 at 11:26 PM, Ajay Garg <ajay at activitycentral.com>wrote:

> Hi Gonzalo.
>
> Thanks for this awesome feature !!
>
> Just one small issue  :
> I tried it on sugar-build, and sugar failed to start, because
> "BACKGROUND_IMAGE_PATH" was None.
>
> Changing the method "_update_background_image" to
>
>     def _update_background_image(self, *args):
>         self._background_pixbuf = None
>
>         if BACKGROUND_IMAGE_PATH is None:
>             return
>
>         if os.path.exists(BACKGROUND_IMAGE_PATH):
>             try:
>                 self._background_pixbuf = GdkPixbuf.Pixbuf.new_from_file(
>
> BACKGROUND_IMAGE_PATH)
>                 self._favorites_eventbox.queue_draw()
>             except:
>                 pass
>
>
>
> does the trick !!!
>
>
>
>
> On Sat, Mar 23, 2013 at 2:22 AM, Gonzalo Odiard <gonzalo at laptop.org>wrote:
>
>> Is the way the draw is done in gtk.
>> The eventbox is not a Image where you load a image and then is draw when
>> needed.
>>
>> Gonzalo
>>
>>
>> On Fri, Mar 22, 2013 at 5:42 PM, James Cameron <quozl at laptop.org> wrote:
>>
>>> Not a blocking question: but why wait until the draw callback of the
>>> eventbox before calling cairo?  Can this not be done in the widget
>>> creation?
>>>
>>> Reviewed-by: James Cameron <quozl at laptop.org>
>>>
>>> --
>>> James Cameron
>>> http://quozl.linux.org.au/
>>> _______________________________________________
>>> Sugar-devel mailing list
>>> Sugar-devel at lists.sugarlabs.org
>>> http://lists.sugarlabs.org/listinfo/sugar-devel
>>>
>>
>>
>> _______________________________________________
>> Sugar-devel mailing list
>> Sugar-devel at lists.sugarlabs.org
>> http://lists.sugarlabs.org/listinfo/sugar-devel
>>
>>
>
>
> --
> Regards,
>
> Ajay Garg
> Dextrose Developer
> Activity Central: http://activitycentral.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130325/9c5e5b90/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-a-section-in-the-control-panel-to-configure-the-.patch
Type: application/octet-stream
Size: 15102 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130325/9c5e5b90/attachment-0001.obj>


More information about the Sugar-devel mailing list