Open main menu
Home
Random
Log in
Settings
About Sugar Labs
Disclaimers
Sugar Labs
Search
Changes
← Older edit
Newer edit →
Activity Team/Object Chooser
(view source)
Revision as of 09:59, 22 December 2010
No change in size
,
09:59, 22 December 2010
→The Sugar Object Chooser
Line 6:
Line 6:
from sugar import mime
from sugar import mime
−
self.path = ""
+
self.path = "
0
"
self.jobject = None
self.jobject = None
Line 15:
Line 15:
except ImportError:
except ImportError:
version = [0, 82]
version = [0, 82]
+
if version >= [0, 84]:
if version >= [0, 84]:
# Insert here code relevant to Sugar 0.84 and higher
# Insert here code relevant to Sugar 0.84 and higher
# I use this to only display Object Chooser callback buttons only for >= 0.84
# I use this to only display Object Chooser callback buttons only for >= 0.84
−
# Clicking one of the displayed buttons calls the
choose1
method
+
# Clicking one of the displayed buttons calls the
choose
method
−
def
choose1
(self, widget):
+
def
choose
(self, widget):
chooser = ObjectChooser(parent=self, what_filter=mime.GENERIC_TYPE_AUDIO)
chooser = ObjectChooser(parent=self, what_filter=mime.GENERIC_TYPE_AUDIO)
result = chooser.run()
result = chooser.run()
Walter
Bureaucrats
,
Administrators
10,579
edits