Development Team/Low-level Activity API: Difference between revisions
m moved Walter is a wanker 12/Low-level Activity API to Development Team/Low-level Activity API over redirect: revert |
→Choosing Objects: warn about 0.82 usage |
||
| Line 237: | Line 237: | ||
===Choosing Objects=== | ===Choosing Objects=== | ||
Call this method to bring up the Chooser dialog (which looks like a small journal overlayed on your activity): | Call this method to bring up the Chooser dialog (which looks like a small journal overlayed on your activity): | ||
chooser_id = org.laptop.Journal.ChooseObject(xid, what_filter) | chooser_id = org.laptop.Journal.ChooseObject(xid, what_filter) # only xid arg supported in Sugar 0.82! | ||
The xid should be your activity's X window handle, or <tt>0</tt>. The filter says what type of Journal entries is preselected in the drop-down menu (''this parameter was added in Sugar 0.83''). It's a string containing either a bundle id (e.g., <tt>'my.organization.MyActivity'</tt>), or one of the generic data types (<tt>'Text', 'Image', 'Video', 'Audio', 'Link'</tt> [http://git.sugarlabs.org/projects/sugar-base/repos/mainline/blobs/master/src/sugar/mime.py#line32 definition]), or an empty string for no filter. The call returns immediately with a string chooser_id. You need to watch these signals which get emitted when an item is chosen or the dialog is canceled: | The xid should be your activity's X window handle, or <tt>0</tt>. The filter says what type of Journal entries is preselected in the drop-down menu (''this parameter was added in Sugar 0.83''). It's a string containing either a bundle id (e.g., <tt>'my.organization.MyActivity'</tt>), or one of the generic data types (<tt>'Text', 'Image', 'Video', 'Audio', 'Link'</tt> [http://git.sugarlabs.org/projects/sugar-base/repos/mainline/blobs/master/src/sugar/mime.py#line32 definition]), or an empty string for no filter. The call returns immediately with a string chooser_id. You need to watch these signals which get emitted when an item is chosen or the dialog is canceled: | ||
ObjectChooserResponse(chooser_id, object_id) | ObjectChooserResponse(chooser_id, object_id) | ||