def __init__(self, parent):
Gtk.Dialog.__init__(self, "File Dialog", parent, 0,
(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
Gtk.STOCK_OK, Gtk.ResponseType.OK))
self.set_default_size(500, 550)
box = self.get_content_area()
self.verticalbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=3)
box.add(self.verticalbox)
self.clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
from_file = Gtk.Button("From File")
from_file.connect("clicked", self.on_file)
from_clipboard = Gtk.Button("Clipboard")
from_clipboard.connect("clicked", self.on_clipboard)
hbox1 = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, homogeneous=True)
hbox1.pack_start(from_file, True, True, 0)
hbox1.pack_start(from_clipboard, True, True, 0)
self.verticalbox.pack_start(hbox1, False, False, 0)
# Just holding the Place for real treeview widget
self.scrollable_treelist = Gtk.Label()
self.verticalbox.pack_start(self.scrollable_treelist, True, True, 0)
self.show_all()
评论列表
文章目录