本文整理汇总了Python中higwidgets.higboxes.HIGHBox.set_spacing方法的典型用法代码示例。如果您正苦于以下问题:Python HIGHBox.set_spacing方法的具体用法?Python HIGHBox.set_spacing怎么用?Python HIGHBox.set_spacing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类higwidgets.higboxes.HIGHBox
的用法示例。
在下文中一共展示了HIGHBox.set_spacing方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: quit
# 需要导入模块: from higwidgets.higboxes import HIGHBox [as 别名]
# 或者: from higwidgets.higboxes.HIGHBox import set_spacing [as 别名]
def quit(self, widget=None, extra=None):
if self.deleted:
dialog = HIGDialog(buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK,
gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
alert = HIGEntryLabel('<b>'+_("Deleting Profile")+'</b>')
text = HIGEntryLabel(_('Your profile is going to be deleted! Click\
Ok to continue, or Cancel to go back to Profile Editor.'))
hbox = HIGHBox()
hbox.set_border_width(5)
hbox.set_spacing(12)
vbox = HIGVBox()
vbox.set_border_width(5)
vbox.set_spacing(12)
image = gtk.Image()
image.set_from_stock(gtk.STOCK_DIALOG_WARNING, gtk.ICON_SIZE_DIALOG)
vbox.pack_start(alert)
vbox.pack_start(text)
hbox.pack_start(image)
hbox.pack_start(vbox)
dialog.vbox.pack_start(hbox)
dialog.vbox.show_all()
response = dialog.run()
dialog.destroy()
if response == gtk.RESPONSE_CANCEL:
return None
self.destroy()
if self.scan_notebook != None:
for i in xrange(self.scan_notebook.get_n_pages()):
page = self.scan_notebook.get_nth_page(i)
page.toolbar.profile_entry.update()
示例2: on_delete
# 需要导入模块: from higwidgets.higboxes import HIGHBox [as 别名]
# 或者: from higwidgets.higboxes.HIGHBox import set_spacing [as 别名]
def on_delete(self, widget=None):
if not self.profile_name:
return self.on_cancel()
dialog = HIGDialog(buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK,
gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
alert = HIGEntryLabel('<b>'+_("Deleting Profile")+'</b>')
text = HIGEntryLabel(_('Your profile is going to be deleted! Click \
Ok to continue, or Cancel to go back to Profile Editor.'))
hbox = HIGHBox()
hbox.set_border_width(5)
hbox.set_spacing(12)
vbox = HIGVBox()
vbox.set_border_width(5)
vbox.set_spacing(12)
image = gtk.Image()
image.set_from_stock(gtk.STOCK_DIALOG_WARNING, gtk.ICON_SIZE_DIALOG)
vbox.pack_start(alert)
vbox.pack_start(text)
hbox.pack_start(image)
hbox.pack_start(vbox)
dialog.vbox.pack_start(hbox)
dialog.vbox.show_all()
response = dialog.run()
dialog.destroy()
if response == gtk.RESPONSE_CANCEL:
return None
self.deleted = True
self.profile.remove_profile(self.profile_name)
self.on_cancel()
示例3: ProfileEditor
# 需要导入模块: from higwidgets.higboxes import HIGHBox [as 别名]
# 或者: from higwidgets.higboxes.HIGHBox import set_spacing [as 别名]
#.........这里部分代码省略.........
self.notebook.append_page(self.profile_info_vbox, gtk.Label(_('Profile')))
self.profile_info_vbox.set_border_width(5)
table = HIGTable()
self.profile_info_vbox._pack_noexpand_nofill(self.profile_info_label)
self.profile_info_vbox._pack_noexpand_nofill(HIGSpacer(table))
self.profile_annotation_scroll.add(self.profile_annotation_text)
self.profile_description_scroll.add(self.profile_description_text)
vbox_desc = HIGVBox()
vbox_desc._pack_noexpand_nofill(self.profile_description_label)
vbox_desc._pack_expand_fill(hig_box_space_holder())
vbox_ann = HIGVBox()
vbox_ann._pack_noexpand_nofill(self.profile_annotation_label)
vbox_ann._pack_expand_fill(hig_box_space_holder())
table.attach(self.profile_name_label,0,1,0,1)
table.attach(self.profile_name_entry,1,2,0,1)
#table.attach(self.profile_hint_label,0,1,1,2,xoptions=0)
table.attach(self.profile_hint_label,0,1,1,2)
table.attach(self.profile_hint_entry,1,2,1,2)
table.attach(vbox_desc,0,1,2,3)
table.attach(self.profile_description_scroll,1,2,2,3)
table.attach(vbox_ann,0,1,3,4)
table.attach(self.profile_annotation_scroll,1,2,3,4)
# Packing buttons on button_hbox
self.buttons_hbox.pack_start(self.help_button)
#self.buttons_hbox.pack_start(self.delete_button)
self.buttons_hbox.pack_start(self.cancel_button)
self.buttons_hbox.pack_start(self.ok_button)
self.buttons_hbox.set_border_width(5)
self.buttons_hbox.set_spacing(6)
def __create_tab(self, tab_name, section_name, tab):
log.debug(">>> Tab name: %s" % tab_name)
log.debug(">>>Creating profile editor section: %s" % section_name)
vbox = HIGVBox()
table = HIGTable()
section = HIGSectionLabel(section_name)
vbox._pack_noexpand_nofill(section)
vbox._pack_noexpand_nofill(HIGSpacer(table))
vbox.set_border_width(6)
tab.fill_table(table, True)
self.scrollwindow = HIGScrolledWindow()
self.scrollwindow.set_size_request(600,300)
vp = gtk.Viewport()
vp.add(vbox)
vp.set_shadow_type(gtk.SHADOW_NONE)
self.scrollwindow.add(vp)
vbox_tmp = HIGVBox()
vbox_tmp.set_border_width(6)
vbox_tmp.set_spacing(12)
vbox_tmp.pack_start(self.scrollwindow)
self.notebook.append_page(vbox_tmp, gtk.Label(tab_name))
def set_profilemanager(self, model):
"""
give a model of treeview to update profile manager
after run wizard
示例4: ProfileManager
# 需要导入模块: from higwidgets.higboxes import HIGHBox [as 别名]
# 或者: from higwidgets.higboxes.HIGHBox import set_spacing [as 别名]
class ProfileManager(HIGWindow):
"""
Create a Profile Manager
"""
def __init__(self, daddy=None):
HIGWindow.__init__(self, type=gtk.WINDOW_TOPLEVEL)
self.set_title('Profile Manager')
self.set_position(gtk.WIN_POS_CENTER)
self.__create_widgets()
self.add(self.vbox_main)
self.__fill_widgets()
self.__pack_widgets()
self.__scan_notebook = None
self.daddy = daddy
def __create_widgets(self):
self.vbox_main = HIGVBox()
self.main_frame = HIGFrame("Profiles")
#self.main_frame.set_shadow_type(gtk.SHADOW_ETCHED_OUT)
self.align = gtk.Alignment(0.0, 0.0, 1.0, 1.0)
self.align.set_padding(0,0,12,0)
self.vbox = HIGVBox()
self.profiles_sw = HIGScrolledWindow()
#TreeView
self.model = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
#self.modelfilter = self.model.filter_new()
self.profiles_tv = gtk.TreeView(self.model)
renderer = gtk.CellRendererText()
column = gtk.TreeViewColumn(_("Name"), renderer, text=0)
self.profiles_tv.append_column(column)
renderer_hint = gtk.CellRendererText()
column_hint = gtk.TreeViewColumn(_("Hint"), renderer_hint, text=1)
self.profiles_tv.append_column(column_hint)
#self.profiles_tv.set_model(self.modelfilter)
#Info
self.hbox_info = HIGHBox()
self.command_label = HIGEntryLabel('Command: ')
self.command_entry = HIGTextEntry()
self.command_entry.set_editable(False)
#Buttons
self.hbox_buttons = HIGHBox()
self.wiz_button = HIGButton(title='Wizard', stock='gtk-convert')
self.wiz_button.connect("clicked", self.new_wiz)
self.edit_button = HIGButton(stock='gtk-edit')
self.edit_button.connect("clicked", self.open_peditor)
self.new_button = HIGButton(stock='gtk-new')
self.new_button.connect("clicked", self.open_peditor)
self.copy_button = HIGButton(stock='gtk-copy')
self.copy_button.connect("clicked", self.copy_profiles)
self.delete_button = HIGButton(stock=gtk.STOCK_DELETE)
self.delete_button.connect('clicked', self.delete_profile)
#Apply Buttons
self.cancel_button = HIGButton(stock='gtk-close')
self.cancel_button.connect("clicked", self.quit)
self.connect("delete-event", self.quit)
def __fill_widgets(self):
self.profiles = CommandProfile()
self._reload_profile_list()
#selection = self.profiles_tv.get_selection()
#selection.connect("changed", self.change_nmap_command)
self.profiles_tv.connect("cursor-changed", self.change_nmap_command)
def __pack_widgets(self):
"""
Pack all widgets of windows
"""
self.vbox_main.pack_start(self.main_frame, True, True)
self.main_frame.add(self.align)
self.align.add(self.vbox)
self.vbox.set_border_width(6)
self.vbox.pack_start(self.profiles_sw, True, True, 0)
self.hbox_info.pack_start(self.command_label, False,False,0)
self.hbox_info.pack_start(self.command_entry, True, True, 0)
self.vbox.pack_start(self.hbox_info, False,False,0)
self.hbox_buttons.pack_end(self.cancel_button)
self.hbox_buttons.pack_end(self.copy_button, True, True)
self.hbox_buttons.pack_end(self.edit_button, True, True)
self.hbox_buttons.pack_end(self.delete_button, True, True)
self.hbox_buttons.pack_end(self.new_button, True, True)
self.hbox_buttons.pack_end(self.wiz_button, True, True)
self.hbox_buttons.set_spacing(6)
#.........这里部分代码省略.........