本文整理汇总了Python中gtk.STOCK_CLOSE属性的典型用法代码示例。如果您正苦于以下问题:Python gtk.STOCK_CLOSE属性的具体用法?Python gtk.STOCK_CLOSE怎么用?Python gtk.STOCK_CLOSE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类gtk
的用法示例。
在下文中一共展示了gtk.STOCK_CLOSE属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createTabLabel
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import STOCK_CLOSE [as 别名]
def createTabLabel(page, notebook):
label = gtk.Label(page.vwGetDisplayName())
if not page.vwIsClosable():
return label
box = gtk.HBox()
image = gtk.Image()
image.set_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_SMALL_TOOLBAR)
cbutton = gtk.Button()
cbutton.connect("clicked", closeTabButton, page, notebook)
cbutton.set_image(image)
cbutton.set_relief(gtk.RELIEF_NONE)
box.pack_start(label, True, True)
box.pack_end(cbutton, False, False)
box.show_all()
return box
示例2: update_button
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import STOCK_CLOSE [as 别名]
def update_button(self):
"""Update the state of our close button"""
if not self.config['close_button_on_tab']:
if self.button:
self.button.remove(self.icon)
self.remove(self.button)
del(self.button)
del(self.icon)
self.button = None
self.icon = None
return
if not self.button:
self.button = gtk.Button()
if not self.icon:
self.icon = gtk.Image()
self.icon.set_from_stock(gtk.STOCK_CLOSE,
gtk.ICON_SIZE_MENU)
self.button.set_focus_on_click(False)
self.button.set_relief(gtk.RELIEF_NONE)
style = gtk.RcStyle()
style.xthickness = 0
style.ythickness = 0
self.button.modify_style(style)
self.button.add(self.icon)
self.button.connect('clicked', self.on_close)
self.button.set_name('terminator-tab-close-button')
if hasattr(self.button, 'set_tooltip_text'):
self.button.set_tooltip_text(_('Close Tab'))
self.pack_start(self.button, False, False)
self.show_all()
示例3: __init__
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import STOCK_CLOSE [as 别名]
def __init__(self, visualizer, node_index, statistics_collector):
InformationWindow.__init__(self)
self.win = gtk.Dialog(parent=visualizer.window,
flags=gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_NO_SEPARATOR,
buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
self.win.connect("response", self._response_cb)
self.win.set_title("Statistics for node %i" % node_index)
self.visualizer = visualizer
self.statistics_collector = statistics_collector
self.node_index = node_index
self.viz_node = visualizer.get_node(node_index)
self.table_model = gtk.ListStore(*([str]*13))
treeview = gtk.TreeView(self.table_model)
treeview.show()
self.win.vbox.add(treeview)
def add_column(descr, colid):
column = gtk.TreeViewColumn(descr, gtk.CellRendererText(), text=colid)
treeview.append_column(column)
add_column("Interface", self.COLUMN_INTERFACE)
add_column("Tx Packets", self.COLUMN_TX_PACKETS)
add_column("Tx Bytes", self.COLUMN_TX_BYTES)
add_column("Tx pkt/1s", self.COLUMN_TX_PACKET_RATE)
add_column("Tx bit/1s", self.COLUMN_TX_BIT_RATE)
add_column("Rx Packets", self.COLUMN_RX_PACKETS)
add_column("Rx Bytes", self.COLUMN_RX_BYTES)
add_column("Rx pkt/1s", self.COLUMN_RX_PACKET_RATE)
add_column("Rx bit/1s", self.COLUMN_RX_BIT_RATE)
self.visualizer.add_information_window(self)
self.win.show()
示例4: finish
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import STOCK_CLOSE [as 别名]
def finish(self):
image = gtk.Image()
image.set_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_MENU)
self.widget2.set_image(image)
self.widget2.set_label("Close")
示例5: __init__
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import STOCK_CLOSE [as 别名]
def __init__(self, item_widget):
self._item_widget = item_widget
self._hbox = gtk.HBox(homogeneous=False)
self._hbox.set_spacing(self._HBOX_SPACING)
self._hbox_buttons = gtk.HBox(homogeneous=False)
self._hbox_buttons.set_spacing(self._HBOX_BUTTONS_SPACING)
self._event_box_buttons = gtk.EventBox()
self._event_box_buttons.add(self._hbox_buttons)
self._hbox.pack_start(self._item_widget, expand=True, fill=True)
self._hbox.pack_start(self._event_box_buttons, expand=False, fill=False)
self._event_box = gtk.EventBox()
self._event_box.add(self._hbox)
self._has_hbox_buttons_focus = False
self._button_remove = gtk.Button()
self._setup_item_button(self._button_remove, gtk.STOCK_CLOSE)
self._event_box.connect("enter-notify-event", self._on_event_box_enter_notify_event)
self._event_box.connect("leave-notify-event", self._on_event_box_leave_notify_event)
self._is_event_box_allocated_size = False
self._buttons_allocation = None
self._event_box.connect("size-allocate", self._on_event_box_size_allocate)
self._event_box_buttons.connect(
"size-allocate", self._on_event_box_buttons_size_allocate)
self._event_box.show_all()
self._hbox_buttons.set_no_show_all(True)
示例6: __init__
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import STOCK_CLOSE [as 别名]
def __init__(self):
"""Class initialiser"""
gtk.HBox.__init__(self)
self.__gobject_init__()
self.config = Config()
# Search text
self.entry = gtk.Entry()
self.entry.set_activates_default(True)
self.entry.show()
self.entry.connect('activate', self.do_search)
self.entry.connect('key-press-event', self.search_keypress)
# Label
label = gtk.Label(_('Search:'))
label.show()
# Result label
self.reslabel = gtk.Label('')
self.reslabel.show()
# Close Button
close = gtk.Button()
close.set_relief(gtk.RELIEF_NONE)
close.set_focus_on_click(False)
icon = gtk.Image()
icon.set_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_MENU)
close.add(icon)
close.set_name('terminator-search-close-button')
if hasattr(close, 'set_tooltip_text'):
close.set_tooltip_text(_('Close Search bar'))
close.connect('clicked', self.end_search)
close.show_all()
# Next Button
self.next = gtk.Button(_('Next'))
self.next.show()
self.next.set_sensitive(False)
self.next.connect('clicked', self.next_search)
# Previous Button
self.prev = gtk.Button(_('Prev'))
self.prev.show()
self.prev.set_sensitive(False)
self.prev.connect('clicked', self.prev_search)
self.pack_start(label, False)
self.pack_start(self.entry)
self.pack_start(self.reslabel, False)
self.pack_start(self.prev, False, False)
self.pack_start(self.next, False, False)
self.pack_end(close, False, False)
self.hide()
self.set_no_show_all(True)
示例7: construct_confirm_close
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import STOCK_CLOSE [as 别名]
def construct_confirm_close(self, window, reqtype):
"""Create a confirmation dialog for closing things"""
# skip this dialog if applicable
if self.config['suppress_multiple_term_dialog']:
return gtk.RESPONSE_ACCEPT
dialog = gtk.Dialog(_('Close?'), window, gtk.DIALOG_MODAL)
dialog.set_has_separator(False)
dialog.set_resizable(False)
dialog.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)
c_all = dialog.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_ACCEPT)
c_all.get_children()[0].get_children()[0].get_children()[1].set_label(
_('Close _Terminals'))
primary = gtk.Label(_('<big><b>Close multiple terminals?</b></big>'))
primary.set_use_markup(True)
primary.set_alignment(0, 0.5)
secondary = gtk.Label(_('This %s has several terminals open. Closing \
the %s will also close all terminals within it.') % (reqtype, reqtype))
secondary.set_line_wrap(True)
labels = gtk.VBox()
labels.pack_start(primary, False, False, 6)
labels.pack_start(secondary, False, False, 6)
image = gtk.image_new_from_stock(gtk.STOCK_DIALOG_WARNING,
gtk.ICON_SIZE_DIALOG)
image.set_alignment(0.5, 0)
box = gtk.HBox()
box.pack_start(image, False, False, 6)
box.pack_start(labels, False, False, 6)
dialog.vbox.pack_start(box, False, False, 12)
checkbox = gtk.CheckButton(_("Do not show this message next time"))
dialog.vbox.pack_end(checkbox)
dialog.show_all()
result = dialog.run()
# set configuration
self.config['suppress_multiple_term_dialog'] = checkbox.get_active()
self.config.save()
dialog.destroy()
return(result)
示例8: __init__
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import STOCK_CLOSE [as 别名]
def __init__(self, visualizer, node_index):
InformationWindow.__init__(self)
self.win = gtk.Dialog(parent=visualizer.window,
flags=gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_NO_SEPARATOR,
buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
self.win.set_default_size(gtk.gdk.screen_width()/2, gtk.gdk.screen_height()/2)
self.win.connect("response", self._response_cb)
self.win.set_title("OLSR routing table for node %i" % node_index)
self.visualizer = visualizer
self.node_index = node_index
self.table_model = gtk.ListStore(str, str, str, int)
treeview = gtk.TreeView(self.table_model)
treeview.show()
sw = gtk.ScrolledWindow()
sw.set_properties(hscrollbar_policy=gtk.POLICY_AUTOMATIC,
vscrollbar_policy=gtk.POLICY_AUTOMATIC)
sw.show()
sw.add(treeview)
self.win.vbox.add(sw)
# Dest.
column = gtk.TreeViewColumn('Destination', gtk.CellRendererText(),
text=self.COLUMN_DESTINATION)
treeview.append_column(column)
# Next hop
column = gtk.TreeViewColumn('Next hop', gtk.CellRendererText(),
text=self.COLUMN_NEXT_HOP)
treeview.append_column(column)
# Interface
column = gtk.TreeViewColumn('Interface', gtk.CellRendererText(),
text=self.COLUMN_INTERFACE)
treeview.append_column(column)
# Num. Hops
column = gtk.TreeViewColumn('Num. Hops', gtk.CellRendererText(),
text=self.COLUMN_NUM_HOPS)
treeview.append_column(column)
self.visualizer.add_information_window(self)
self.win.show()
示例9: __init__
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import STOCK_CLOSE [as 别名]
def __init__(self, visualizer, node_index):
InformationWindow.__init__(self)
self.win = gtk.Dialog(parent=visualizer.window,
flags=gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_NO_SEPARATOR,
buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
self.win.connect("response", self._response_cb)
self.win.set_title("IPv4 routing table for node %i" % node_index)
self.visualizer = visualizer
self.node_index = node_index
self.table_model = gtk.ListStore(str, str, str, str, int)
treeview = gtk.TreeView(self.table_model)
treeview.show()
sw = gtk.ScrolledWindow()
sw.set_properties(hscrollbar_policy=gtk.POLICY_AUTOMATIC,
vscrollbar_policy=gtk.POLICY_AUTOMATIC)
sw.show()
sw.add(treeview)
self.win.vbox.add(sw)
self.win.set_default_size(600, 300)
# Dest.
column = gtk.TreeViewColumn('Destination', gtk.CellRendererText(),
text=self.COLUMN_DESTINATION)
treeview.append_column(column)
# Next hop
column = gtk.TreeViewColumn('Next hop', gtk.CellRendererText(),
text=self.COLUMN_NEXT_HOP)
treeview.append_column(column)
# Interface
column = gtk.TreeViewColumn('Interface', gtk.CellRendererText(),
text=self.COLUMN_INTERFACE)
treeview.append_column(column)
# Type
column = gtk.TreeViewColumn('Type', gtk.CellRendererText(),
text=self.COLUMN_TYPE)
treeview.append_column(column)
# Prio
column = gtk.TreeViewColumn('Prio', gtk.CellRendererText(),
text=self.COLUMN_PRIO)
treeview.append_column(column)
self.visualizer.add_information_window(self)
self.win.show()
示例10: __init__
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import STOCK_CLOSE [as 别名]
def __init__(self, visualizer, node_index, statistics_collector):
"""
Initializer.
@param self this object
@param visualizer the visualizer object
@param node_index the node index
@param statistics_collector statistics collector class
"""
InformationWindow.__init__(self)
self.win = gtk.Dialog(parent=visualizer.window,
flags=gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_NO_SEPARATOR,
buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
self.win.connect("response", self._response_cb)
self.win.set_title("Statistics for node %i" % node_index)
self.visualizer = visualizer
self.statistics_collector = statistics_collector
self.node_index = node_index
self.viz_node = visualizer.get_node(node_index)
self.table_model = gtk.ListStore(*([str]*13))
treeview = gtk.TreeView(self.table_model)
treeview.show()
self.win.vbox.add(treeview)
def add_column(descr, colid):
column = gtk.TreeViewColumn(descr, gtk.CellRendererText(), text=colid)
treeview.append_column(column)
add_column("Interface", self.COLUMN_INTERFACE)
add_column("Tx Packets", self.COLUMN_TX_PACKETS)
add_column("Tx Bytes", self.COLUMN_TX_BYTES)
add_column("Tx pkt/1s", self.COLUMN_TX_PACKET_RATE)
add_column("Tx bit/1s", self.COLUMN_TX_BIT_RATE)
add_column("Rx Packets", self.COLUMN_RX_PACKETS)
add_column("Rx Bytes", self.COLUMN_RX_BYTES)
add_column("Rx pkt/1s", self.COLUMN_RX_PACKET_RATE)
add_column("Rx bit/1s", self.COLUMN_RX_BIT_RATE)
self.visualizer.add_information_window(self)
self.win.show()
示例11: __init__
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import STOCK_CLOSE [as 别名]
def __init__(self, visualizer, node_index):
"""!
Initializer
@param self this object
@param visualizer visualizer object
@param node_index the node index
@return none
"""
InformationWindow.__init__(self)
self.win = gtk.Dialog(parent=visualizer.window,
flags=gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_NO_SEPARATOR,
buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
self.win.set_default_size(gtk.gdk.screen_width()/2, gtk.gdk.screen_height()/2)
self.win.connect("response", self._response_cb)
self.win.set_title("OLSR routing table for node %i" % node_index)
self.visualizer = visualizer
self.node_index = node_index
self.table_model = gtk.ListStore(str, str, str, int)
treeview = gtk.TreeView(self.table_model)
treeview.show()
sw = gtk.ScrolledWindow()
sw.set_properties(hscrollbar_policy=gtk.POLICY_AUTOMATIC,
vscrollbar_policy=gtk.POLICY_AUTOMATIC)
sw.show()
sw.add(treeview)
self.win.vbox.add(sw)
# Dest.
column = gtk.TreeViewColumn('Destination', gtk.CellRendererText(),
text=self.COLUMN_DESTINATION)
treeview.append_column(column)
# Next hop
column = gtk.TreeViewColumn('Next hop', gtk.CellRendererText(),
text=self.COLUMN_NEXT_HOP)
treeview.append_column(column)
# Interface
column = gtk.TreeViewColumn('Interface', gtk.CellRendererText(),
text=self.COLUMN_INTERFACE)
treeview.append_column(column)
# Num. Hops
column = gtk.TreeViewColumn('Num. Hops', gtk.CellRendererText(),
text=self.COLUMN_NUM_HOPS)
treeview.append_column(column)
self.visualizer.add_information_window(self)
self.win.show()
示例12: __init__
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import STOCK_CLOSE [as 别名]
def __init__(self, visualizer, node_index):
"""
Initializer
@param self this object
@param visualizer visualizer object
@param node_index the node index
@return the statistics
"""
InformationWindow.__init__(self)
self.win = gtk.Dialog(parent=visualizer.window,
flags=gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_NO_SEPARATOR,
buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
self.win.connect("response", self._response_cb)
self.win.set_title("IPv4 routing table for node %i" % node_index)
self.visualizer = visualizer
self.node_index = node_index
self.table_model = gtk.ListStore(str, str, str, str, int)
treeview = gtk.TreeView(self.table_model)
treeview.show()
sw = gtk.ScrolledWindow()
sw.set_properties(hscrollbar_policy=gtk.POLICY_AUTOMATIC,
vscrollbar_policy=gtk.POLICY_AUTOMATIC)
sw.show()
sw.add(treeview)
self.win.vbox.add(sw)
self.win.set_default_size(600, 300)
# Dest.
column = gtk.TreeViewColumn('Destination', gtk.CellRendererText(),
text=self.COLUMN_DESTINATION)
treeview.append_column(column)
# Next hop
column = gtk.TreeViewColumn('Next hop', gtk.CellRendererText(),
text=self.COLUMN_NEXT_HOP)
treeview.append_column(column)
# Interface
column = gtk.TreeViewColumn('Interface', gtk.CellRendererText(),
text=self.COLUMN_INTERFACE)
treeview.append_column(column)
# Type
column = gtk.TreeViewColumn('Type', gtk.CellRendererText(),
text=self.COLUMN_TYPE)
treeview.append_column(column)
# Prio
column = gtk.TreeViewColumn('Prio', gtk.CellRendererText(),
text=self.COLUMN_PRIO)
treeview.append_column(column)
self.visualizer.add_information_window(self)
self.win.show()