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


Python HIGButton.hide方法代码示例

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


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

示例1: HIGClosableTabLabel

# 需要导入模块: from higwidgets.higbuttons import HIGButton [as 别名]
# 或者: from higwidgets.higbuttons.HIGButton import hide [as 别名]
class HIGClosableTabLabel(HIGHBox):
    __gsignals__ = { 'close-clicked' : (gobject.SIGNAL_RUN_LAST,
                                        gobject.TYPE_NONE, ()) }

    def __init__(self, label_text=""):
        gobject.GObject.__init__(self)
        #HIGHBox.__init__(self, spacing=4)

        self.label_text = label_text
        self.__create_widgets()

        #self.propery_map = {"label_text" : self.label.get_label}

    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

        # def do_get_property(self, property):
        #     func = self.property_map.get(property, None)
        #     if func:
        #         return func()
        #     else:
        #         raise 

    def on_entry_focus_out(self, widget, event):
        self.switch_button_mode(False)

    def on_button_press_event(self, widget, event):
        if event.type == gtk.gdk._2BUTTON_PRESS:
            self.switch_button_mode(True)

    def switch_button_mode(self, mode):
        """Switch button from editing mode (True) to label mode (False)
        """
        if mode:
            self.close_button.hide()
            self.ok_button.show()
        else:
            self.ok_button.hide()
            self.close_button.show()

    def __close_button_clicked(self, widget):
        self.emit('close-clicked')

    def __ok_button_clicked(self, widget):
        self.label.on_entry_activated(self.label.entry)
        self.switch_button_mode(False)

    def get_text(self):
        return self.label.get_text()

    def set_text(self, text):
        self.label.set_text(text)

    def get_label(self):
        return self.label.get_label()

    def set_label(self, label):
        self.label.set_text(label)

    def get_animated_label(self):
        return self.label
开发者ID:umitproject,项目名称:network-scanner-web,代码行数:90,代码来源:hignotebooks.py

示例2: Proprieties

# 需要导入模块: from higwidgets.higbuttons import HIGButton [as 别名]
# 或者: from higwidgets.higbuttons.HIGButton import hide [as 别名]
class Proprieties(HIGScrolledWindow):
    '''

    This box should be configurable 
    if widget is of a type all configuration should be change to this type

    #tricks: option_list have a icon to fill with options
    and option_check have a list of options in combo to change

    '''

    def __init__(self):
        HIGScrolledWindow.__init__(self)
        self._boxeditable = None 
        vp = gtk.Viewport()
        self._create_widgets()
        vp.add(self._box)
        vp.set_shadow_type(gtk.SHADOW_NONE)
        self.add(vp)
        self._profilecore = None 
        self._selected = None 

    def set_profilecore(self, profilecore):
        self._profilecore = profilecore


    def _create_widgets(self):
        '''
        Create the main entrys of the option 
        '''
        self._box = HIGVBox()


        self._table = HIGTable()


        #Name
        self._label_name  = HIGEntryLabel(_('Name'))
        self._entry_name = HIGTextEntry()

        self._entry_name.connect('activate', self._update_label)

        #Type 
        self._label_type = HIGEntryLabel(_('Type'))	
        self._combo_type = gtk.combo_box_new_text()
        self._combo_type.append_text('')
        self._combo_type.append_text('Option List')
        self._combo_type.append_text('Option Check')
        self._combo_type.set_active(0)
        self._combo_type.connect('changed', self.change_combo)

        self._label_opt = HIGEntryLabel(_('Option'))
        self._entry_opt = HIGTextEntry()
        self._entry_opt.set_sensitive(False)

        #For option list open a dialog to add/remove options
        self._button_list = HIGButton('Edit Option List')
        img = gtk.Image()
        img_dir =  os.path.join(pixmaps_dir, 'uie', 'combo.png')
        img.set_from_file(img_dir)
        self._button_list.set_image(img)
        self._button_list.connect('button-press-event', self._button_list_clicked)


        self._table.attach(self._label_name, 0,1,0, 1)
        self._table.attach(self._entry_name, 1,2,0,1)
        self._table.attach(self._label_type, 0,1,1,2)
        self._table.attach(self._combo_type, 1,2,1, 2)

        self._table.attach(self._button_list, 0,2, 3,4)
        self._table.attach(self._label_opt, 0,1, 4,5)
        self._table.attach(self._entry_opt, 1,2,4,5)

        self._box.pack_start(self._table, False, False)
    def _button_list_clicked(self, widget, event):
        section_name = self._boxeditable.get_name()
        lm = ListManager(self._entry_name.get_text(),section_name, 
                         self._profilecore, self._selected, _('List of items'))
    def _update_label(self, widget):
        #XXX Replace by Command
        log.debug("Update Label")
        selected = self._selected
        cmd = CommandChangeLabel(selected, self._entry_name.get_text(), 
                                 self._profilecore,self._boxeditable, True)
        command_manager.add_command(cmd)
        
    def change_combo(self,combo):
        model = combo.get_model()
        index = combo.get_active()
        if index:
            if model[index][0]=='Option List':

                log.debug('Show Button List ')
                self._button_list.show()

            else:

                log.debug('Hide Button List ')
                self._button_list.hide()
        return
#.........这里部分代码省略.........
开发者ID:aregee,项目名称:network-scanner,代码行数:103,代码来源:Tools.py

示例3: PluginPage

# 需要导入模块: from higwidgets.higbuttons import HIGButton [as 别名]
# 或者: from higwidgets.higbuttons.HIGButton import hide [as 别名]
class PluginPage(gtk.VBox):
    def __init__(self, parent):
        gtk.VBox.__init__(self, False, 2)

        self.p_window = parent
        self.menu_enabled = True

        self.__create_widgets()
        self.__pack_widgets()

        self.install_updates_btn.hide()

    def __create_widgets(self):
        self.set_spacing(4)

        self.richlist = HIGRichList()

        self.hbbox = gtk.HButtonBox()
        self.hbbox.set_layout(gtk.BUTTONBOX_END)

        self.find_updates_btn = \
            HIGButton(_('Find updates'), gtk.STOCK_REFRESH)
        self.install_updates_btn = \
            HIGButton(_('Install updates'), gtk.STOCK_APPLY)
        self.skip_install_btn = \
            HIGButton(_('Skip'), gtk.STOCK_CANCEL)
        self.restart_btn = \
            HIGButton(_('Restart UMIT'), gtk.STOCK_REFRESH)

    def __pack_widgets(self):
        self.hbbox.pack_start(self.find_updates_btn)
        self.hbbox.pack_start(self.skip_install_btn)
        self.hbbox.pack_start(self.install_updates_btn)
        self.hbbox.pack_start(self.restart_btn)

        self.pack_start(self.richlist)
        self.pack_start(self.hbbox, False, False, 0)

        self.find_updates_btn.connect('clicked', self.__on_find_updates)
        self.install_updates_btn.connect('clicked', self.__on_install_updates)
        self.skip_install_btn.connect('clicked', self.__on_skip_updates)
        self.restart_btn.connect('clicked', self.__on_restart)

        self.show_all()

    def clear(self, include_loaded=True):
        if include_loaded:
            self.richlist.clear()
            return

        def remove(row, richlist):
            if not row.reader.enabled:
                richlist.remove_row(row)

        self.richlist.foreach(remove, self.richlist)
        return self.richlist.get_rows()

    def populate(self):
        "Populate the richlist using available_plugins field"

        # We need a list of present plugin row to check for dup
        presents = []

        def add_to_list(row, list):
            list.append(row)

        self.richlist.foreach(add_to_list, presents)

        warn_reboot = False

        # We have to load available_plugins from engine
        for reader in self.p_window.engine.available_plugins:

            # Check if it's already present then remove the original
            # and add the new in case something is getting update.
            row = PluginRow(self.richlist, reader)

            for old in presents:
                # FIXME? we need to check also for version equality
                # and if are different just ignore the addition and
                # continue with the loop
                if old.reader.get_path() == row.reader.get_path():
                    self.richlist.remove_row(old)
                    row.enabled = True
                    warn_reboot = True

            # Connect the various buttons
            row.action_btn.connect('clicked', self.__on_row_action, row)
            row.uninstall_btn.connect('clicked', self.__on_row_uninstall, row)
            row.preference_btn.connect('clicked', self.__on_row_preference, row)

            row.connect('clicked', self.__on_row_preference, row)
            row.connect('popup', self.__on_row_popup)

            self.richlist.append_row(row)

        if warn_reboot:
            # Warn the user
            self.p_window.animated_bar.label = \
                _('Remember that you have to restart UMIT to make new version' \
#.........这里部分代码省略.........
开发者ID:aregee,项目名称:network-scanner,代码行数:103,代码来源:PluginPage.py


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