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


Python HIGButton.set_size_request方法代码示例

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


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

示例1: HIGClosableTabLabel

# 需要导入模块: from higwidgets.higbuttons import HIGButton [as 别名]
# 或者: from higwidgets.higbuttons.HIGButton import set_size_request [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: PeerInfoPage

# 需要导入模块: from higwidgets.higbuttons import HIGButton [as 别名]
# 或者: from higwidgets.higbuttons.HIGButton import set_size_request [as 别名]
class PeerInfoPage(HIGVBox):
    """"""
    
    #----------------------------------------------------------------------
    def __init__(self):
        """Constructor"""
        HIGVBox.__init__(self)
        self.__create_widgets()
        self.__pack_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())

    def __pack_widgets(self):
        self.set_border_width(12)

        self._pack_noexpand_nofill(self.peerinfo_section)
        self._pack_noexpand_nofill(self.peerinfo_hbox)
        self._pack_noexpand_nofill(self.pref_location_section)
        self._pack_noexpand_nofill(self.pref_location_hbox)
        self._pack_noexpand_nofill(self.cloudagg_section)
        self._pack_noexpand_nofill(self.cloudagg_hbox)
        self._pack_noexpand_nofill(self.superpeers_section)
        self._pack_noexpand_nofill(self.superpeers_hbox)

        self.peerinfo_hbox._pack_noexpand_nofill(hig_box_space_holder())
        self.peerinfo_hbox._pack_expand_fill(self.peerinfo_table)
        self.pref_location_hbox._pack_noexpand_nofill(hig_box_space_holder())
        self.pref_location_hbox._pack_expand_fill(self.pref_location_table)        
        self.cloudagg_hbox._pack_noexpand_nofill(hig_box_space_holder())
        self.cloudagg_hbox._pack_expand_fill(self.cloudagg_table)
        self.superpeers_hbox._pack_noexpand_nofill(hig_box_space_holder())
        self.superpeers_hbox._pack_expand_fill(self.superpeers_table)

        self.peerinfo_table.attach_label(self.peerid_label, 0, 1, 0, 1)
        self.peerinfo_table.attach_label(self.email_label, 0, 1, 2, 3)

        self.peerinfo_table.attach_label(self.test_version_label, 0, 1, 1, 2)
        self.peerinfo_table.attach_label(self.test_version_label2, 1, 2, 1, 2)

        self.peerinfo_table.attach_label(self.peerid_label2, 1, 2, 0, 1)
        self.peerinfo_table.attach_entry(self.email_entry, 1, 2, 2, 3)

        self.pref_location_table.attach(self.longitude_label,0,1,0,1)
        self.pref_location_table.attach(self.longitude_entry,1,2,0,1)
        self.pref_location_table.attach(self.latitude_label,2,3,0,1)
        self.pref_location_table.attach(self.latitude_entry,3,4,0,1)
        
        self.cloudagg_subhbox._pack_expand_fill(self.cloudagg_entry)
        self.cloudagg_subhbox._pack_noexpand_nofill(self.cloudagg_button)
#.........这里部分代码省略.........
开发者ID:tianweidut,项目名称:openmonitor-desktop-agent,代码行数:103,代码来源:PeerPage.py

示例3: FeedbackPage

# 需要导入模块: from higwidgets.higbuttons import HIGButton [as 别名]
# 或者: from higwidgets.higbuttons.HIGButton import set_size_request [as 别名]
class FeedbackPage(HIGVBox):
    """"""

    #----------------------------------------------------------------------
    def __init__(self):
        """Constructor"""
        HIGVBox.__init__(self)
        self.__create_widgets()
        self.__pack_widgets()
        self.__set_values()

    def __create_widgets(self):
        self.suggestion_hbox = HIGHBox()
        self.report_hbox = HIGHBox()

        self.suggestion_section = HIGSectionLabel(_("Test Suggestion"))
        self.suggestion_table = HIGTable()
        self.report_section = HIGSectionLabel(_("Bug Report"))
        self.report_table = HIGTable()

        # Website Suggestion
        self.website_suggestion_table = HIGTable()
        self.website_suggestion_slabel = HIGSectionLabel(_("Website Suggestion"))
        self.website_url_subhbox = HIGHBox()
        self.website_url_label = HIGEntryLabel(_("URL:"))
        self.website_url_entry = gtk.Entry()
        self.website_suggestion_sendbtn = HIGButton(_('Send'))
        self.website_suggestion_sendbtn.set_size_request(60, 25)
        self.website_suggestion_sendbtn.connect(
            'clicked', lambda x: self.send_website_suggestion())
        # Service Suggestion
        self.service_suggestion_table = HIGTable()
        self.service_suggestion_slabel = HIGSectionLabel(_("Service Suggestion"))
        self.service_name_subhbox = HIGHBox()
        self.service_name_label = HIGEntryLabel(_("Name:"))
        self.service_list_store = gtk.ListStore(str)
        self.service_name_entry = gtk.ComboBoxEntry(self.service_list_store, 0)
        self.service_host_subhbox = HIGHBox()
        self.service_host_label = HIGEntryLabel(_("Hostname:"))
        self.service_host_entry = gtk.Entry()
        self.service_ip_subhbox = HIGHBox()
        self.service_ip_label = HIGEntryLabel(_("IP:"))
        self.service_ip_entry = gtk.Entry()
        self.service_port_label = HIGEntryLabel(_("PORT:"))
        self.service_port_entry = gtk.Entry()        
        self.service_suggestion_sendbtn = HIGButton(_('Send'))
        self.service_suggestion_sendbtn.set_size_request(60, 25)
        self.service_suggestion_sendbtn.connect(
            'clicked', lambda x: self.send_service_suggestion())

        self.report_namelabel = HIGEntryLabel(_("Your Name:"))
        self.report_nameentry = gtk.Entry()
        #self.report_nameentry.set_has_frame(True)
        self.report_nameentry.set_size_request(100, 26)
        self.report_emaillabel = HIGEntryLabel(_("Email:"))
        self.report_emailentry = gtk.Entry()
        self.report_emailentry.set_size_request(198, 26)
        self.report_subhbox1 = HIGHBox()

        self.report_sw = gtk.ScrolledWindow()
        self.report_sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        self.report_textview = gtk.TextView()
        self.report_textbuffer = self.report_textview.get_buffer()
        self.report_textview.set_editable(True)
        self.report_textview.set_wrap_mode(True)
        self.report_textview.set_border_width(2)
        self.report_sw.add(self.report_textview)
        self.report_sw.show()
        self.report_textview.show()
        self.report_subhbox2 = HIGHBox()
        self.report_sendbtn = HIGButton(_('Send'))
        self.report_sendbtn.set_size_request(60, 25)
        self.report_sendbtn.connect('clicked', lambda x: self.send_bug_report())
        self.report_subhbox3 = HIGHBox()

    def __pack_widgets(self):
        self.set_border_width(12)

        self._pack_noexpand_nofill(self.suggestion_section)
        self._pack_noexpand_nofill(self.suggestion_hbox)
        self._pack_noexpand_nofill(self.report_section)
        self._pack_noexpand_nofill(self.report_hbox)

        #self.suggestion_hbox._pack_noexpand_nofill(hig_box_space_holder())
        #self.suggestion_hbox._pack_expand_fill(self.suggestion_table)
        #self.report_hbox._pack_noexpand_nofill(hig_box_space_holder())
        self.report_hbox._pack_expand_fill(self.report_table)


        self.suggestion_hbox._pack_expand_fill(self.suggestion_table)
        #self.suggestion_hbox._pack_expand_fill(self.service_suggestion_table)

        self.suggestion_table.attach_label(self.website_suggestion_slabel,
                                           0, 2, 0, 1)
        self.suggestion_table.attach_label(self.website_url_label,
                                           0, 1, 1, 2)
        self.suggestion_table.attach_entry(self.website_url_entry,
                                           1, 2, 1, 2)
        self.suggestion_table.attach(self.website_suggestion_sendbtn,
                                     0, 2, 2, 3, gtk.PACK_START)
#.........这里部分代码省略.........
开发者ID:gkso,项目名称:openmonitor-desktop-agent,代码行数:103,代码来源:FeedbackPage.py


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