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


Python HIGHBox.show_all方法代码示例

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


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

示例1: SaveDialog

# 需要导入模块: from higwidgets.higboxes import HIGHBox [as 别名]
# 或者: from higwidgets.higboxes.HIGHBox import show_all [as 别名]
class SaveDialog(gtk.FileChooserDialog):
    def __init__(self):
        """
        """
        super(SaveDialog, self).__init__(
            title=_("Save Topology"),
            action=gtk.FILE_CHOOSER_ACTION_SAVE,
            buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE, gtk.RESPONSE_OK),
        )

        self.__combo = gtk.combo_box_new_text()

        types_list = TYPES.keys()
        types_list.sort()

        for i in types_list:
            self.__combo.append_text(i)

        self.__combo.set_active(1)
        self.__label = HIGLabel(_("Select the output type:"))

        self.__hbox = HIGHBox()
        self.__hbox._pack_noexpand_nofill(self.__label)
        self.__hbox._pack_expand_fill(self.__combo)

        self.set_extra_widget(self.__hbox)
        self.set_do_overwrite_confirmation(True)

        self.__hbox.show_all()

    def show_error(self):
        """
        """
        alert = HIGAlertDialog(
            parent=self,
            type=gtk.MESSAGE_ERROR,
            message_format=_("Can't create file"),
            secondary_text=_("Please check if you have permission to " "write this file."),
        )
        alert.run()
        alert.destroy()

    def get_filetype(self):
        """
        """
        return TYPES[self.__combo.get_active_text()]
开发者ID:tianweidut,项目名称:network-scanner,代码行数:48,代码来源:SaveDialog.py

示例2: ControlFisheye

# 需要导入模块: from higwidgets.higboxes import HIGHBox [as 别名]
# 或者: from higwidgets.higboxes.HIGHBox import show_all [as 别名]
class ControlFisheye(HIGVBox):
    """
    """
    def __init__(self, radialnet):
        """
        """
        HIGVBox.__init__(self)
        self.set_border_width(6)

        self.radialnet = radialnet
        self.__ring_max_value = self.radialnet.get_number_of_rings()

        self.__create_widgets()


    def __create_widgets(self):
        """
        """
        self.__params = HIGVBox()
        self.__params_main = HIGHBox()
        self.__params_options = HIGHBox()

        self.__fisheye_label = gtk.Label('Fisheye on ring')

        self.__ring = gtk.Adjustment(0, 0, self.__ring_max_value, 0.01, 0.01)

        self.__ring_spin = gtk.SpinButton(self.__ring)
        self.__ring_spin.set_digits(2)

        self.__ring_scale = gtk.HScale(self.__ring)
        self.__ring_scale.set_size_request(100, -1)
        self.__ring_scale.set_digits(2)
        self.__ring_scale.set_value_pos(gtk.POS_LEFT)
        self.__ring_scale.set_draw_value(False)
        self.__ring_scale.set_update_policy(gtk.UPDATE_CONTINUOUS)

        self.__interest_label = gtk.Label('Interest factor')
        self.__interest = gtk.Adjustment(0, 0, 10, 0.01)
        self.__interest_spin = gtk.SpinButton(self.__interest)
        self.__interest_spin.set_digits(2)

        self.__spread_label = gtk.Label('Spread factor')
        self.__spread = gtk.Adjustment(0, -1.0, 1.0, 0.01, 0.01)
        self.__spread_spin = gtk.SpinButton(self.__spread)
        self.__spread_spin.set_digits(2)

        self.__options_button = gtk.ToggleButton('More')
        self.__options_button.set_active(False)

        self.__params._pack_noexpand_nofill(self.__params_main)
        self.__params._pack_noexpand_nofill(self.__params_options)

        self.__params_main._pack_noexpand_nofill(self.__fisheye_label)
        self.__params_main._pack_noexpand_nofill(self.__ring_spin)
        self.__params_main._pack_expand_fill(self.__ring_scale)
        self.__params_main._pack_noexpand_nofill(self.__options_button)

        self.__params_options._pack_noexpand_nofill(self.__interest_label)
        self.__params_options._pack_noexpand_nofill(self.__interest_spin)
        self.__params_options._pack_noexpand_nofill(self.__spread_label)
        self.__params_options._pack_noexpand_nofill(self.__spread_spin)

        self.__params_options.set_no_show_all(True)
        self.__params_options.hide()

        self._pack_noexpand_nofill(self.__params)

        self.__ring.connect('value_changed', self.__change_ring)
        self.__interest.connect('value_changed', self.__change_interest)
        self.__spread.connect('value_changed', self.__change_spread)

        self.__options_button.connect('toggled', self.__options_toggled)

        gobject.timeout_add(REFRESH_RATE, self.__update_fisheye)


    def __update_fisheye(self):
        """
        """
        # adjust ring scale to radialnet number of nodes
        ring_max_value = self.radialnet.get_number_of_rings() - 1

        if ring_max_value != self.__ring_max_value:

            value = self.__ring.get_value()

            if value == 0 and ring_max_value != 0:
                value = 1

            elif value > ring_max_value:
                value = ring_max_value

            self.__ring.set_all(value, 1, ring_max_value, 0.01, 0.01, 0)
            self.__ring_max_value = ring_max_value

            self.__ring_scale.queue_draw()

        # check ring value
        ring_value = self.radialnet.get_fisheye_ring()

#.........这里部分代码省略.........
开发者ID:aregee,项目名称:network-scanner,代码行数:103,代码来源:ControlWidget.py


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