本文整理汇总了Python中gtk.RELIEF_NONE属性的典型用法代码示例。如果您正苦于以下问题:Python gtk.RELIEF_NONE属性的具体用法?Python gtk.RELIEF_NONE怎么用?Python gtk.RELIEF_NONE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类gtk
的用法示例。
在下文中一共展示了gtk.RELIEF_NONE属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createTabLabel
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import RELIEF_NONE [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: _init_gui
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import RELIEF_NONE [as 别名]
def _init_gui(self):
if self._add_operation_text is not None:
self._button_add = gtk.Button()
button_hbox = gtk.HBox()
button_hbox.set_spacing(self._ADD_BUTTON_HBOX_SPACING)
button_hbox.pack_start(
gtk.image_new_from_stock(gtk.STOCK_ADD, gtk.ICON_SIZE_MENU),
expand=False,
fill=False)
label_add = gtk.Label(self._add_operation_text.encode(pg.GTK_CHARACTER_ENCODING))
label_add.set_use_underline(True)
button_hbox.pack_start(label_add, expand=False, fill=False)
self._button_add.add(button_hbox)
else:
self._button_add = gtk.Button(stock=gtk.STOCK_ADD)
self._button_add.set_relief(gtk.RELIEF_NONE)
self._button_add.connect("clicked", self._on_button_add_clicked)
self._vbox.pack_start(self._button_add, expand=False, fill=False)
self._operations_menu = gtk.Menu()
self._init_operations_menu_popup()
示例3: update_button
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import RELIEF_NONE [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()
示例4: _setup_item_button
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import RELIEF_NONE [as 别名]
def _setup_item_button(self, item_button, icon, position=None):
item_button.set_relief(gtk.RELIEF_NONE)
button_icon = gtk.image_new_from_pixbuf(
item_button.render_icon(icon, gtk.ICON_SIZE_MENU))
item_button.add(button_icon)
self._hbox_buttons.pack_start(item_button, expand=False, fill=False)
if position is not None:
self._hbox_buttons.reorder_child(item_button, position)
item_button.show_all()
示例5: __init__
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import RELIEF_NONE [as 别名]
def __init__(self, text=None, **kwargs):
super().__init__(self, **kwargs)
self._label = gtk.Label(text)
self._label.set_alignment(0.0, 0.5)
self._label.show_all()
self._label.set_no_show_all(True)
self._button_edit = gtk.Button()
self._button_edit.set_relief(gtk.RELIEF_NONE)
self._button_edit_icon = gtk.image_new_from_pixbuf(
self._button_edit.render_icon(gtk.STOCK_EDIT, gtk.ICON_SIZE_MENU))
self._button_edit.add(self._button_edit_icon)
self._hbox = gtk.HBox(homogeneous=False)
self._hbox.set_spacing(self._LABEL_EDIT_BUTTON_SPACING)
self._hbox.pack_start(self._label, expand=True, fill=True)
self._hbox.pack_start(self._button_edit, expand=False, fill=False)
self._entry = gtk.Entry()
self._entry.show_all()
self._entry.set_no_show_all(True)
self._entry.hide()
self.pack_start(self._hbox, expand=False, fill=False)
self.pack_start(self._entry, expand=False, fill=False)
self._button_edit.connect("clicked", self._on_button_edit_clicked)
self._entry.connect("activate", self._on_entry_finished_editing)
self._entry.connect("focus-out-event", self._on_entry_finished_editing)
示例6: __init__
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import RELIEF_NONE [as 别名]
def __init__(self, title, owner_, widget_, popup_):
gtk.HBox.__init__(self, False, 0)
self.title = title
self.owner = owner_
self.eb = gtk.EventBox()
label = self.label = gtk.Label()
self.eb.connect('button-press-event', self.popupmenu, label)
label.set_alignment(0.0, 0.5)
label.set_text(title)
self.eb.add(label)
self.pack_start(self.eb)
label.show()
self.eb.show()
close_image = gtk.image_new_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_MENU)
image_w, image_h = gtk.icon_size_lookup(gtk.ICON_SIZE_MENU)
self.widget=widget_
self.popup = popup_
close_btn = gtk.Button()
close_btn.set_relief(gtk.RELIEF_NONE)
close_btn.connect('clicked', self.on_close_tab, owner_)
close_btn.set_size_request(image_w+7, image_h+6)
close_btn.add(close_image)
style = close_btn.get_style();
self.eb2 = gtk.EventBox()
self.eb2.add(close_btn)
self.pack_start(self.eb2, False, False)
self.eb2.show()
close_btn.show_all()
self.is_active = True
self.show()
示例7: __init__
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import RELIEF_NONE [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)
示例8: _init_gui
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import RELIEF_NONE [as 别名]
def _init_gui(self):
self._label_message = gtk.Label()
self._label_message.set_alignment(0.0, 0.5)
self._label_message.set_ellipsize(pango.ELLIPSIZE_END)
self._label_button_more = gtk.Label(_("_More"))
self._label_button_more.set_use_underline(True)
self._hbox_button_more = gtk.HBox()
self._hbox_button_more.set_spacing(self._MORE_BUTTON_LABEL_AND_ARROW_SPACING)
self._hbox_button_more.pack_start(
self._label_button_more, expand=True, fill=True)
self._hbox_button_more.pack_start(
gtk.Arrow(gtk.ARROW_DOWN, gtk.SHADOW_IN), expand=False, fill=False)
self._button_more = gtk.Button()
self._button_more.set_relief(gtk.RELIEF_NONE)
self._button_more.add(self._hbox_button_more)
self._button_more.show_all()
self._button_more.hide()
self._button_more.set_no_show_all(True)
self._text_view_more = gtk.TextView()
self._text_view_more.set_wrap_mode(gtk.WRAP_WORD)
self._text_view_more.set_left_margin(self._TEXT_VIEW_MARGIN)
self._text_view_more.set_right_margin(self._TEXT_VIEW_MARGIN)
self._text_view_more.set_editable(False)
self._scrolled_window_more = gtk.ScrolledWindow()
self._scrolled_window_more.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER)
self._scrolled_window_more.set_shadow_type(gtk.SHADOW_ETCHED_IN)
self._scrolled_window_more.add(self._text_view_more)
self._popup_more = gtk.Window(type=gtk.WINDOW_POPUP)
self._popup_more.set_resizable(False)
self._popup_more.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_TOOLTIP)
self._popup_more.set_property("width-request", self._POPUP_WIDTH)
self._popup_more.add(self._scrolled_window_more)
self._popup_more.show_all()
self._popup_more.hide()
self.set_spacing(self._MESSAGE_AND_MORE_BUTTON_SPACING)
self.pack_start(self._label_message, expand=True, fill=True)
self.pack_start(self._button_more, expand=False, fill=False)
示例9: _init_gui
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import RELIEF_NONE [as 别名]
def _init_gui(self):
self._button_menu = gtk.Button()
self._button_menu.set_relief(gtk.RELIEF_NONE)
self._button_menu.add(gtk.Arrow(gtk.ARROW_DOWN, gtk.SHADOW_IN))
self._menu_item_update_automatically = gtk.CheckMenuItem(
_("Update Preview Automatically"))
self._menu_item_update_automatically.set_active(True)
self._menu_settings = gtk.Menu()
self._menu_settings.append(self._menu_item_update_automatically)
self._menu_settings.show_all()
self._button_refresh = gtk.Button()
self._button_refresh.set_tooltip_text(_("Update Preview"))
self._button_refresh.set_relief(gtk.RELIEF_NONE)
self._button_refresh.add(gtk.image_new_from_pixbuf(
self._button_refresh.render_icon(gtk.STOCK_REFRESH, gtk.ICON_SIZE_MENU)))
self._button_refresh.show_all()
self._button_refresh.hide()
self._button_refresh.set_no_show_all(True)
self._hbox_buttons = gtk.HBox()
self._hbox_buttons.pack_start(self._button_menu, expand=False, fill=False)
self._hbox_buttons.pack_start(self._button_refresh, expand=False, fill=False)
self._preview_image = gtk.Image()
self._preview_image.set_no_show_all(True)
self._placeholder_image = gtk.Image()
self._placeholder_image.set_from_stock(
gtk.STOCK_DIALOG_QUESTION, gtk.ICON_SIZE_DIALOG)
self._placeholder_image.set_no_show_all(True)
self._label_layer_name = gtk.Label()
self._label_layer_name.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
self.set_spacing(self._WIDGET_SPACING)
self.set_border_width(self._BORDER_WIDTH)
self.pack_start(self._hbox_buttons, expand=False, fill=False)
self.pack_start(self._preview_image, expand=True, fill=True)
self.pack_start(self._placeholder_image, expand=True, fill=True)
self.pack_start(self._label_layer_name, expand=False, fill=False)
self._show_placeholder_image()