diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2006-05-18 05:17:40 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2006-05-18 05:17:40 (GMT) |
commit | 3f624fdcf7e0b1c89ea8f78ac8c41cf961791f46 (patch) | |
tree | 3cbe340b7c7c456dec03999de9aace6220e25955 /examples | |
parent | e31583daad7dd8f210c3102a631dca87ddf99de3 (diff) |
Add a sample activity. Too bad gmail crashes the
Diffstat (limited to 'examples')
-rw-r--r-- | examples/README | 2 | ||||
-rw-r--r-- | examples/gmail.activity | 2 | ||||
-rwxr-xr-x | examples/gmail.py | 33 |
3 files changed, 37 insertions, 0 deletions
diff --git a/examples/README b/examples/README new file mode 100644 index 0000000..84c1a16 --- /dev/null +++ b/examples/README @@ -0,0 +1,2 @@ +Just drop gmail.py and gmail.activity inside ~/.sugar/activities +Then run sugar as usual. diff --git a/examples/gmail.activity b/examples/gmail.activity new file mode 100644 index 0000000..2a58912 --- /dev/null +++ b/examples/gmail.activity @@ -0,0 +1,2 @@ +[Activity] +python_class = gmail diff --git a/examples/gmail.py b/examples/gmail.py new file mode 100755 index 0000000..b1d6b7b --- /dev/null +++ b/examples/gmail.py @@ -0,0 +1,33 @@ +import pygtk +pygtk.require('2.0') +import gtk +import geckoembed + +from sugar.shell import activity + +class GMailActivity(activity.Activity): + def __init__(self): + activity.Activity.__init__(self) + + def activity_on_connected_to_shell(self): + self.activity_set_tab_text("Mail") + self.activity_set_tab_icon_name("stock_mail") + self.activity_show_icon(True) + + plug = self.activity_get_gtk_plug() + + embed = geckoembed.Embed() + plug.add(embed) + embed.show() + + plug.show() + + embed.load_address("http://www.gmail.com") + + def activity_on_disconnected_from_shell(self): + gtk.main_quit() + +activity = GMailActivity() +activity.activity_connect_to_shell() + +gtk.main() |