本文整理汇总了Python中kano.gtk3.buttons.OrangeButton.set_margin_left方法的典型用法代码示例。如果您正苦于以下问题:Python OrangeButton.set_margin_left方法的具体用法?Python OrangeButton.set_margin_left怎么用?Python OrangeButton.set_margin_left使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kano.gtk3.buttons.OrangeButton
的用法示例。
在下文中一共展示了OrangeButton.set_margin_left方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from kano.gtk3.buttons import OrangeButton [as 别名]
# 或者: from kano.gtk3.buttons.OrangeButton import set_margin_left [as 别名]
def __init__(self, win, char_creator):
Gtk.EventBox.__init__(self)
self._win = win
# Should this be inherited, passed as a variable, or global?
# Could be a member variable in window.
# self.char_creator = self._win.get_char_creator()
self.char_creator = char_creator
self._win.pack_in_main_content(self.char_creator)
self.char_creator.reset_selected_menu_items()
save_changes_button = KanoButton(_("Save changes").upper())
save_changes_button.connect("clicked", self.save_changes)
discard_changes_button = OrangeButton(_("Discard").upper())
discard_changes_button.connect("clicked", self.discard)
discard_changes_button.set_margin_left(100)
empty_label = Gtk.Label("")
button_box = Gtk.ButtonBox()
button_box.pack_start(discard_changes_button, False, False, 0)
button_box.pack_start(save_changes_button, False, False, 0)
button_box.pack_start(empty_label, False, False, 0)
self._win.pack_in_bottom_bar(button_box)
self._win.show_all()
# Hide all the pop ups
self.char_creator._hide_pop_ups()
示例2: __init__
# 需要导入模块: from kano.gtk3.buttons import OrangeButton [as 别名]
# 或者: from kano.gtk3.buttons.OrangeButton import set_margin_left [as 别名]
def __init__(self):
Gtk.Window.__init__(self, title=self._TITLE)
apply_common_to_screen()
window_height = self._IMAGE_HEIGHT + 220
self.set_size_request(self._IMAGE_WIDTH, window_height)
self.set_decorated(False)
self.set_resizable(False)
self.set_position(Gtk.WindowPosition.CENTER)
self.set_icon_name('kano-updater')
# Put the window above all the existing ones when it starts
# FIXME: this needs to happen within a 'realized' signal handler
# disabled for now
#self.get_window().raise_()
image = Gtk.Image()
image.set_from_file(self._HEADER_IMAGE)
background = Gtk.EventBox()
background.set_size_request(self._IMAGE_WIDTH, self._IMAGE_HEIGHT)
background.add(image)
# Header
heading = Heading(self._HEADING, self._BYLINE)
heading.description.set_line_wrap(True)
action = KanoButton(self._ACTION.upper())
action.connect('clicked', self._do_action)
action.set_halign(Gtk.Align.CENTER)
later = OrangeButton(_("Later"))
later.connect('clicked', self._do_later)
later.set_halign(Gtk.Align.START)
later.set_margin_left(40)
buttons = Gtk.Overlay()
buttons.add(action)
buttons.add_overlay(later)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
box.pack_start(background, False, False, 0)
box.pack_start(heading.container, False, False, 10)
box.pack_start(buttons, False, False, 0)
self.add(box)
self.show_all()