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


Python higbuttons.HIGButton类代码示例

本文整理汇总了Python中higwidgets.higbuttons.HIGButton的典型用法代码示例。如果您正苦于以下问题:Python HIGButton类的具体用法?Python HIGButton怎么用?Python HIGButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: __create_widgets

    def __create_widgets(self):
        self.vbox = HIGVBox()
        self.hbox = HIGHBox()
        self.img_logo = gtk.Image()
        self.event_img_logo = gtk.EventBox()
        self.img = 1
        
        self.d = {}
        for c in (65, 97):
            for i in range(26):
                self.d[chr(i+c)] = chr((i+13) % 26 + c)
        
        self.lbl_program_version = gtk.Label("""\
<span size='30000' weight='heavy'>Umit %s</span>""" % VERSION)
        
        self.lbl_program_description = gtk.Label(\
            _("""Umit is network scanning frontend,
developed in PyGTK by Adriano Monteiro 
Marques <[email protected]>
and was sponsored by Google during the
Summer of Code 2005, 2006, 2007, 2008 and 2009. Thanks Google!"""))
        
        self.lbl_copyright=gtk.Label("<small>Copyright (C) 2005-2006 \
Insecure.Com LLC. and (C) 2007-2009 Adriano Monteiro Marques</small>")
        
        self.lbl_program_website = gtk.Label(\
            "<span underline='single' \
            foreground='blue'>http://www.umitproject.org</span>")
        
        self.btn_close = HIGButton(stock=gtk.STOCK_CLOSE)
        self.btn_credits = HIGButton(_("Credits"))
开发者ID:aregee,项目名称:network-scanner,代码行数:31,代码来源:About.py

示例2: __init__

    def __init__(self, option=None):
        OptionDisplay.__init__(self)
        #Profile and Wizard core
        self._profilecore = None 
        self._wizardcore = None 
        self._notebook= None
        self._profile = None 
        self._wizard = None 
        self._changed = False

        hbox = HIGHBox()
        hbox.set_border_width(12)
        self.delete_button = HIGButton(stock='gtk-delete')
        self.delete_button.connect('clicked', self.delete_option)
        self.new_button = HIGButton(stock='gtk-new')
        self.new_button.connect('clicked', self.new_option)
        self.update_button = HIGButton(stock='gtk-refresh')
        self.update_button.connect('clicked', self.update_option)
        self.add_button = HIGButton(stock='gtk-add')
        self.add_button.connect('clicked', self.add_option)
        hbox.pack_end(self.delete_button,False,False)
        hbox.pack_end(self.update_button, False, False)
        hbox.pack_end(self.add_button, False, False)
        hbox.pack_end(self.new_button, False,False)
        self.attach(hbox, 1,2,6,7)

        self.optionlist = option
开发者ID:aregee,项目名称:network-scanner,代码行数:27,代码来源:OptionManager.py

示例3: __create_widgets

    def __create_widgets(self):
        self.label = HIGAnimatedLabel(self.label_text)
        
        self.close_image = gtk.Image()
        self.close_image.set_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_BUTTON)
        self.close_button = HIGButton()
        self.close_button.set_size_request(22, 22)
        self.close_button.set_relief(gtk.RELIEF_NONE)
        self.close_button.set_focus_on_click(False)
        self.close_button.add(self.close_image)

        self.ok_image = gtk.Image()
        self.ok_image.set_from_stock(gtk.STOCK_APPLY, gtk.ICON_SIZE_BUTTON)
        self.ok_button = HIGButton()
        self.ok_button.set_size_request(22, 22)
        self.ok_button.set_relief(gtk.RELIEF_NONE)
        self.ok_button.set_focus_on_click(False)
        self.ok_button.add(self.ok_image)

        self.close_button.connect('clicked', self.__close_button_clicked)
        self.ok_button.connect('clicked', self.__ok_button_clicked)
        self.label.connect('button-press-event', self.on_button_press_event)
        self.label.entry.connect('focus-out-event', self.on_entry_focus_out)

        for w in (self.label, self.close_button, self.ok_button):
            self.pack_start(w, False, False, 0)

        self.show_all()
        self.switch_button_mode(False) # Change to label mode
开发者ID:umitproject,项目名称:network-scanner-web,代码行数:29,代码来源:hignotebooks.py

示例4: OptionFile

class OptionFile(HIGHBox, OptionWidget, object):
    def __init__(self, param=""):
        HIGHBox.__init__(self)

        self.entry = OptionEntry()
        self.button = HIGButton(stock=gtk.STOCK_OPEN)

        self._pack_expand_fill(self.entry)
        self._pack_noexpand_nofill(self.button)

        self.entry.set_text(param)
        self.button.connect('clicked', self.open_dialog_cb)

    def open_dialog_cb(self, widget):
        dialog = AllFilesFileChooserDialog(_("Choose file"))
        if dialog.run() == gtk.RESPONSE_OK:
            self.entry.set_text(dialog.get_filename())
        dialog.destroy()

    def get_filename(self):
        return "\ ".join(self.entry.get_text().split(" "))

    def set_filename(self, filename):
        self.entry.set_text(" ".join(filename.split("\ ")))

    filename = property(get_filename, set_filename)
开发者ID:aregee,项目名称:network-scanner,代码行数:26,代码来源:OptionBuilder.py

示例5: PathEntry

class PathEntry(HIGHBox, object):
    def __init__(self):
        HIGHBox.__init__(self)
        self.entry = gtk.Entry()
        self.button = HIGButton(stock=gtk.STOCK_OPEN)

        self.entry.set_width_chars(20)
        self.button.connect("clicked", self.open_dialog)
        
        self._pack_expand_fill(self.entry)
        self._pack_noexpand_nofill(self.button)

    def connect_entry_change(self, method):
        self.entry.connect("focus-out-event", method)

    def open_dialog(self, widget):
        dialog = DirectoryChooserDialog(title=_("Choose the path to search in"))
        dialog.run()
        self.path = dialog.get_filename()
        self.entry.grab_focus()
        dialog.destroy()

    def get_path(self):
        return self.entry.get_text()

    def set_path(self, path):
        self.entry.set_text(path)

    path = property(get_path, set_path)
开发者ID:aregee,项目名称:network-scanner,代码行数:29,代码来源:SearchGUI.py

示例6: _create_widgets

    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()
开发者ID:aregee,项目名称:network-scanner,代码行数:33,代码来源:Tools.py

示例7: _create_action_area

 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()
开发者ID:aregee,项目名称:network-scanner,代码行数:8,代码来源:Tools.py

示例8: __create_buttons

    def __create_buttons(self):
        # bottom buttons
        self.apply = HIGButton(stock=gtk.STOCK_APPLY)
        self.cancel = HIGButton(stock=gtk.STOCK_CANCEL)
        self.ok = HIGButton(stock=gtk.STOCK_OK)

        self.apply.connect("clicked", self._apply_settings)
        self.ok.connect("clicked", self._apply_settings_exit)
        self.cancel.connect("clicked", self._exit)
开发者ID:aregee,项目名称:network-scanner,代码行数:9,代码来源:SettingsWin.py

示例9: __init__

    def __init__(self):
        HIGWindow.__init__(self)
        
        self.wtitle = _("SMTP Account Editor")

        # header
        self.title_markup = "<span size='16500' weight='heavy'>%s</span>"
        self.ttitle = HIGEntryLabel("")
        self.ttitle.set_line_wrap(False)
        self.ttitle.set_markup(self.title_markup % self.wtitle)
        self.umit_logo = gtk.Image()
        self.umit_logo.set_from_file(logo)
        # schemas name
        self.schema_name_lbl = HIGEntryLabel(_("Schema name"))
        self.schema_name = gtk.combo_box_entry_new_text()
        self.schema_name.connect('changed', self._check_schema)
        # smtp server
        self.smtp_server_lbl = HIGEntryLabel(_("Server"))
        self.smtp_server = gtk.Entry()
        self.smtp_port_lbl = HIGEntryLabel(_("Port"))
        self.smtp_port = gtk.Entry()
        # sending mail..
        self.smtp_mailfrom_lbl = HIGEntryLabel(_("Mail from"))
        self.smtp_mailfrom = gtk.Entry()
        # smtp auth
        self.smtp_need_auth = gtk.CheckButton(_("Servers requires authentication"))
        self.smtp_need_auth.connect('toggled', self._auth_need)
        self.smtp_login_lbl = HIGEntryLabel(_("Username"))
        self.smtp_login = gtk.Entry()
        self.smtp_passwd_lbl = HIGEntryLabel(_("Password"))
        self.smtp_passwd = gtk.Entry()
        self.smtp_passwd.set_visibility(False)
        self._auth_need(None)
        # smtp encryption
        self.smtp_encrypt_tls = gtk.CheckButton(_("Use TLS Encryption"))

        """
        Missing: SSL encryption,
                 Other authentication methods.
        """ 

        # bottom buttons
        self.help = HIGButton(stock=gtk.STOCK_HELP)
        self.help.connect('clicked', self._show_help)
        self.apply = HIGButton(stock=gtk.STOCK_APPLY)
        self.apply.connect('clicked', self._save_schema)
        self.cancel = HIGButton(stock=gtk.STOCK_CANCEL)
        self.cancel.connect('clicked', self._exit)
        self.ok = HIGButton(stock=gtk.STOCK_OK)
        self.ok.connect('clicked', self._save_schema_and_leave)
        
        self.load_schemas()
        
        self.__set_props()
        self.__do_layout()

        self.connect('destroy', self._exit)
开发者ID:aregee,项目名称:network-scanner,代码行数:57,代码来源:SMTPSetup.py

示例10: __create_widgets

 def __create_widgets(self):
     self.property_name_label = HIGEntryLabel("")
     self.example_label = HIGEntryLabel("")
     self.bold_tg_button = HIGToggleButton(" ", gtk.STOCK_BOLD)
     self.italic_tg_button = HIGToggleButton(" ", gtk.STOCK_ITALIC)
     self.underline_tg_button = HIGToggleButton(" ", gtk.STOCK_UNDERLINE)
     self.text_color_button = HIGButton(_("Text"),
                                        stock=gtk.STOCK_SELECT_COLOR)
     self.highlight_color_button = HIGButton(_("Highlight"),
                                             stock=gtk.STOCK_SELECT_COLOR)
开发者ID:aregee,项目名称:network-scanner,代码行数:10,代码来源:NmapOutputProperties.py

示例11: About

class About(HIGWindow):
    def __init__(self):
        HIGWindow.__init__(self)

        self.lbl_program_version = gtk.Label(
                ("<span size='30000' weight='heavy'>UMIT %s</span>" % VERSION) +
                ("\n<span size='10000' weight='heavy'>Network Inventory ") +
                _("Build") + (" %s</span>" % __version__))

        self.lbl_program_description = gtk.Label(
                _("UMIT Network Inventory and UMIT Scheduler are UMIT\n") +
                _("extensions developed by") + (" %s\n" % __author__) +
                _("and was sponsored by Google during the Summer of Code "
                    "2007.\nThanks Google!"))

        self.logo_img = gtk.Image()
        self.logo_img.set_from_file(logo)
        self.btn_close = HIGButton(stock=gtk.STOCK_CLOSE)

        self.btn_close.connect('clicked', lambda x, y=None:self.destroy())

        self.__set_props()
        self.__do_layout()


    def __set_props(self):
        """
        Set widget properties.
        """
        self.set_title(_("About UMIT Network Inventory"))
        self.set_position(gtk.WIN_POS_CENTER)
        self.lbl_program_version.set_use_markup(True)
        self.lbl_program_description.set_justify(gtk.JUSTIFY_CENTER)

        self.lbl_program_description.set_selectable(True)
        self.lbl_program_version.set_selectable(True)


    def __do_layout(self):
        """
        Layout window widgets.
        """
        main_vbox = HIGVBox()
        btns_box = HIGHBox()

        main_vbox.pack_start(self.logo_img)
        main_vbox.pack_start(self.lbl_program_version)
        main_vbox.pack_start(self.lbl_program_description)

        btns_box.pack_end(self.btn_close)
        main_vbox._pack_noexpand_nofill(btns_box)

        self.btn_close.grab_focus()

        self.add(main_vbox)
开发者ID:aregee,项目名称:network-scanner,代码行数:55,代码来源:About.py

示例12: ScriptManagerProgressWindow

class ScriptManagerProgressWindow(HIGWindow):
    def __init__(self, parent):
        HIGWindow.__init__(self)
        self.set_title(_("Script Manager Progress"))
        self.set_position(gtk.WIN_POS_CENTER)
        self.set_size_request(300, 200)
        self.vbox = HIGVBox()
        self.label = gtk.Label()
        self.vbox.pack_start(self.label)
        self.progress_all = HIGLabeledProgressBar(_("Overall progress"))
        self.vbox.pack_start(self.progress_all)
        self.progress_current = HIGLabeledProgressBar(_("Current source"))
        self.vbox.pack_start(self.progress_current)
        self.btn_cancel = HIGButton(stock=gtk.STOCK_CANCEL)
        self.btn_cancel.connect("clicked", self._cancel_cb)
        self.vbox.pack_start(self.btn_cancel)
        self.add(self.vbox)
        self.show_all()
        self.timeout_id = gobject.timeout_add(100, self.callback)
        self.status = (None, None, None)
        import thread
        self.lock = thread.allocate_lock()
        reload_thread(parent.base, self, self.lock)
        #thread.start_new_thread(reload_thread, (parent.base, self, self.lock))
        #self.thread = ScriptManagerReloadThread(parent.base)
        #self.thread.start()

    def _cancel_cb(self, widget):
        if self.timeout_id:
            gobject.source_remove(self.timeout_id)
        self.lock.acquire()
        self.destroy()
        
    def callback(self):
        src, all, current = self.status
        print "cb:", self.status
        if src:
            self.label.set_text(src.path)
        if all:
            if all[0] == all[1]:
                gobject.source_remove(self.timeout_id)
                self.timeout_id = None
            self.progress_all.progress_bar.set_fraction(float(all[0])/all[1])
            self.progress_all.label.set_text("%d/%d" % all)
        else:
            self.progress_all.progress_bar.set_fraction(0)
            self.progress_all.label.set_text("")
        if current:
            self.progress_current.progress_bar.set_fraction(float(current[0])/current[1])
            self.progress_current.label.set_text("%d/%d" % current)
        else:
            self.progress_current.progress_bar.set_fraction(0)
            self.progress_current.label.set_text("")
开发者ID:aregee,项目名称:network-scanner,代码行数:53,代码来源:ScriptManager.py

示例13: __create_widgets

    def __create_widgets(self):
        """"""
        self.peerinfo_hbox      = HIGHBox()
        self.cloudagg_hbox      = HIGHBox()
        self.superpeers_hbox    = HIGHBox()
        self.pref_location_hbox = HIGHBox()

        self.peerinfo_section = HIGSectionLabel(_("Peer Info"))
        self.peerinfo_table = HIGTable()
        
        self.pref_location_section = HIGSectionLabel(_("Preferred Locations"))
        self.pref_location_table = HIGTable()
        
        self.cloudagg_section = HIGSectionLabel(_("Cloud Aggregator"))
        self.cloudagg_table = HIGTable()
        self.cloudagg_subhbox = HIGHBox()
        self.superpeers_section = HIGSectionLabel(_("Super Peers"))
        self.superpeers_table = HIGTable()

        self.peerid_label = HIGEntryLabel(_("Peer ID:"))
        self.email_label = HIGEntryLabel(_("Email Address:")) 
        self.test_version_label = HIGEntryLabel(_("Test Sets Version:")) 
        self.peerid_label2 = HIGEntryLabel()
        self.email_entry = gtk.Entry()
        self.test_version_label2 = HIGEntryLabel()        

        self.longitude_label = HIGLabel(_("longitude:"))
        self.longitude_entry = gtk.Entry()
        self.latitude_label = HIGLabel(_("latitude:"))
        self.latitude_entry = gtk.Entry()                  

        self.cloudagg_entry = gtk.Entry()
        self.cloudagg_button = HIGButton(_("Reset"))
        self.cloudagg_button.connect('clicked', lambda w: self.reset_aggregator_url())
                                      
        self.cloudagg_button.set_size_request(80, 28)

        self.superpeers_ip_label = HIGLabel(_("IP:"))
        self.superpeers_ip_entry = gtk.Entry()
        self.superpeers_ip_entry.set_size_request(160, 26)
        self.superpeers_port_label = HIGLabel(_("Port:"))
        self.superpeers_port_entry = gtk.Entry()
        self.superpeers_port_entry.set_size_request(80, 26)        
        
        self.superpeers_subhbox = HIGHBox()
        self.btn_box = gtk.HButtonBox()
        self.superpeers_button1 = HIGButton(_("Add"))
        self.superpeers_button1.connect('clicked',lambda w:self.add_superpeer())
                        
        self.superpeers_button2 = HIGButton(_("Show all"))
        self.superpeers_button2.connect('clicked', lambda w:
                                        self.show_super_peer_list_window())
开发者ID:tianweidut,项目名称:openmonitor-desktop-agent,代码行数:52,代码来源:PeerPage.py

示例14: TimeBox

class TimeBox(gtk.HBox):
    """
    GUI Controls for handling Timeline date visualization.
    """

    def __init__(self, connector, tlbase):
        gtk.HBox.__init__(self)

        self.connector = connector
        self.tlbase = tlbase

        self.connector.connect('date-changed', self._update_current_date)

        # viewing by
        cur_mode = view_mode_descr[self.tlbase.graph_mode]
        self.dateselect_lbl = HIGEntryLabel(cur_mode)
        values = self.tlbase.bounds_by_graphmode()
        self.dateselect = gtk.SpinButton(gtk.Adjustment(value=values[2],
            lower=values[0], upper=values[1], step_incr=1), 1)
        self.dateselect_apply = HIGButton(stock=gtk.STOCK_APPLY)
        self.dateselect_apply.connect("clicked", self._date_change)

        self.__layout()


    def _date_change(self, event):
        """
        Sends new date.
        """
        self.connector.emit('date-update', self.dateselect.get_value_as_int())


    def _update_current_date(self, event):
        """
        Update spinbutton and values based on new date.
        """
        cur_mode = view_mode_descr[self.tlbase.graph_mode]
        self.dateselect_lbl.set_label(cur_mode)

        values = self.tlbase.bounds_by_graphmode()
        self.dateselect.set_range(values[0], values[1])
        self.dateselect.set_value(values[2])


    def __layout(self):
        """
        Layout widgets.
        """
        self.pack_start(self.dateselect_lbl, False, False, 0)
        self.pack_start(self.dateselect, False, False, 0)
        self.pack_start(self.dateselect_apply, False, False, 0)
开发者ID:aregee,项目名称:network-scanner,代码行数:51,代码来源:TLToolbar.py

示例15: __create_widgets

    def __create_widgets(self):
        self.image = gtk.image_new_from_pixbuf(self._reader.get_logo())

        self.label = gtk.Label('')
        self.label.set_ellipsize(pango.ELLIPSIZE_END)

        self.versions_model = gtk.ListStore(str, str)
        self.versions_button = gtk.ComboBox(self.versions_model)

        rend = gtk.CellRendererPixbuf()
        self.versions_button.pack_start(rend, False)
        self.versions_button.add_attribute(rend, 'stock-id', 0)

        rend = gtk.CellRendererText()
        self.versions_button.pack_end(rend)
        self.versions_button.add_attribute(rend, 'text', 1)

        self.img_play = gtk.image_new_from_stock(gtk.STOCK_MEDIA_PLAY, \
                                                 gtk.ICON_SIZE_BUTTON)
        self.img_stop = gtk.image_new_from_stock(gtk.STOCK_MEDIA_STOP, \
                                                 gtk.ICON_SIZE_BUTTON)

        self.action_btn = HIGButton('')
        self.uninstall_btn = HIGButton(_("Uninstall"), gtk.STOCK_CLEAR)
        self.preference_btn = HIGButton(stock=gtk.STOCK_PREFERENCES)

        self.progressbar = gtk.ProgressBar()
开发者ID:aregee,项目名称:network-scanner,代码行数:27,代码来源:higrichlists.py


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