Như với bất kỳ đối tượng Python nào, bạn có thể tìm hiểu rất nhiều về nó bằng cách sử dụng phương thức dir () trên nó. Điều này sẽ cung cấp cho bạn một nơi tốt để bắt đầu.
You can access the main window through the 'shell' variable :
<rb.Shell object at 0x9e9675c (RBShell at 0x987b018)>
>>> dir(rb.Shell)
['__class__', '__cmp__', '__copy__', '__deepcopy__', '__delattr__', '__dict__',
'__doc__', '__format__', '__gdoc__', '__getattribute__', '__gobject_init__',
'__grefcount__', '__gtype__', '__hash__', '__init__', '__module__', '__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__',
'__subclasshook__', 'add_to_queue', 'add_uri', 'add_widget', 'append_source',
'chain', 'connect', 'connect_after', 'connect_object', 'connect_object_after',
'disconnect', 'disconnect_by_func', 'do_notify', 'emit', 'emit_stop_by_name',
'freeze_notify', 'get_data', 'get_party_mode', 'get_player',
'get_playlist_manager', 'get_properties', 'get_property',
'get_source_by_entry_type', 'get_ui_manager', 'guess_source_for_uri',
'handler_block', 'handler_block_by_func', 'handler_disconnect',
'handler_is_connected','handler_unblock', 'handler_unblock_by_func', 'load_uri',
'notebook_set_page', 'notify', 'notify_custom', 'present', 'props',
'register_entry_type_for_source', 'remove_from_queue', 'remove_widget',
'set_data', 'set_properties', 'set_property', 'stop_emission', 'thaw_notify',
'toggle_visibility', 'weak_ref']
Sau đó, bạn có thể dir () bất kỳ thuộc tính trông thú vị nào, như 'get_player', có lẽ.
Một nơi tốt khác để tìm là nếu bạn thấy một thuộc tính __doc__ trên đối tượng.
>>> print rb.Shell.__doc__
Object RBShell
Signals from RBShell:
visibility-changed (gboolean)
visibility-changing (gboolean, gboolean) -> gboolean
create-song-info (RBSongInfo, gboolean)
removable-media-scan-finished ()
notify-playing-entry (gboolean)
notify-custom (guint, gchararray, gchararray, GdkPixbuf, gboolean)
Properties from RBShell:
no-registration -> gboolean: no-registration
Whether or not to register
no-update -> gboolean: no-update
Whether or not to update the library
dry-run -> gboolean: dry-run
Whether or not this is a dry run
rhythmdb-file -> gchararray: rhythmdb-file
The RhythmDB file to use
playlists-file -> gchararray: playlists-file
The playlists file to use
selected-source -> RBSource: selected-source
Source which is currently selected
db -> RhythmDB: RhythmDB
RhythmDB object
ui-manager -> GtkUIManager: GtkUIManager
GtkUIManager object
clipboard -> RBShellClipboard: RBShellClipboard
RBShellClipboard object
playlist-manager -> RBPlaylistManager: RBPlaylistManager
RBPlaylistManager object
removable-media-manager -> RBRemovableMediaManager: RBRemovableMediaManager
RBRemovableMediaManager object
shell-player -> RBShellPlayer: RBShellPlayer
RBShellPlayer object
window -> GtkWindow: GtkWindow
GtkWindow object
prefs -> RBShellPreferences: RBShellPreferences
RBShellPreferences object
queue-source -> RBPlayQueueSource: queue-source
Queue source
library-source -> RBLibrarySource: library-source
Library source
sourcelist-model -> RBSourceListModel: sourcelist-model
RBSourcelistModel
sourcelist -> RBSourceList: sourcelist
RBSourcelist
source-header -> RBSourceHeader: source header widget
RBSourceHeader
visibility -> gboolean: visibility
Current window visibility
Signals from GObject:
notify (GParam)