本文整理汇总了Python中higwidgets.higboxes.HIGVBox.show_all方法的典型用法代码示例。如果您正苦于以下问题:Python HIGVBox.show_all方法的具体用法?Python HIGVBox.show_all怎么用?Python HIGVBox.show_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类higwidgets.higboxes.HIGVBox
的用法示例。
在下文中一共展示了HIGVBox.show_all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ListManager
# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import show_all [as 别名]
class ListManager(gtk.Dialog):
'''
ListManager - manage the OptionList
Tricks:
- To works with the Command Manager it save at __init__ the list
of options. After that. Add to CommandManager when clicked 'Ok Button'
with the new and old list.
'''
def __init__(self, name, section, profilecore, widget, title):
gtk.Dialog.__init__(self,title)
self.set_size_request(450, 300)
self._name = name
self._section = section
self._profilecore = profilecore
self._widget = widget
self._list = self._profilecore.get_list_opt(self._section, self._name)
self._new_list = self._profilecore.get_list_opt(self._section,
self._name)
self._create_widgets()
self.show()
self._load_option_list()
self._create_action_area()
def _create_widgets(self):
self._optionlist = OptionList()
label = gtk.Label('Items at the %s ' % self._name)
self._box = gtk.HPaned()
ol = self._optionlist
ol.reload()
self.vbox.pack_start(label, False, False, 0)
self._box.add(ol)
self.vbox.pack_start(self._box)
self._box.show_all()
self._move_box = HIGVBox()
self._add_bt = HIGButton(stock='gtk-add')
self._add_bt.connect('clicked', self._on_add_press)
self._remove_bt = HIGButton(stock='gtk-remove')
self._remove_bt.connect('clicked', self._on_remove_press)
#XXX - moves don't work yet: lack the connect
self._move_up_bt = HIGButton(stock='gtk-go-up')
self._move_down_bt = HIGButton(stock='gtk-go-down')
self._move_box.pack_start(self._add_bt, False, False)
self._move_box.pack_start(self._remove_bt, False, False)
self._move_box.pack_start(self._move_up_bt, False, False)
self._move_box.pack_start(self._move_down_bt, False, False)
self._create_option_tv()
self._box.set_position(200)
self._box_other = gtk.HPaned()
self._box.add(self._box_other)
self._box_other.add(self._move_box)
self._box_other.add(self._sw)
self._move_box.show_all()
self.vbox.show_all()
label.show()
def _create_option_tv(self):
self._sw = HIGScrolledWindow()
self._model = gtk.TreeStore(gobject.TYPE_STRING)
self._tv = gtk.TreeView(self._model)
column = gtk.TreeViewColumn()
column.set_title('Name')
render = gtk.CellRendererText()
column.pack_start(render, expand=True)
column.add_attribute(render, 'text', 0)
self._tv.append_column(column)
self._sw.add(self._tv)
self._sw.show_all()
def _load_option_list(self):
list = self._list
for i in list :
iter = self._model.insert_before(None, None)
self._model.set_value(iter, 0, i)
def _create_action_area(self):
self._button_ok = HIGButton(stock='gtk-ok')
self._button_cancel = HIGButton(stock='gtk-cancel')
self._button_cancel.connect('clicked', self._on_cancel_press)
self._button_ok.connect('clicked', self._on_ok_press)
self.action_area.pack_start(self._button_cancel)
self.action_area.pack_start(self._button_ok)
self.action_area.show_all()
def _on_add_press(self, widget):
log.debug('<<< Add Option to OptionList')
option_selected = self._optionlist.get_selected()
iter = self._model.insert_before(None, None)
self._model.set_value(iter, 0, option_selected)
self._new_list.append(option_selected)
def get_selected(self):
"""
Returns the string with name of selected option
"""
try:
treeselection = self._tv.get_selection()
(model,iter) = treeselection.get_selected()
#.........这里部分代码省略.........
示例2: InterfaceEditor
# 需要导入模块: from higwidgets.higboxes import HIGVBox [as 别名]
# 或者: from higwidgets.higboxes.HIGVBox import show_all [as 别名]
#.........这里部分代码省略.........
myiter = model.insert_before(None, None)
icon = gtk.Image()
icon = icon.render_icon("gtk-edit", gtk.ICON_SIZE_MENU)
model.set_value(myiter, 0, icon)
model.set_value(myiter, 1, "Profile")
myiter = model.insert_before(None, None)
icon = gtk.Image()
icon = icon.render_icon("gtk-convert", gtk.ICON_SIZE_MENU)
model.set_value(myiter, 0, icon)
model.set_value(myiter, 1, "Wizard")
myiter = model.insert_before(None, None)
icon = gtk.Image()
icon = icon.render_icon(gtk.STOCK_DND_MULTIPLE, gtk.ICON_SIZE_MENU)
model.set_value(myiter, 0, icon)
model.set_value(myiter, 1, "Options")
selection = self.edit_mode_tv.get_selection()
selection.select_iter(myiter)
self.edit_mode_tv.connect("cursor-changed", self.change_edit_mode)
vbox = HIGVBox()
vbox.pack_start(self.edit_mode_tv, False, False)
return vbox
def change_edit_mode(self, widget):
"""
Change box of main screen and others changes at toolbar
"""
selection = self.edit_mode_tv.get_selection()
(model, iter) = selection.get_selected()
edit = model.get_value(iter, 1)
if edit == "Options" and not self.edit_mode_opt == "Options":
self._remove_previews()
self.edit_mode_opt = "Options"
self.display_frame.show_all()
if self.notebook.get_n_pages > 1:
self.notebook.remove_page(-1)
self.notebook.remove_page(-1)
self._set_menus_editor(False)
elif edit == "Profile" and not self.edit_mode_opt == "Profile":
self._remove_previews()
self.edit_mode_opt = "Profile"
bool = self.profile_box_b == None
self.create_profile_edit()
if bool:
self.vbox_left.pack_start(self.profile_box, True, True)
self.profile_box_b = True
log.debug("<<< show :: Profile Edit Mode :: ")
self.profile_box.show_all()
self.profile_box.notebook.put_on_page()
self._create_tooldesign()
self._set_menus_editor(True)
self.profile_box.show()
self.obj = self.profile_box
elif edit == "Wizard" and not self.edit_mode_opt == "Wizard":
log.debug("<<< show :: Wizard Edit Mode - basic mode ")
self._remove_previews()
self.edit_mode_opt = "Wizard"
self._set_menus_editor(True)
bool = self.wizard_box_b == None
self.create_wizard_edit()
if bool:
self.vbox_left.pack_start(self.wizard_box, True, True)
self.wizard_box_b = True
self.wizard_box.show_all()