当前位置: 首页>>代码示例>>Python>>正文


Python Gtk.HSeparator方法代码示例

本文整理汇总了Python中gi.repository.Gtk.HSeparator方法的典型用法代码示例。如果您正苦于以下问题:Python Gtk.HSeparator方法的具体用法?Python Gtk.HSeparator怎么用?Python Gtk.HSeparator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gi.repository.Gtk的用法示例。


在下文中一共展示了Gtk.HSeparator方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: load

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import HSeparator [as 别名]
def load(self, gmwidg):
        # Specify whether the panel should have a horizontal layout:
        horizontal = True

        if horizontal:
            self.box = Gtk.HBox()
        else:
            self.box = Gtk.VBox()
        __widget__ = self.box

        # Use two engine output widgets for each player color:
        self.output_white = EngineOutput(True)
        self.output_black = EngineOutput(False)
        if horizontal:
            self.output_separator = Gtk.VSeparator()
        else:
            self.output_separator = Gtk.HSeparator()

        self.output_noengines = Gtk.TextView()
        self.output_noengines.get_buffer().set_text(_(
            "No chess engines (computer players) are participating in this game."))
        self.output_noengines.set_editable(False)
        self.output_noengines.set_wrap_mode(Gtk.WrapMode.WORD_CHAR)

        __widget__.pack_start(self.output_noengines, True, True, 0)
        __widget__.show_all()

        self.boardview = gmwidg.board.view

        self.model_cids = [
            self.boardview.model.connect_after("game_changed", self.game_changed),
            self.boardview.model.connect_after("players_changed", self.players_changed),
            self.boardview.model.connect_after("game_started", self.game_started),
            self.boardview.model.connect_after("game_terminated", self.on_game_terminated),
        ]
        return __widget__ 
开发者ID:pychess,项目名称:pychess,代码行数:38,代码来源:engineOutputPanel.py

示例2: __init__

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import HSeparator [as 别名]
def __init__(self, graph, mydot, core):
        GObject.GObject.__init__(self)

        self.graph = graph
        self.mydot = mydot
        self.uicore = core

        self.toolbox = self
        b = SemiStockButton("", Gtk.STOCK_ZOOM_IN, 'Zoom In')
        b.connect("clicked", self._zoom, "in")
        self.toolbox.pack_start(b, False, False, 0)
        b = SemiStockButton("", Gtk.STOCK_ZOOM_OUT, 'Zoom Out')
        b.connect("clicked", self._zoom, "out")
        self.toolbox.pack_start(b, False, False, 0)
        b = SemiStockButton("", Gtk.STOCK_ZOOM_FIT, 'Zoom Fit')
        b.connect("clicked", self._zoom, "fit")
        self.toolbox.pack_start(b, False, False, 0)
        b = SemiStockButton("", Gtk.STOCK_ZOOM_100, 'Zoom 100%')
        b.connect("clicked", self._zoom, "100")
        self.toolbox.pack_start(b, False, False, 0)
        # Separator
        self.sep = Gtk.HSeparator()
        self.toolbox.pack_start(self.sep, False, False, 0)

        # Change between Callgraph and Flowgraph
        if self.uicore.backend == 'radare':
            self.grpah_layout = Gtk.ToggleToolButton(stock_id=Gtk.STOCK_FULLSCREEN)
            self.grpah_layout.connect("clicked", self._change_layout)
            self.toolbox.pack_start(self.grpah_layout, False, False, 0)

        # Grayed?
        self.toolbox.set_sensitive(True)
        self.show_all() 
开发者ID:inguma,项目名称:bokken,代码行数:35,代码来源:graph_bar.py

示例3: get_file

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import HSeparator [as 别名]
def get_file(self, widget):
        import re
        import ui.gtk3.common

        # Disable all the interface and Ok button.
        self.hbox.set_sensitive(False)
        self.options_hbox.set_sensitive(False)
        self.butt_ok.set_sensitive(False)

        # Progress bar
        self.progress_box = Gtk.VBox(False, 0)
        self.hseparator4 = Gtk.HSeparator()
        self.progress_bar = Gtk.ProgressBar()
        self.progress_box.pack_start(self.hseparator4, False, False, 0)
        self.progress_box.pack_start(self.progress_bar, False, False, 0)

        self.main_vbox.pack_start(self.progress_box, False, False, 2)
        self.progress_box.show_all()

        ui.gtk3.common.repaint()

        self.file = self.input_entry.get_child().get_text()
        if not re.match('^[a-z]+://', self.file):
            # It's a local file.
            self.manager.add_item('file://' + self.file)
        self.get_options()
        self.response(0) 
开发者ID:inguma,项目名称:bokken,代码行数:29,代码来源:file_dialog.py

示例4: _add_header

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import HSeparator [as 别名]
def _add_header(self):
        self.header = Gtk.Label()
        self.header.set_markup("Unset")
        self.header.set_alignment(0.0, 0.5)
        self.pack_start(self.header, False, False, 0)
        self.separator = Gtk.HSeparator()
        self.pack_start(self.separator, False, False, 0)
        self.reorder_child(self.header, 0)
        self.reorder_child(self.separator, 1)
        self.show_all() 
开发者ID:jendrikseipp,项目名称:rednotebook,代码行数:12,代码来源:customwidgets.py

示例5: __init__

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import HSeparator [as 别名]
def __init__(self, canvas, num):
        FigureManagerBase.__init__(self, canvas, num)

        self.window = Gtk.Window()
        self.window.set_wmclass("matplotlib", "Matplotlib")
        self.set_window_title("Figure %d" % num)
        try:
            self.window.set_icon_from_file(window_icon)
        except Exception:
            # Some versions of gtk throw a glib.GError but not all, so I am not
            # sure how to catch it.  I am unhappy doing a blanket catch here,
            # but am not sure what a better way is - JDH
            _log.info('Could not load matplotlib icon: %s', sys.exc_info()[1])

        self.vbox = Gtk.Box()
        self.vbox.set_property("orientation", Gtk.Orientation.VERTICAL)
        self.window.add(self.vbox)
        self.vbox.show()

        self.canvas.show()

        self.vbox.pack_start(self.canvas, True, True, 0)
        # calculate size for window
        w = int(self.canvas.figure.bbox.width)
        h = int(self.canvas.figure.bbox.height)

        self.toolmanager = self._get_toolmanager()
        self.toolbar = self._get_toolbar()
        self.statusbar = None

        def add_widget(child, expand, fill, padding):
            child.show()
            self.vbox.pack_end(child, False, False, 0)
            size_request = child.size_request()
            return size_request.height

        if self.toolmanager:
            backend_tools.add_tools_to_manager(self.toolmanager)
            if self.toolbar:
                backend_tools.add_tools_to_container(self.toolbar)
                self.statusbar = StatusbarGTK3(self.toolmanager)
                h += add_widget(self.statusbar, False, False, 0)
                h += add_widget(Gtk.HSeparator(), False, False, 0)

        if self.toolbar is not None:
            self.toolbar.show()
            h += add_widget(self.toolbar, False, False, 0)

        self.window.set_default_size(w, h)

        def destroy(*args):
            Gcf.destroy(num)
        self.window.connect("destroy", destroy)
        self.window.connect("delete_event", destroy)
        if matplotlib.is_interactive():
            self.window.show()
            self.canvas.draw_idle()

        self.canvas.grab_focus() 
开发者ID:PacktPublishing,项目名称:Mastering-Elasticsearch-7.0,代码行数:61,代码来源:backend_gtk3.py

示例6: __init__

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import HSeparator [as 别名]
def __init__(self, journal, assistant, *args, **kwargs):
        AssistantPage.__init__(self, *args, **kwargs)

        self.journal = journal
        self.assistant = assistant

        self.text_and_tags_button = Gtk.RadioButton(label=_("Export text and tags"))
        self.text_only_button = Gtk.RadioButton(
            label=_("Export text only"), group=self.text_and_tags_button
        )
        self.tags_only_button = Gtk.RadioButton(
            label=_("Export tags only"), group=self.text_and_tags_button
        )
        self.filter_tags_button = Gtk.CheckButton(label=_("Filter days by tags"))

        self.pack_start(self.text_and_tags_button, False, False, 0)
        self.pack_start(self.text_only_button, False, False, 0)
        self.pack_start(self.tags_only_button, False, False, 0)
        self.pack_start(Gtk.HSeparator(), False, False, 0)
        self.pack_start(self.filter_tags_button, False, False, 0)

        self.available_categories = customwidgets.CustomListView(
            [(_("Available tags"), str)]
        )
        self.selected_categories = customwidgets.CustomListView(
            [(_("Selected tags"), str)]
        )

        left_scroll = Gtk.ScrolledWindow()
        left_scroll.add(self.available_categories)

        right_scroll = Gtk.ScrolledWindow()
        right_scroll.add(self.selected_categories)

        self.select_button = Gtk.Button(_("Select") + " >>")
        self.deselect_button = Gtk.Button("<< " + _("Deselect"))

        self.select_button.connect("clicked", self.on_select_category)
        self.deselect_button.connect("clicked", self.on_deselect_category)

        centered_vbox = Gtk.VBox()
        centered_vbox.pack_start(self.select_button, True, False, 0)
        centered_vbox.pack_start(self.deselect_button, True, False, 0)

        vbox = Gtk.VBox()
        vbox.pack_start(centered_vbox, True, False, 0)

        hbox = Gtk.HBox()
        hbox.pack_start(left_scroll, True, True, 0)
        hbox.pack_start(vbox, False, False, 0)
        hbox.pack_start(right_scroll, True, True, 0)
        self.pack_start(hbox, True, True, 0)

        self.error_text = Gtk.Label(label="")
        self.error_text.set_alignment(0.0, 0.5)

        self.pack_end(self.error_text, False, False, 0)

        self.text_and_tags_button.set_active(True)
        self.filter_tags_button.connect("toggled", self.check_selection) 
开发者ID:jendrikseipp,项目名称:rednotebook,代码行数:62,代码来源:exports.py


注:本文中的gi.repository.Gtk.HSeparator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。