本文整理汇总了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
示例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
示例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)
示例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
示例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