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


Python HIGHBox.set_border_width方法代码示例

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


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

示例1: delete_profile

# 需要导入模块: from zenmapGUI.higwidgets.higboxes import HIGHBox [as 别名]
# 或者: from zenmapGUI.higwidgets.higboxes.HIGHBox import set_border_width [as 别名]
    def delete_profile(self, widget=None, extra=None):
        if self.deletable:
            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 True
            self.profile.remove_profile(self.profile_name)

        self.update_profile_entry()
        self.destroy()
开发者ID:mogi57,项目名称:nmap-5.61TEST4-android,代码行数:36,代码来源:ProfileEditor.py

示例2: ProfileEditor

# 需要导入模块: from zenmapGUI.higwidgets.higboxes import HIGHBox [as 别名]
# 或者: from zenmapGUI.higwidgets.higboxes.HIGHBox import set_border_width [as 别名]

#.........这里部分代码省略.........
        self.help_field.get_buffer().set_text(
                "Description\n\nThe description is a full description of what "
                "the scan does, which may be long.")

    def __create_widgets(self):

        ###
        # Vertical box to keep 3 boxes
        self.main_whole_box = HIGVBox()

        self.upper_box = HIGHBox()
        self.middle_box = HIGHBox()
        self.lower_box = HIGHBox()

        #self.main_vbox = HIGVBox()
        self.command_entry = gtk.Entry()
        self.command_entry_changed_cb_id = self.command_entry.connect(
                "changed", self.command_entry_changed_cb)

        self.scan_button = HIGButton(_("Scan"))
        self.scan_button.connect("clicked", self.run_scan)

        self.notebook = gtk.Notebook()

        # Profile info page
        self.profile_info_vbox = HIGVBox()
        self.profile_info_label = HIGSectionLabel(_('Profile Information'))
        self.profile_name_label = HIGEntryLabel(_('Profile name'))
        self.profile_name_entry = gtk.Entry()
        self.profile_name_entry.connect(
                'enter-notify-event', self.update_help_name)
        self.profile_description_label = HIGEntryLabel(_('Description'))
        self.profile_description_scroll = HIGScrolledWindow()
        self.profile_description_scroll.set_border_width(0)
        self.profile_description_text = HIGTextView()
        self.profile_description_text.connect(
                'motion-notify-event', self.update_help_desc)

        # Buttons
        self.buttons_hbox = HIGHBox()

        self.cancel_button = HIGButton(stock=gtk.STOCK_CANCEL)
        self.cancel_button.connect('clicked', self.exit)

        self.delete_button = HIGButton(stock=gtk.STOCK_DELETE)
        self.delete_button.connect('clicked', self.delete_profile)

        self.save_button = HIGButton(_("Save Changes"), stock=gtk.STOCK_SAVE)
        self.save_button.connect('clicked', self.save_profile)

        ###
        self.help_vbox = HIGVBox()
        self.help_label = HIGSectionLabel(_('Help'))
        self.help_scroll = HIGScrolledWindow()
        self.help_scroll.set_border_width(0)
        self.help_field = HIGTextView()
        self.help_field.set_cursor_visible(False)
        self.help_field.set_left_margin(5)
        self.help_field.set_editable(False)
        self.help_vbox.set_size_request(200, -1)
        ###

    def __pack_widgets(self):

        ###
        self.add(self.main_whole_box)
开发者ID:mogigoma,项目名称:nmap,代码行数:70,代码来源:ProfileEditor.py

示例3: CrashReport

# 需要导入模块: from zenmapGUI.higwidgets.higboxes import HIGHBox [as 别名]
# 或者: from zenmapGUI.higwidgets.higboxes.HIGHBox import set_border_width [as 别名]
class CrashReport(HIGDialog):
    def __init__(self, type, value, tb):
        HIGDialog.__init__(self)
        gtk.Window.__init__(self)
        self.set_title(_('Crash Report'))
        self.set_position(gtk.WIN_POS_CENTER_ALWAYS)

        self._create_widgets()
        self._pack_widgets()
        self._connect_widgets()

        trace = "".join(traceback.format_exception(type, value, tb))
        text = "Version: " + VERSION + "\n" + trace
        self.description_text.get_buffer().set_text(text)

    def _create_widgets(self):
        self.button_box = gtk.HButtonBox()
        self.button_box_ok = gtk.HButtonBox()

        self.description_scrolled = gtk.ScrolledWindow()
        self.description_text = gtk.TextView()
        self.description_text.set_editable(False)

        self.bug_text = gtk.Label()
        self.bug_text.set_markup(_("""\
An unexpected error has crashed %(app_name)s. Please copy the stack trace below and \
send it to the <a href="mailto:[email protected]">[email protected]</a> \
mailing list. (<a href="http://seclists.org/nmap-dev/">More about the list.</a>) \
The developers will see your report and try to fix the problem.""") % \
    { "app_name": escape(APP_DISPLAY_NAME) })
        self.email_frame = gtk.Frame()
        self.email_label = gtk.Label()
        self.email_label.set_markup(_("""\
<b>Copy and email to <a href="mailto:[email protected]">[email protected]</a>:</b>\
"""))
        self.btn_copy = gtk.Button(stock=gtk.STOCK_COPY)
        self.btn_ok = gtk.Button(stock=gtk.STOCK_OK)

        self.hbox = HIGHBox()

    def _pack_widgets(self):
        self.description_scrolled.add(self.description_text)
        self.description_scrolled.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        self.description_scrolled.set_size_request(400, 150)
        self.description_text.set_wrap_mode(gtk.WRAP_WORD)

        self.bug_text.set_line_wrap(True)
        self.email_label.set_line_wrap(True)

        self.email_frame.set_label_widget(self.email_label)
        self.email_frame.set_shadow_type(gtk.SHADOW_NONE)

        self.hbox.set_border_width(6)
        self.vbox.set_border_width(6)

        self.hbox._pack_expand_fill(self.bug_text)

        self.button_box.set_layout(gtk.BUTTONBOX_START)
        self.button_box_ok.set_layout(gtk.BUTTONBOX_END)

        self.button_box.pack_start(self.btn_copy)
        self.button_box_ok.pack_start(self.btn_ok)

        self.vbox.pack_start(self.hbox)
        self.vbox.pack_start(self.email_frame)
        self.vbox.pack_start(self.description_scrolled)
        self.vbox.pack_start(self.button_box)
        self.action_area.pack_start(self.button_box_ok)

    def _connect_widgets(self):
        self.btn_ok.connect("clicked", self.close)
        self.btn_copy.connect("clicked", self.copy)
        self.connect("delete-event", self.close)

    def get_description(self):
        buff = self.description_text.get_buffer()
        return buff.get_text(buff.get_start_iter(), buff.get_end_iter())

    def copy(self, widget=None, event=None):
        clipboard = gtk.clipboard_get()
        clipboard.set_text(self.get_description())
        clipboard.store()

    def close(self, widget=None, event=None):
        self.destroy()
        gtk.main_quit()
        sys.exit(0)
开发者ID:CoolisTheName007,项目名称:nmap,代码行数:89,代码来源:CrashReport.py


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