當前位置: 首頁>>代碼示例>>Python>>正文


Python Popup.__init__方法代碼示例

本文整理匯總了Python中popup.Popup.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python Popup.__init__方法的具體用法?Python Popup.__init__怎麽用?Python Popup.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在popup.Popup的用法示例。


在下文中一共展示了Popup.__init__方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from popup import Popup [as 別名]
# 或者: from popup.Popup import __init__ [as 別名]
    def __init__(self, view):
        Popup.__init__(self)
        self.set_size_request(WIDTH, HEIGHT)
        
        self.__view = view

        sw = gtk.ScrolledWindow()
        self.add(sw)

        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        
        self.__tree_model = gtk.ListStore(str, str, object)
        self.__tree = gtk.TreeView(self.__tree_model)
        self.__tree.set_headers_visible(False)
        
        self.__tree.get_selection().connect('changed', self.__on_selection_changed)

        cell = gtk.CellRendererText()
        column = gtk.TreeViewColumn(None, cell, text=0)
        self.__tree.append_column(column)

        sw.add(self.__tree)
        sw.show_all()

        self.set_default_size(WIDTH, HEIGHT)

        # A small amount of background shows between the scrollbar and the list;
        # which looks ugly if it is the only gray thing in the window, so change
        # the window background to white
        self.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(65535, 65535, 65535))

        self.__doc_popup= DocPopup(fixed_width=True, fixed_height=True, max_height=HEIGHT, can_focus=False)

        self._in_change = False
        self.showing = False
開發者ID:jonkuhn,項目名稱:reinteract-jk,代碼行數:37,代碼來源:completion_popup.py

示例2: __init__

# 需要導入模塊: from popup import Popup [as 別名]
# 或者: from popup.Popup import __init__ [as 別名]
    def __init__(self,parent_mode,title,width_req=0,height_req=0,
            align=ALIGN.DEFAULT,
            close_cb=None,
            additional_formatting=True,
            immediate_action=False):
        Popup.__init__(self,parent_mode,title, width_req=width_req, height_req=height_req, align=align, close_cb=close_cb)
        self.inputs = []
        self.lines = []
        self.current_input = 0

        self.additional_formatting = additional_formatting
        self.immediate_action = immediate_action

        #We need to replicate some things in order to wrap our inputs
        self.encoding = parent_mode.encoding
開發者ID:Ashod,項目名稱:Deluge,代碼行數:17,代碼來源:input_popup.py

示例3: __init__

# 需要導入模塊: from popup import Popup [as 別名]
# 或者: from popup.Popup import __init__ [as 別名]
    def __init__(self, fixed_height=False, fixed_width=False, max_height=MAX_HEIGHT, can_focus=True):
        Popup.__init__(self)

        self.__fixed_height = fixed_height
        self.__fixed_width = fixed_width
        self.__max_height = max_height
        self.__can_focus = can_focus

        self.__view = gtk.TextView()
        self.__view.set_editable(False)
        
        bg_color = gtk.gdk.Color(0xffff, 0xffff, 0xbfbf)
        self.__view.modify_base(gtk.STATE_NORMAL, bg_color)
        self.modify_bg(gtk.STATE_NORMAL, bg_color)
        self.set_app_paintable(True)
        
        self.__view.modify_text(gtk.STATE_NORMAL, gtk.gdk.Color(0, 0, 0))
        self.__view.set_parent(self)
        self.__view.show()
        self.__view.grab_focus()

        global_settings.watch('doc-tooltip-font-is-custom', self.__update_font)
        global_settings.watch('doc-tooltip-font-name', self.__update_font)
        self.__update_font()

        self.__scrollbar = gtk.VScrollbar()
        self.__scrollbar.set_parent(self)
        self.__scrollbar.show()
        self.__view.emit('set-scroll-adjustments', None, self.__scrollbar.get_adjustment())
        self.__view.connect('scroll-event', self.on_scroll_event)

        self.__vscrolled = False

        self.set_resizable(False)
            
        buf = self.__view.get_buffer()
        self.__bold_tag = buf.create_tag(None, weight=pango.WEIGHT_BOLD)
        self.__heading_type_tag = buf.create_tag(None, weight=pango.WEIGHT_BOLD, pixels_below_lines=5)
        self.__inline_type_tag = self.__bold_tag
        self.__value_tag = buf.create_tag(None, family="monospace")

        self.__target = None
        self.focused = False

        self.connect('destroy', self.on_destroy)
開發者ID:alexey4petrov,項目名稱:reinteract,代碼行數:47,代碼來源:doc_popup.py

示例4: __init__

# 需要導入模塊: from popup import Popup [as 別名]
# 或者: from popup.Popup import __init__ [as 別名]
    def __init__(self, fixed_height=False, fixed_width=False, max_height=MAX_HEIGHT, can_focus=True):
        Popup.__init__(self)

        self.__fixed_height = fixed_height
        self.__fixed_width = fixed_width
        self.__max_height = max_height
        self.__can_focus = can_focus

        self.__font = pango.FontDescription("Sans 9")

        self.__view = gtk.TextView()
        self.__view.set_editable(False)
        
        bg_color = gtk.gdk.Color(0xffff, 0xffff, 0xbfbf)
        self.__view.modify_base(gtk.STATE_NORMAL, bg_color)
        self.modify_bg(gtk.STATE_NORMAL, bg_color)
        
        self.__view.modify_text(gtk.STATE_NORMAL, gtk.gdk.Color(0, 0, 0))
        self.__view.modify_font(self.__font)
        self.__view.set_parent(self)
        self.__view.show()
        self.__view.grab_focus()

        self.__scrollbar = gtk.VScrollbar()
        self.__scrollbar.set_parent(self)
        self.__scrollbar.show()
        self.__view.emit('set-scroll-adjustments', None, self.__scrollbar.get_adjustment())

        self.__vscrolled = False

        self.set_resizable(False)
            
        buf = self.__view.get_buffer()
        self.__bold_tag = buf.create_tag(None, weight=pango.WEIGHT_BOLD)
        self.__heading_type_tag = buf.create_tag(None, weight=pango.WEIGHT_BOLD, pixels_below_lines=5)
        self.__inline_type_tag = self.__bold_tag
        self.__value_tag = buf.create_tag(None, family="monospace")

        self.__target = None
        self.focused = False
開發者ID:jonkuhn,項目名稱:reinteract-jk,代碼行數:42,代碼來源:doc_popup.py

示例5: __init__

# 需要導入模塊: from popup import Popup [as 別名]
# 或者: from popup.Popup import __init__ [as 別名]
 def __init__(self,parent_mode,title,width_req=-1,height_req=-1,close_cb=None):
     Popup.__init__(self,parent_mode,title,width_req,height_req,close_cb)
     self.inputs = []
     self.spaces = []
     self.current_input = 0
開發者ID:NoGare,項目名稱:deluge1,代碼行數:7,代碼來源:input_popup.py


注:本文中的popup.Popup.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。