Open main menu
Home
Random
Log in
Settings
About Sugar Labs
Disclaimers
Sugar Labs
Search
Changes
← Older edit
Development Team/Almanac/sugar.activity.activity
(view source)
Revision as of 21:32, 23 February 2010
618 bytes added
,
21:32, 23 February 2010
m
moved
Walter is a wanker 12/Almanac/sugar.activity.activity
to
Development Team/Almanac/sugar.activity.activity
over redirect: revert
Line 215:
Line 215:
</pre>
</pre>
−
= Class: ActivityToolbox ([[
Sugar
.graphics.toolbox|Toolbox]])=
+
=== How do I know if my activity is being started from the Journal? ===
+
+
You can check handle.object_id in the constructor of your Activity class:
+
+
<pre>
+
from sugar.activity import activity
+
...
+
class AnnotateActivity(activity.Activity):
+
#### Method: __init__, initialize this AnnotateActivity instance
+
def __init__(self, handle):
+
...
+
if handle.object_id is None:
+
print "Activity is started anew (from the home view)"
+
else:
+
print "Activity is started from the journal and the object id is %s" % handle.object_id
+
...
+
</pre>
+
+
= Class: ActivityToolbox ([[
Development Team/Almanac/sugar
.graphics.toolbox|Toolbox]])=
=== What is the standard toolbox needed in most activities and how do I create it? ===
=== What is the standard toolbox needed in most activities and how do I create it? ===
Patrol
Bots
,
Bureaucrats
,
Administrators
123
edits