Sorry.&nbsp; I&#39;ve cleaned up the code.&nbsp; <br><br>I am wondering why I can&#39;t get back a gtk.Image displaying &quot;hi&quot; when todisk=False on an xo, but can get the &quot;hi&quot; image with todisk=False when in sugar-jhbuild on fedora. (If todisk=True on either platform, I get back the intended Image).
<br><br>Hope that clarifies my confusion some :-)<br><br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp; def createCountdownPng( self ):</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;todisk = True
</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;w = 55</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;h = w</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if (todisk):</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;cimg = cairo.ImageSurface(cairo.FORMAT_ARGB32, w, h)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx = 
cairo.Context(cimg)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pixmap = gtk.gdk.Pixmap(None, w, h, 24)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx = pixmap.cairo_create()</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx.rectangle(0, 0, w, h)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx.set_source_rgb(0, 0, 0)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx.fill()</span><span style="font-family: courier new,monospace;"></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pctx = pangocairo.CairoContext(ctx)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;play = pctx.create_layout()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;font = pango.FontDescription(&quot;sans 30&quot;)</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;play.set_font_description(font)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;play.set_text( &quot;hi&quot; )
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;dim = play.get_pixel_extents()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx.translate( -dim[0][0], -dim[0][1] )</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;xoff = (w-dim[0][2])/2</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;yoff = (h-dim[0][3])/2</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx.translate( xoff, yoff )
</span> <span style="font-family: courier new,monospace;"></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pctx.show_layout(play)</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;img = gtk.Image()</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if (todisk):</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;path = os.path.join(&quot;tmp&quot;, &quot;
hi.png&quot;)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: courier new,monospace;">cimg.dto_png(path)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;numPixbuf = gtk.gdk.pixbuf_new_from_file(path)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;
img.set_from_pixbuf( numPixbuf )</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;img.set_from_pixmap(pixmap, None)</span></blockquote><div><br>&nbsp;</div><br></div><br>