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


Python QtHelp._name_mangle方法代码示例

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


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

示例1: _create_info_window

# 需要导入模块: from ginga.qtw import QtHelp [as 别名]
# 或者: from ginga.qtw.QtHelp import _name_mangle [as 别名]
    def _create_info_window(self):
        sw = QtGui.QScrollArea()

        widget = QtGui.QWidget()
        vbox = QtGui.QVBoxLayout()
        vbox.setContentsMargins(2, 2, 2, 2)
        widget.setLayout(vbox)
        
        captions = (('Name', 'label'), ('Object', 'label'),
                    ('X', 'label'), ('Y', 'label'), ('Value', 'label'),
                    ('RA', 'label'), ('DEC', 'label'),
                    ('Equinox', 'label'), ('Dimensions', 'label'),
                    #('Slices', 'label', 'MultiDim', 'button'),
                    ('Min', 'label'), ('Max', 'label'),
                    ('Zoom', 'label'), 
                    ('Cut Low', 'xlabel', '@Cut Low', 'entry'),
                    ('Cut High', 'xlabel', '@Cut High', 'entry'),
                    ('Auto Levels', 'button', 'Cut Levels', 'button'), 
                    ('Cut New', 'label'), ('Zoom New', 'label'), 
                    ('Preferences', 'button'), 
                    )

        w, b = QtHelp.build_info(captions)

        b.cut_levels.setToolTip("Set cut levels manually")
        b.auto_levels.setToolTip("Set cut levels by algorithm")
        b.cut_low.setToolTip("Set low cut level (press Enter)")
        b.cut_high.setToolTip("Set high cut level (press Enter)")
        b.preferences.setToolTip("Set preferences for this channel")
        #b.multidim.setToolTip("View other HDUs or slices")

        
        vbox.addWidget(w, stretch=0)
        
        # Convenience navigation buttons
        btns = QtGui.QWidget()
        layout = QtGui.QHBoxLayout()
        layout.setSpacing(3)
        btns.setLayout(layout)
        #btns.set_layout(gtk.BUTTONBOX_CENTER)
        #btns.set_child_size(15, -1)

        bw = Bunch.Bunch()
        for tup in (
            #("Load", 'button', 'fits_open_48', "Open an image file"),
            ("Prev", 'button', 'prev_48', "Go to previous image"),
            ("Next", 'button', 'next_48', "Go to next image"),
            ("Zoom In", 'button', 'zoom_in_48', "Zoom in"),
            ("Zoom Out", 'button', 'zoom_out_48', "Zoom out"),
            ("Zoom Fit", 'button', 'zoom_fit_48', "Zoom to fit window size"),
            ("Zoom 1:1", 'button', 'zoom_100_48', "Zoom to 100% (1:1)"),
            #("Quit", 'button', 'exit', "Quit the program"),
            ):

            btn = self.fv.make_button(*tup)
            name = tup[0]
            if tup[3]:
                btn.setToolTip(tup[3])
                
            bw[QtHelp._name_mangle(name, pfx='btn_')] = btn
            layout.addWidget(btn, stretch=0)

        #self.w.btn_load.connect("clicked", lambda w: self.gui_load_file())
        bw.btn_prev.clicked.connect(self.fv.prev_img)
        bw.btn_next.clicked.connect(self.fv.next_img)
        bw.btn_zoom_in.clicked.connect(self.fv.zoom_in)
        bw.btn_zoom_out.clicked.connect(self.fv.zoom_out)
        bw.btn_zoom_fit.clicked.connect(self.fv.zoom_fit)
        bw.btn_zoom_1_1.clicked.connect(self.fv.zoom_1_to_1)

        vbox.addWidget(btns, stretch=0)

        #widget.show()
        sw.setWidget(widget)
        return sw, b
开发者ID:albertoconti,项目名称:ginga,代码行数:77,代码来源:Info.py


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