您的位置:首页 > 移动开发 > Objective-C

PyGobject(三十九)布局容器之PlacesSidebar

2016-07-29 17:30 411 查看
GtkPlacesSidebar
继承关系

Methods

Virtual Methods

Properties

Signals

例子

Gtk.PlacesSidebar

Gtk.PlacesSidebar是一个部件。用来显示位于文件系统中的如用户的主目录,用户的书签,和卷和驱动器等。这个widget用作Gtk.FileChooser一个工具,并且可以通过文件管理器和类似的程序中使用

继承关系

Gtk.PlacesSidebar是Gtk.ScrolledWindow的直接子类



Methods

方法修饰词方法名及参数
staticnew ()
add_shortcut (location)
get_local_only ()
get_location ()
get_nth_bookmark (n)
get_open_flags ()
get_show_connect_to_server ()
get_show_desktop ()
get_show_enter_location ()
get_show_other_locations ()
get_show_recent ()
get_show_trash ()
list_shortcuts ()
remove_shortcut (location)
set_drop_targets_visible (visible, context)
set_local_only (local_only)
set_location (location)
set_open_flags (flags)
set_show_connect_to_server (show_connect_to_server)
set_show_desktop (show_desktop)
set_show_enter_location (show_enter_location)
set_show_other_locations (show_other_locations)
set_show_recent (show_recent)
set_show_trash (show_trash)

Virtual Methods

Properties

NameTypeFlagsShort Description
local-onlyboolr/wWhether the sidebar only includes local files
locationGio.Filer/wThe location to highlight in the sidebar
open-flagsGtk.PlacesOpenFlagsr/wModes in which the calling application can open locations selected in the sidebar
populate-allboolr/wWhether to emit ::populate-popup for popups that are not menus
show-connect-to-serverboold/r/wWhether the sidebar includes a builtin shortcut to a ‘Connect to server’ dialog deprecated
show-desktopboolr/wWhether the sidebar includes a builtin shortcut to the Desktop folder
show-enter-locationboolr/wWhether the sidebar includes a builtin shortcut to manually enter a location
show-other-locationsboolr/wWhether the sidebar includes an item to show external locations
show-recentboolr/wWhether the sidebar includes a builtin shortcut for recent files
show-trashboolr/wWhether the sidebar includes a builtin shortcut to the Trash location

Signals

NameShort Description
drag-action-askThe places sidebar emits this signal when it needs to ask the application to pop up a menu to ask the user for which drag action to perform.
drag-action-requestedWhen the user starts a drag-and-drop operation and the sidebar needs to ask the application for which drag action to perform, then the sidebar will emit this signal.
drag-perform-dropThe places sidebar emits this signal when the user completes a drag-and-drop operation and one of the sidebar’s items is the destination.
mountThe places sidebar emits this signal when it starts a new operation because the user clicked on some location that needs mounting.
open-locationThe places sidebar emits this signal when the user selects a location in it.
populate-popupThe places sidebar emits this signal when the user invokes a contextual popup on one of its items.
show-connect-to-serverThe places sidebar emits this signal when it needs the calling application to present an way to connect directly to a network server. deprecated
show-enter-locationThe places sidebar emits this signal when it needs the calling application to present an way to directly enter a location.
show-error-messageThe places sidebar emits this signal when it needs the calling application to present an error message.
show-other-locationsThe places sidebar emits this signal when it needs the calling application to present a way to show other locations e.g. deprecated
show-other-locations-with-flagsThe places sidebar emits this signal when it needs the calling application to present a way to show other locations e.g.
unmountThe places sidebar emits this signal when it starts a new operation because the user for example ejected some drive or unmounted a mount.

例子



代码:

#!/usr/bin/env python3
# Created by xiaosanyu at 16/7/11
# section 056
#
# author: xiaosanyu
# website: yuxiaosan.tk \
#          http://blog.csdn.net/a87b01c14 # created: 16/7/11

TITLE = "PlacesSidebar"
DESCRIPTION = """
Gtk.PlacesSidebar is a widget that displays a list of frequently-used places in the file system:
the user’s home directory, the user’s bookmarks, and volumes and drives.
This widget is used as a sidebar in Gtk.FileChooser and may be used by file managers and similar programs
"""

import gi

gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

class PlacesSidebarWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="PlacesSidebar Demo")
self.set_size_request(200, 200)
widget = Gtk.PlacesSidebar()
widget.props.show_enter_location = True
widget.props.show_other_locations = True
widget.props.populate_all = True
self.add(widget)

def main():
win = PlacesSidebarWindow()
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()

if __name__ == "__main__":
main()


代码解析

代码下载地址:http://download.csdn.net/detail/a87b01c14/9594728
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息