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 15:27, 27 December 2010
24 bytes added
,
15:27, 27 December 2010
m
→The Sugar Object Chooser
Line 21:
Line 21:
# Clicking one of the displayed buttons calls the choose method
# Clicking one of the displayed buttons calls the choose method
−
def choose(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()
+
if result == gtk.RESPONSE_ACCEPT:
−
if result == gtk.RESPONSE_ACCEPT:
+
self.jobject = chooser.get_selected_object()
−
self.jobject = chooser.get_selected_object()
+
self.path = str(self.jobject.get_file_path())
−
self.path = str(self.jobject.get_file_path())
+
else:
−
else:
+
self.jobject = None
−
self.jobject = None
+
self.path1 = "0"
−
self.path1 = "0"
=== Random observations: ===
=== Random observations: ===
Walter
Bureaucrats
,
Administrators
10,579
edits