本文整理汇总了Python中gi.repository.Gtk.Frame方法的典型用法代码示例。如果您正苦于以下问题:Python Gtk.Frame方法的具体用法?Python Gtk.Frame怎么用?Python Gtk.Frame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.Gtk
的用法示例。
在下文中一共展示了Gtk.Frame方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init_ui
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Frame [as 别名]
def init_ui(self):
vbox0 = Gtk.VBox(spacing=5)
vbox0.set_border_width(5)
self.get_content_area().add(vbox0)
frame1 = Gtk.Frame()
vbox0.add(frame1)
self.grid = Gtk.Grid()
self.grid.set_row_spacing(10)
self.grid.set_column_spacing(10)
self.grid.set_margin_bottom(10)
self.grid.set_margin_start(10)
self.grid.set_margin_end(10)
self.grid.set_margin_top(10)
frame1.add(self.grid)
示例2: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Frame [as 别名]
def __init__(self, volctl):
self.volctl = volctl
self._win = Gtk.Window(type=Gtk.WindowType.POPUP)
self._win.connect("enter-notify-event", self._cb_enter_notify)
self._win.connect("leave-notify-event", self._cb_leave_notify)
self._grid = Gtk.Grid()
self._grid.set_column_spacing(2)
self._grid.set_row_spacing(self.SPACING)
self._frame = Gtk.Frame()
self._frame.set_shadow_type(Gtk.ShadowType.OUT)
self._frame.add(self._grid)
self._win.add(self._frame)
# gui objects by index
self._sink_scales = {}
self._sink_input_scales = {}
self._create_sliders()
self._win.show_all()
self._set_position()
# timeout
self._timeout = None
self._enable_timeout()
示例3: _setup_playbar
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Frame [as 别名]
def _setup_playbar(self):
"""
setup the play controls at the bottom part of the application
"""
box = self.find(self.shell.props.window,
'GtkBox', 'by_name')
frame_box = Gtk.Box()
frame_box.set_orientation(Gtk.Orientation.VERTICAL)
self.small_frame = Gtk.Frame()
self.small_frame.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
frame_box.pack_start(self.small_frame, False, True, 0)
frame_box.pack_start(self.small_bar, False, True, 1)
box.pack_start(frame_box, False, True, 0)
box.reorder_child(frame_box, 3)
frame_box.show_all()
self.show_small_bar()
# hide status bar
action = self.plugin.appshell.lookup_action('', 'statusbar-visible',
'win')
if action:
action.set_active(True)
示例4: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Frame [as 别名]
def __init__(self, model, columns):
Gtk.Frame.__init__(self)
self.perform_scroll = False
self.model = model
self.columns = columns
self.vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.add(self.vbox)
## ScrolledWindow
scrolled_window = Gtk.ScrolledWindow()
self.vbox.pack_start(scrolled_window, True, True, 0)
# TreeView
self.tree_view = Gtk.TreeView(model)
scrolled_window.add(self.tree_view)
for column in columns:
self.tree_view.append_column(column)
self.tree_view.connect('size-allocate', self.scroll_tree_view)
self.selection = self.tree_view.get_selection()
self.selection.set_mode(Gtk.SelectionMode.SINGLE)
示例5: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Frame [as 别名]
def __init__(self):
self.hb = Gtk.HeaderBar().new()
self.hb.props.show_close_button = True
self.hb_revealer = Gtk.Revealer(name="titlebar-revealer-pv")
self.hb_revealer.add(self.hb)
self.hb_revealer.props.transition_duration = 750
self.hb_revealer.set_transition_type(
Gtk.RevealerTransitionType.CROSSFADE)
self.hb_revealer.show()
self.hb_revealer.set_reveal_child(True)
self.hb_container = Gtk.Frame(name="titlebar-container")
self.hb_container.set_shadow_type(Gtk.ShadowType.NONE)
self.hb_container.add(self.hb_revealer)
self.hb_container.show()
self.hb.show_all()
示例6: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Frame [as 别名]
def __init__(self, *args, **kwargs):
Gtk.Frame.__init__(self, *args, **kwargs)
self.get_style_context().add_class('multilineentry')
textview = Gtk.TextView()
self.add(textview)
示例7: add_page_to_sidebar_notebook
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Frame [as 别名]
def add_page_to_sidebar_notebook(self, icon, page):
"""Adds a new page tab to the left panel. The tab will
be added as the last tab. Also causes the tabs to be
shown if they're not.
@param icon: a Gtk.Image picture to display on the tab
@param page: Gtk.Frame-based panel to be added
"""
return self._add_page(self.sidebar_notebook, icon, page)
示例8: add_page_to_main_notebook
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Frame [as 别名]
def add_page_to_main_notebook(self, title, page):
"""Adds a new page tab to the top right main panel. The tab
will be added as the last tab. Also causes the tabs to be
shown.
@param title: Short text to use for the tab label
@param page: Gtk.Frame-based panel to be added
"""
return self._add_page(self.main_notebook, Gtk.Label(label=title), page)
示例9: remove_page_from_sidebar_notebook
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Frame [as 别名]
def remove_page_from_sidebar_notebook(self, page):
"""Removes a new page tab from the left panel. If this leaves
only one tab in the notebook, the tab selector will be hidden.
@param page: Gtk.Frame-based panel to be removed
"""
return self._remove_page(self.sidebar_notebook, page)
示例10: remove_page_from_main_notebook
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Frame [as 别名]
def remove_page_from_main_notebook(self, page):
"""Removes a new page tab from the top right main panel. If
this leaves only one tab in the notebook, the tab selector will
be hidden.
@param page: Gtk.Frame-based panel to be removed
"""
return self._remove_page(self.main_notebook, page)
示例11: onFingeringFinished
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Frame [as 别名]
def onFingeringFinished(self, fm, finger, playername):
if not isinstance(self.get_child(), Gtk.Label) or \
finger.getName().lower() != playername.lower():
return
self.fm.disconnect(self.handle_id)
label = Gtk.Label()
label.set_markup("<b>%s</b>" % playername)
widget = Gtk.Frame()
widget.set_label_widget(label)
widget.set_shadow_type(Gtk.ShadowType.NONE)
alignment = Gtk.Alignment.new(0, 0, 1, 1)
alignment.set_padding(3, 0, 12, 0)
widget.add(alignment)
text_view = Gtk.TextView()
text_view.set_editable(False)
text_view.set_cursor_visible(False)
text_view.props.wrap_mode = Gtk.WrapMode.WORD
tb_iter = text_view.get_buffer().get_end_iter()
for i, note in enumerate(finger.getNotes()):
if note:
insert_formatted(text_view, tb_iter, "%s\n" % note)
text_view.show_all()
scroll_win = Gtk.ScrolledWindow()
scroll_win.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
scroll_win.add(text_view)
alignment.add(scroll_win)
self.remove(self.get_child())
self.add(widget)
widget.show_all()
示例12: add
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Frame [as 别名]
def add(self, widget):
self._frame = Gtk.Frame()
self._frame.add(widget)
super(CustomPopover, self).add(self._frame)
self._frame.show_all()
# Popoverwindow co ordinates without off-screen correction:
# Window origin (x, y)
# |
# V
# ---------------------------------
# | Main Window |
# | |
# | |
# |Toggle button's (x, y) |
# |(relative to parent window) |
# | | |
# | V |
# | ......................... |
# Popover | | Toggle Button | |
# window's | | | |
# (x, y)---+> ......................... |
# |(window will be here) |
# | |
# | |
# ---------------------------------
# Popover Window's screen coordinates:
# x = Window's origin x + Toggle Button's relative x
# y = Window's origin y + Toggle Button's relative y + Toggle Button's
# height
示例13: toggle_active
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Frame [as 别名]
def toggle_active(self, *args):
if self.active: # Deactivate
self.active = False
self.container.remove(self.frame)
if self.update is not None:
self.update()
self.plotcanvas.mpl_disconnect(self.click_subscription)
self.plotcanvas.mpl_disconnect(self.move_subscription)
return False
else: # Activate
App.log.debug("DEBUG: Activating Measurement Tool...")
self.active = True
self.click_subscription = self.plotcanvas.mpl_connect("button_press_event", self.on_click)
self.move_subscription = self.plotcanvas.mpl_connect('motion_notify_event', self.on_move)
self.frame = Gtk.Frame()
self.frame.set_margin_right(5)
self.frame.set_margin_top(3)
align = Gtk.Alignment()
align.set(0, 0.5, 0, 0)
align.set_padding(4, 4, 4, 4)
self.label = Gtk.Label()
self.label.set_label("Click on a reference point...")
abox = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 10)
abox.pack_start(Gtk.Image.new_from_file('share/measure16.png'), False, False, 0)
abox.pack_start(self.label, False, False, 0)
align.add(abox)
self.frame.add(align)
self.container.pack_end(self.frame, False, True, 1)
self.frame.show_all()
return True
示例14: draw_statistics_frame
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Frame [as 别名]
def draw_statistics_frame(self):
frame_vert = Gtk.Frame(label="Statistics")
frame_vert.set_border_width(10)
frame_vert.table_box = None
self.grid.attach(frame_vert, 0, 4, 1, 1)
return frame_vert
示例15: draw_top_queries_frame
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Frame [as 别名]
def draw_top_queries_frame(self):
frame_vert = Gtk.Frame(label="Top Queries")
frame_vert.set_border_width(10)
frame_vert.table_box = None
self.grid.attach(frame_vert, 1, 4, 1, 1)
return frame_vert