<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: foreground code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sat, 26 Jul 2008 05:37:44 GMT</pubDate>
    <description>DZone Snippets: foreground code</description>
    <item>
      <title>Using foreground image</title>
      <link>http://snippets.dzone.com/posts/show/839</link>
      <description>You can draw directly to the phone screen.&lt;br /&gt;It is useful for a notification from a background program.&lt;br /&gt;You need to install fgimage.pyd from &lt;a href=http://pymbian.sourceforge.net/misc/fgimage-v0.20051022.zip&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;import fgimage, e32&lt;br /&gt;&lt;br /&gt;img = Image.new((100, 16))  # create a notification text&lt;br /&gt;img.text((0, 14), u'Hello world', 0)&lt;br /&gt;&lt;br /&gt;fg = fgimage.FGImage()&lt;br /&gt;x, y = 0, 40           # position to draw&lt;br /&gt;fg.set(x, y, img._bitmapapi())  # send it&lt;br /&gt;&lt;br /&gt;e32.ao_sleep(1)&lt;br /&gt;fg.unset()                # then clear it&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;See (a bit) more discussion &lt;a href=http://discussion.forum.nokia.com/forum/showthread.php?t=68866&gt;here&lt;/a&gt;.</description>
      <pubDate>Mon, 31 Oct 2005 00:26:37 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/839</guid>
      <author>korakot (Korakot Chaovavanich)</author>
    </item>
    <item>
      <title>Switch application to foreground in pys60</title>
      <link>http://snippets.dzone.com/posts/show/814</link>
      <description>Taken from the 'appswitch' module &lt;a href=http://pymbian.sourceforge.net/misc/appswitch-v0.20051019.zip&gt;here&lt;/a&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;import appswitch&lt;br /&gt;print appswitch.switch_to_fg(u"Menu")&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Updated (19 Oct 05)&lt;br /&gt;==================&lt;br /&gt;Now it can&lt;br /&gt;- listing running applications&lt;br /&gt;- switching them to foreground/background&lt;br /&gt;- closing/killing apps&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# listing&lt;br /&gt;apps = appswitch.application_list(True) # true = include all&lt;br /&gt;                                       # false = no hidden apps &lt;br /&gt;print apps&lt;br /&gt;&lt;br /&gt;# to background and closing&lt;br /&gt;print appswitch.switch_to_bg(u"TODO")&lt;br /&gt;print appswitch.end_app(u"TODO")&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Mon, 17 Oct 2005 21:06:29 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/814</guid>
      <author>korakot (Korakot Chaovavanich)</author>
    </item>
  </channel>
</rss>
