本文整理汇总了Python中gtk.HBox方法的典型用法代码示例。如果您正苦于以下问题:Python gtk.HBox方法的具体用法?Python gtk.HBox怎么用?Python gtk.HBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gtk
的用法示例。
在下文中一共展示了gtk.HBox方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createTabLabel
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import HBox [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: create_terminalbox
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import HBox [as 别名]
def create_terminalbox(self):
"""Create a GtkHBox containing the terminal and a scrollbar"""
terminalbox = gtk.HBox()
self.scrollbar = gtk.VScrollbar(self.vte.get_adjustment())
self.scrollbar.set_no_show_all(True)
self.scrollbar_position = self.config['scrollbar_position']
if self.scrollbar_position not in ('hidden', 'disabled'):
self.scrollbar.show()
if self.scrollbar_position == 'left':
func = terminalbox.pack_end
else:
func = terminalbox.pack_start
func(self.vte)
func(self.scrollbar, False)
terminalbox.show_all()
return(terminalbox)
示例3: __init__
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import HBox [as 别名]
def __init__(self, title, notebook):
"""Class initialiser"""
gtk.HBox.__init__(self)
self.__gobject_init__()
self.notebook = notebook
self.terminator = Terminator()
self.config = Config()
self.label = EditableLabel(title)
self.update_angle()
self.pack_start(self.label, True, True)
self.update_button()
self.show_all()
示例4: run
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import HBox [as 别名]
def run(self, graphic):
window = gtk.Window()
self.__window = window
window.set_default_size(200, 200)
vbox = gtk.VBox()
window.add(vbox)
render = GtkGraphicRenderer(graphic)
self.__render = render
vbox.pack_end(render, True, True, 0)
hbox = gtk.HBox()
vbox.pack_start(hbox, False, False, 0)
smaller_zoom = gtk.Button("Zoom Out")
smaller_zoom.connect("clicked", self.__set_smaller_cb)
hbox.pack_start(smaller_zoom)
bigger_zoom = gtk.Button("Zoom In")
bigger_zoom.connect("clicked", self.__set_bigger_cb)
hbox.pack_start(bigger_zoom)
output_png = gtk.Button("Output Png")
output_png.connect("clicked", self.__output_png_cb)
hbox.pack_start(output_png)
window.connect('destroy', gtk.main_quit)
window.show_all()
#gtk.bindings_activate(gtk.main_quit, 'q', 0)
gtk.main()
示例5: _init_gui
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import HBox [as 别名]
def _init_gui(self):
self._dialog = gimpui.Dialog(title=pg.config.PLUGIN_TITLE, role=None)
self._dialog.set_transient()
self._dialog.set_border_width(self._BORDER_WIDTH)
self._dialog.set_default_size(self._DIALOG_WIDTH, -1)
self._button_stop = gtk.Button()
self._button_stop.set_label(_("_Stop"))
self._buttonbox = gtk.HButtonBox()
self._buttonbox.pack_start(self._button_stop, expand=False, fill=False)
self._progress_bar = gtk.ProgressBar()
self._progress_bar.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
self._hbox_action_area = gtk.HBox(homogeneous=False)
self._hbox_action_area.set_spacing(self._HBOX_HORIZONTAL_SPACING)
self._hbox_action_area.pack_start(self._progress_bar, expand=True, fill=True)
self._hbox_action_area.pack_end(self._buttonbox, expand=False, fill=False)
self._dialog.vbox.pack_end(self._hbox_action_area, expand=False, fill=False)
self._button_stop.connect("clicked", self._on_button_stop_clicked)
self._dialog.connect("delete-event", self._on_dialog_delete_event)
示例6: _init_gui
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import HBox [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()
示例7: _create_field_tooltip
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import HBox [as 别名]
def _create_field_tooltip(self):
self._field_tooltip_window = gtk.Window(type=gtk.WINDOW_POPUP)
self._field_tooltip_window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_TOOLTIP)
self._field_tooltip_window.set_resizable(False)
# This copies the style of GTK tooltips.
self._field_tooltip_window.set_name("gtk-tooltips")
self._field_tooltip_text = gtk.Label()
self._field_tooltip_hbox = gtk.HBox(homogeneous=False)
self._field_tooltip_hbox.pack_start(
self._field_tooltip_text, expand=False, fill=False)
self._field_tooltip_frame = gtk.Frame()
self._field_tooltip_frame.set_shadow_type(gtk.SHADOW_ETCHED_IN)
self._field_tooltip_frame.add(self._field_tooltip_hbox)
self._field_tooltip_frame.show_all()
self._field_tooltip_window.add(self._field_tooltip_frame)
示例8: __init__
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import HBox [as 别名]
def __init__(self, rfunction):
super(FunctionPanel, self).__init__()
self._rfunction = rfunction
formals = self._as_list(rfunction.formals())
formals_value = [x for x in formals.rx(-1)]
formals_name = [x for x in formals.rx(-1).names]
self._table = gtk.ListStore(str, str)
self._treeView = gtk.TreeView(model = self._table)
self._treeView.show()
self._valueColumns = [gtk.TreeViewColumn('parameter'),
gtk.TreeViewColumn('value'),]
self._valueCells = []
for col_i, col in enumerate(self._valueColumns):
self._treeView.append_column(col)
cr = gtk.CellRendererText()
col.pack_start(cr, True)
self._valueCells.append(cr)
col.set_attributes(cr, text=col_i)
for name, value in itertools.izip(formals_name, formals_value):
row = (name, value)
self._table.append(row)
sbox = gtk.HBox(homogeneous=False, spacing=0)
sbox.show()
示例9: run
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import HBox [as 别名]
def run(self, graphic):
"""! Run function
@param self this object
@param graphic graphic
@return none
"""
window = gtk.Window()
self.__window = window
window.set_default_size(200, 200)
vbox = gtk.VBox()
window.add(vbox)
render = GtkGraphicRenderer(graphic)
self.__render = render
vbox.pack_end(render, True, True, 0)
hbox = gtk.HBox()
vbox.pack_start(hbox, False, False, 0)
smaller_zoom = gtk.Button("Zoom Out")
smaller_zoom.connect("clicked", self.__set_smaller_cb)
hbox.pack_start(smaller_zoom)
bigger_zoom = gtk.Button("Zoom In")
bigger_zoom.connect("clicked", self.__set_bigger_cb)
hbox.pack_start(bigger_zoom)
output_png = gtk.Button("Output Png")
output_png.connect("clicked", self.__output_png_cb)
hbox.pack_start(output_png)
window.connect('destroy', gtk.main_quit)
window.show_all()
#gtk.bindings_activate(gtk.main_quit, 'q', 0)
gtk.main()
示例10: get_password
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import HBox [as 别名]
def get_password(self,parent):
dialog = gtk.Dialog("Configure System Password",parent,gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT,(gtk.STOCK_CANCEL,gtk.RESPONSE_REJECT,gtk.STOCK_OK,gtk.RESPONSE_ACCEPT))
self.pass1 = gtk.HBox()
self.label1 = gtk.Label(" Passsword: ")
self.pass1.pack_start(self.label1,False,True,0)
self.password1 = gtk.Entry()
self.password1.set_visibility(False)
self.pass1.pack_start(self.password1,False,True,0)
dialog.vbox.add(self.pass1)
self.pass2 = gtk.HBox()
self.label2 = gtk.Label(" Verify Password: ")
self.pass2.pack_start(self.label2,False,True,0)
self.password2 = gtk.Entry()
self.password2.set_visibility(False)
self.pass2.pack_start(self.password2,False,True,0)
dialog.vbox.add(self.pass2)
dialog.show_all()
response = dialog.run()
if response == gtk.RESPONSE_ACCEPT:
self.a = self.password1.get_text()
self.b = self.password2.get_text()
dialog.destroy()
else:
self.a = ''
self.b = ''
dialog.destroy()
# Appply Configurations to Kickstart File
示例11: fill_bases
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import HBox [as 别名]
def fill_bases(self, baseExplorers):
box = gtk.HBox()
for b in baseExplorers:
box.add(b.newAttributeWidget(self))
row = self.propertyLabels.get('bases')[0]
self.subtable["properties"].attach(box, 1, 2, row, row+1)
box.show_all()
示例12: __init__
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import HBox [as 别名]
def __init__(self, parasite):
gtk.HBox.__init__(self)
self._should_invoke_parasite_changed_signal = True
self._init_gui(parasite)
示例13: __init__
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import HBox [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)
示例14: _on_event_box_size_allocate
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import HBox [as 别名]
def _on_event_box_size_allocate(self, event_box, allocation):
if self._is_event_box_allocated_size:
return
self._is_event_box_allocated_size = True
# Assign enough height to the HBox to make sure it does not resize when
# showing buttons.
if self._buttons_allocation.height >= allocation.height:
self._hbox.set_property("height-request", allocation.height)
示例15: _init_gui
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import HBox [as 别名]
def _init_gui(self):
self._size_spin_button = gtk.SpinButton(
gtk.Adjustment(
value=0,
lower=self._min_size,
upper=self._max_size,
step_incr=1,
page_incr=10,
),
digits=0)
self._size_spin_button.set_numeric(True)
self._size_spin_button.set_value(0)
self._size_spin_button_label = gtk.Label(_("Size"))
self._size_hbox = gtk.HBox()
self._size_hbox.set_spacing(self._SIZE_HBOX_SPACING)
self._size_hbox.pack_start(self._size_spin_button_label, expand=False, fill=False)
self._size_hbox.pack_start(self._size_spin_button, expand=False, fill=False)
self._vbox.pack_start(self._size_hbox, expand=False, fill=False)
self._vbox.reorder_child(self._size_hbox, 0)
self._size_spin_button.connect(
"value-changed", self._on_size_spin_button_value_changed)