本文整理汇总了Python中miro.plat.frontends.widgets.base.Widget.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Widget.__init__方法的具体用法?Python Widget.__init__怎么用?Python Widget.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类miro.plat.frontends.widgets.base.Widget
的用法示例。
在下文中一共展示了Widget.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from miro.plat.frontends.widgets.base import Widget [as 别名]
# 或者: from miro.plat.frontends.widgets.base.Widget import __init__ [as 别名]
def __init__(self, path):
Widget.__init__(self)
self.nsimage = NSImage.alloc().initByReferencingFile_(
filename_to_unicode(path))
self.view = MiroImageView.alloc().init()
self.view.setImage_(self.nsimage)
# enabled when viewWillMoveToWindow:aWindow invoked
self.view.setAnimates_(NO)
示例2: __init__
# 需要导入模块: from miro.plat.frontends.widgets.base import Widget [as 别名]
# 或者: from miro.plat.frontends.widgets.base.Widget import __init__ [as 别名]
def __init__(self, initial_text=None):
Widget.__init__(self)
if initial_text is None:
initial_text = ""
self.view = NSTextView.alloc().initWithFrame_(NSRect((0,0),(50,50)))
self.view.setMaxSize_((1.0e7, 1.0e7))
self.view.setHorizontallyResizable_(NO)
self.view.setVerticallyResizable_(YES)
self.notifications = NotificationForwarder.create(self.view)
if initial_text is not None:
self.set_text(initial_text)
self.set_size(widgetconst.SIZE_NORMAL)
示例3: __init__
# 需要导入模块: from miro.plat.frontends.widgets.base import Widget [as 别名]
# 或者: from miro.plat.frontends.widgets.base.Widget import __init__ [as 别名]
def __init__(self):
Widget.__init__(self)
self.url = None
self.create_signal('net-start')
self.create_signal('net-stop')
self.delegate = BrowserDelegate.alloc().initWithBrowser_(self)
self.view = MiroWebView.alloc().initWithFrame_(NSRect((0,0), self.calc_size_request()))
self.view.setMaintainsBackForwardList_(YES)
self.view.setApplicationNameForUserAgent_("%s/%s (%s)" % \
(app.config.get(prefs.SHORT_APP_NAME),
app.config.get(prefs.APP_VERSION),
app.config.get(prefs.PROJECT_URL),))
示例4: __init__
# 需要导入模块: from miro.plat.frontends.widgets.base import Widget [as 别名]
# 或者: from miro.plat.frontends.widgets.base.Widget import __init__ [as 别名]
def __init__(self):
Widget.__init__(self)
self.create_signal('pressed')
self.create_signal('released')
self.create_signal('changed')
self.create_signal('moved')
self.view = CustomSliderView.alloc().init()
self.view.setRefusesFirstResponder_(NO)
if self.is_continuous():
self.view.setContinuous_(YES)
else:
self.view.setContinuous_(NO)
示例5: __init__
# 需要导入模块: from miro.plat.frontends.widgets.base import Widget [as 别名]
# 或者: from miro.plat.frontends.widgets.base.Widget import __init__ [as 别名]
def __init__(self, text="", wrap=False):
Widget.__init__(self)
self.view = NSTextField.alloc().init()
self.view.setEditable_(NO)
self.view.setBezeled_(NO)
self.view.setBordered_(NO)
self.view.setDrawsBackground_(NO)
self.wrap = wrap
self.bold = False
self.size = NSFont.systemFontSize()
self.sizer_cell = self.view.cell().copy()
self.set_font()
self.set_text(text)
self.__color = self.view.textColor()
示例6: __init__
# 需要导入模块: from miro.plat.frontends.widgets.base import Widget [as 别名]
# 或者: from miro.plat.frontends.widgets.base.Widget import __init__ [as 别名]
def __init__(self):
Widget.__init__(self)
self.url = None
self.create_signal('net-start')
self.create_signal('net-stop')
self.create_signal('download-finished')
self.delegate = BrowserDelegate.alloc().initWithBrowser_(self)
self.view = MiroWebView.alloc().initWithFrame_(NSRect((0,0), self.calc_size_request()))
self.view.setMaintainsBackForwardList_(YES)
# XXX SL and better only
if self.view.respondsToSelector_('setShouldUpdateWhileOffscreen:'):
self.view.setShouldUpdateWhileOffscreen_(NO)
self.view.setApplicationNameForUserAgent_("%s %s/%s (%s)" % \
('Safari/531.2+', # FIXME hack for #17370
app.config.get(prefs.SHORT_APP_NAME),
app.config.get(prefs.APP_VERSION),
app.config.get(prefs.PROJECT_URL),))
示例7: __init__
# 需要导入模块: from miro.plat.frontends.widgets.base import Widget [as 别名]
# 或者: from miro.plat.frontends.widgets.base.Widget import __init__ [as 别名]
def __init__(self):
quicktime.Player.__init__(self, SUPPORTED_MEDIA_TYPES)
Widget.__init__(self)
frame = ((0,0),(200,200))
self.view = NSView.alloc().initWithFrame_(frame)
self.video_view = MiroMovieView.alloc().initWithFrame_(frame)
self.video_view.setFillColor_(NSColor.blackColor())
self.video_view.setControllerVisible_(NO)
self.video_view.setEditable_(NO)
self.video_view.setPreservesAspectRatio_(YES)
self.movie = None
self.movie_notifications = None
self.system_activity_updater_timer = None
self.window_moved_handler = None
self.item_changed_handler = None
示例8: __init__
# 需要导入模块: from miro.plat.frontends.widgets.base import Widget [as 别名]
# 或者: from miro.plat.frontends.widgets.base.Widget import __init__ [as 别名]
def __init__(self, model):
Widget.__init__(self)
self.create_signal('selection-changed')
self.create_signal('hotspot-clicked')
self.create_signal('row-double-clicked')
# row-activated is never emitted, but it should be
# when space or enter is pressed with a row selected. --Kaz
self.create_signal('row-activated')
self.model = model
self.columns = []
self.drag_source = None
self.context_menu_callback = None
if self.is_tree():
self.create_signal('row-expanded')
self.create_signal('row-collapsed')
self.tableview = MiroOutlineView.alloc().init()
self.data_source = tablemodel.MiroOutlineViewDataSource.alloc()
else:
self.tableview = MiroTableView.alloc().init()
self.data_source = tablemodel.MiroTableViewDataSource.alloc()
self.view = self.tableview
self.data_source.initWithModel_(self.model)
self.tableview.setDataSource_(self.data_source)
self.tableview.setVerticalMotionCanBeginDrag_(YES)
self.set_columns_draggable(False)
self.set_auto_resizes(False)
self.draws_selection = True
self.row_height_set = False
self.set_fixed_height(False)
self.auto_resizing = False
self.header_view = MiroTableHeaderView.alloc().initWithFrame_(
NSMakeRect(0, 0, 0, HEADER_HEIGHT))
self.set_show_headers(True)
self.notifications = NotificationForwarder.create(self.tableview)
self._selected_before_change = None
self.model.connect_weak('row-changed', self.on_row_change)
self.model.connect_weak('structure-will-change',
self.on_model_structure_change)
self.iters_to_update = []
self.height_changed = self.reload_needed = False
示例9: __init__
# 需要导入模块: from miro.plat.frontends.widgets.base import Widget [as 别名]
# 或者: from miro.plat.frontends.widgets.base.Widget import __init__ [as 别名]
def __init__(self):
Widget.__init__(self)
self.view = DrawingView.alloc().init()