Good catch.<div><br></div><div>Replaced by the more pythonic:</div><div><br></div><div><div> def _update_background_image(self, *args):</div><div> self._background_pixbuf = None</div><div> if BACKGROUND_IMAGE_PATH and os.path.exists(BACKGROUND_IMAGE_PATH):</div>
<div> try:</div><div><br></div><div>Gonzalo</div><div><br></div><div><br></div><br><div class="gmail_quote">On Fri, Mar 22, 2013 at 11:26 PM, Ajay Garg <span dir="ltr"><<a href="mailto:ajay@activitycentral.com" target="_blank">ajay@activitycentral.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Gonzalo.<br><br>Thanks for this awesome feature !!<br><br>Just one small issue :<br>I tried it on sugar-build, and sugar failed to start, because "BACKGROUND_IMAGE_PATH" was None.<br>
<br>Changing the method "_update_background_image" to<br>
<br> def _update_background_image(self, *args):<br> self._background_pixbuf = None<br><br> if BACKGROUND_IMAGE_PATH is None:<br> return<br><br> if os.path.exists(BACKGROUND_IMAGE_PATH):<br>
try:<br> self._background_pixbuf = GdkPixbuf.Pixbuf.new_from_file(<br> BACKGROUND_IMAGE_PATH)<br> self._favorites_eventbox.queue_draw()<br>
except:<br> pass<br><br><br><br>does the trick !!!<div class="HOEnZb"><div class="h5"><br><br><br><br><div class="gmail_quote">On Sat, Mar 23, 2013 at 2:22 AM, Gonzalo Odiard <span dir="ltr"><<a href="mailto:gonzalo@laptop.org" target="_blank">gonzalo@laptop.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is the way the draw is done in gtk. <div>The eventbox is not a Image where you load a image and then is draw when needed.</div>
<span><font color="#888888"><div><br></div></font></span><div><span><font color="#888888">Gonzalo </font></span><div><div><br><br><div class="gmail_quote">On Fri, Mar 22, 2013 at 5:42 PM, James Cameron <span dir="ltr"><<a href="mailto:quozl@laptop.org" target="_blank">quozl@laptop.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Not a blocking question: but why wait until the draw callback of the<br>
eventbox before calling cairo? Can this not be done in the widget<br>
creation?<br>
<br>
Reviewed-by: James Cameron <<a href="mailto:quozl@laptop.org" target="_blank">quozl@laptop.org</a>><br>
<span><font color="#888888"><br>
--<br>
James Cameron<br>
<a href="http://quozl.linux.org.au/" target="_blank">http://quozl.linux.org.au/</a><br>
_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org" target="_blank">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
</font></span></blockquote></div><br></div></div></div>
<br>_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org" target="_blank">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
<br></blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br><font face="arial, sans-serif">Regards,<br><br>Ajay Garg</font><br style="font-size:13px;font-family:arial,sans-serif">
<font face="arial, sans-serif">Dextrose Developer</font><br style="font-size:13px;font-family:arial,sans-serif">
<span style="font-size:13px;font-family:arial,sans-serif">Activity Central: </span><a href="http://activitycentral.com/" style="font-size:13px;font-family:arial,sans-serif" target="_blank">http://activitycentral.com</a>
</font></span></blockquote></div><br></div>