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


Python events.connect函数代码示例

本文整理汇总了Python中sk1.events.connect函数的典型用法代码示例。如果您正苦于以下问题:Python connect函数的具体用法?Python connect怎么用?Python connect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: __init__

	def __init__(self, parent, app):
		self.app = app
		mode = sk2_const.DOC_ORIGIN_LL
		wal.Bitmap.__init__(self, parent, get_icon(ORIGIN_ICONS[mode],
												size=wal.DEF_SIZE))
		events.connect(events.DOC_CHANGED, self.update)
		events.connect(events.DOC_MODIFIED, self.update)
开发者ID:Scrik,项目名称:sk1-wx,代码行数:7,代码来源:indicator.py

示例2: __init__

	def __init__(self, parent, app, cms,
				onleftclick=None, onrightclick=None, onmin=None, onmax=None):
		self.app = app
		self.cms = cms
		self.onleftclick = onleftclick
		self.onrightclick = onrightclick
		self.onmin = onmin
		self.onmax = onmax
		HPanel.__init__(self, parent)
		self.set_palette(app.palettes.palette_in_use.model.colors)
		self.cell_width = config.palette_hcell_width
		self.cell_height = config.palette_hcell_height
		self.pack((self.cell_width, self.cell_height))
		self.tooltipwin = PaletteToolTip(self)
		self.Bind(wx.EVT_PAINT, self._on_paint, self)
		self.Bind(wx.EVT_SIZE, self._on_resize, self)
		self.Bind(wx.EVT_MOUSEWHEEL, self._on_scroll, self)
		self.Bind(wx.EVT_MOTION, self._on_move, self)
		if onrightclick:
			self.Bind(wx.EVT_RIGHT_UP, self._on_right_click, self)
		if onleftclick:
			self.Bind(wx.EVT_LEFT_UP, self._on_left_click, self)
		self.timer = wx.Timer(self)
		self.Bind(wx.EVT_TIMER, self._on_timer)
		self.SetDoubleBuffered(True)
		events.connect(events.CONFIG_MODIFIED, self.config_update)
		events.connect(events.CMS_CHANGED, self.refresh)
开发者ID:Scrik,项目名称:sk1-wx,代码行数:27,代码来源:palette_old.py

示例3: __init__

	def __init__(self, presenter, parent, style=HORIZONTAL):
		self.presenter = presenter
		self.eventloop = presenter.eventloop
		self.style = style
		HPanel.__init__(self, parent)
		if not VFONT: load_font()
		size = config.ruler_size
		self.add((size, size))
		self.default_cursor = self.GetCursor()
		if self.style == HORIZONTAL:
			self.guide_cursor = self.presenter.app.cursors[modes.HGUIDE_MODE]
		else:
			self.guide_cursor = self.presenter.app.cursors[modes.VGUIDE_MODE]
		self.SetBackgroundColour(wx.WHITE)
		self.SetDoubleBuffered(True)
		self.Bind(wx.EVT_PAINT, self._on_paint, self)
		self.Bind(wx.EVT_LEFT_DOWN, self.mouse_down)
		self.Bind(wx.EVT_LEFT_UP, self.mouse_up)
		self.Bind(wx.EVT_MOTION, self.mouse_move)
		self.Bind(wx.EVT_MOUSE_CAPTURE_LOST, self.capture_lost)
		self.eventloop.connect(self.eventloop.VIEW_CHANGED, self.repaint)
		events.connect(events.CONFIG_MODIFIED, self.check_config)
		if is_mac():
			self.timer = wx.Timer(self)
			self.Bind(wx.EVT_TIMER, self._repaint_after)
			self.timer.Start(50)
开发者ID:Scrik,项目名称:sk1-wx,代码行数:26,代码来源:ruler.py

示例4: __init__

	def __init__(self, mw):

		if not config.statusbar_fontsize:
			FONTSIZE[0] = wal.get_system_fontsize()

		self.mw = mw
		wal.HPanel.__init__(self, mw)
		self.pack((5, 20))

		self.mouse_info = MouseMonitor(self.mw.app, self)
		self.pack(self.mouse_info)
		self.mouse_info.hide()

		self.snap_monitor = SnapMonitor(self.mw.app, self)
		self.pack(self.snap_monitor)

		self.page_info = PageMonitor(self.mw.app, self)
		self.pack(self.page_info)
		self.page_info.hide()

		info_panel = wal.HPanel(self)
		info_panel.pack(get_bmp(info_panel, icons.PD_APP_STATUS))
		info_panel.pack((5, 3))
		self.info = wal.Label(info_panel, text='', fontsize=FONTSIZE[0])
		info_panel.pack(self.info)
		self.pack(info_panel, expand=True)


		self.clr_monitor = ColorMonitor(self.mw.app, self)
		self.pack(self.clr_monitor)
		self.clr_monitor.hide()
		events.connect(events.APP_STATUS, self._on_event)
开发者ID:Scrik,项目名称:sk1-wx,代码行数:32,代码来源:statusbar.py

示例5: __init__

	def __init__(self, app, master):

		wal.HBox.__init__(self, master)
		self.app = app
		self.insp = app.inspector

		self.start = wal.ImgButton(self, rc.IMG_PAGER_START,
								cmd=self.first_page, flat=True)
		self.pack(self.start)

		self.left = wal.ImgButton(self, rc.IMG_PAGER_PREV,
								cmd=self.prev_page, flat=True)
		self.pack(self.left)

		self.label = wal.DecorLabel(self)
		self.pack(self.label, False, False, 5)

		self.right = wal.ImgButton(self, rc.IMG_PAGER_NEXT,
								cmd=self.next_page, flat=True)
		self.pack(self.right)

		self.end = wal.ImgButton(self, rc.IMG_PAGER_END,
								cmd=self.last_page, flat=True)
		self.pack(self.end)

		self.pack(wal.VLine(self))

		self.update_pager()
		events.connect(events.DOC_CHANGED, self.update_pager)
		events.connect(events.DOC_MODIFIED, self.update_pager)
开发者ID:sk1project,项目名称:sk1-gtk2,代码行数:30,代码来源:pager_widget.py

示例6: __init__

	def __init__(self, action_id, callback, channels=[],
				validator=None, checker=None,
				callable_args=[], validator_args=[], checker_args=[]):

		self.action_id = action_id
		self.is_acc = resources.ACC_KEYS.has_key(action_id)
		if self.is_acc:
			self.acc_entry, self.global_accs = resources.get_accentry_by_id(self.action_id)
		if not self.acc_entry:
			self.is_acc = False
		self.is_icon = resources.ART_IDS.has_key(action_id)
		self.callback = callback
		self.channels = channels
		self.validator = validator
		self.checker = checker
		self.callable_args = callable_args
		self.validator_args = validator_args
		self.checker_args = checker_args

		self.widgets = []
		self.menuitem = []

		if channels:
			for channel in channels:
				events.connect(channel, self.receiver)
开发者ID:sk1project,项目名称:sk1-wx,代码行数:25,代码来源:actions.py

示例7: __init__

	def __init__(self, parent, selected_font='Sans', onchange=None):
		self.fonts = libpango.get_fonts()[0]
		if not FONTNAME_CACHE:
			generate_fontname_cache(self.fonts)
			generate_fontsample_cache(self.fonts)
		if not selected_font in self.fonts:
			selected_font = 'Sans'
		value = self.fonts.index(selected_font)
		icon = get_icon(icons.PD_FONT, size=wal.DEF_SIZE)
		wal.FontBitmapChoice.__init__(self, parent, value, MAXSIZE,
				self.fonts, FONTNAME_CACHE, FONTSAMPLE_CACHE, icon, onchange)
		events.connect(events.CONFIG_MODIFIED, self.check_config)
开发者ID:sk1project,项目名称:sk1-wx,代码行数:12,代码来源:fontctrl.py

示例8: __init__

	def __init__(self, app, master):
		self.app = app
		wal.HBox.__init__(self, master)
		self.set_border_width(2)

		self.pager = PagerWidget(self.app, self)
		self.pack(self.pager, padding=5)

		self.msg_label = wal.DecorLabel(self)
		self.pack(self.msg_label)

		self.cmw = ColorMonitorWidget(self.app, self)
		self.pack(self.cmw, end=True)

		events.connect(events.APP_STATUS, self.show_message)
开发者ID:sk1project,项目名称:sk1-gtk2,代码行数:15,代码来源:statusbar.py

示例9: __init__

	def __init__(self, parent, app, hpal=True,
				on_left_click=None, on_right_click=None,
				 onmin=None, onmax=None):
		self.hpal = hpal
		self.app = app
		self.cell_sizes = []
		self.onmin = onmin
		self.onmax = onmax
		self.on_left_click = on_left_click
		self.on_right_click = on_right_click
		wal.VPanel.__init__(self, parent)
		wal.SensitiveCanvas.__init__(self, True)
		self.set_palette_size()
		events.connect(events.CONFIG_MODIFIED, self.config_update)
		events.connect(events.CMS_CHANGED, self.palette_refresh)
开发者ID:Scrik,项目名称:sk1-wx,代码行数:15,代码来源:palette.py

示例10: __init__

	def __init__(self, docarea):
		gtk.DrawingArea.__init__(self)
		if not BITMAPS:load_bitmaps()
		self.docarea = docarea
		self.presenter = docarea.presenter
		self.eventloop = self.presenter.eventloop
		self.origin = self.presenter.model.doc_origin

		self.add_events(gtk.gdk.BUTTON_PRESS_MASK |
					gtk.gdk.BUTTON_RELEASE_MASK)

		size = config.ruler_size
		self.set_size_request(size, size)
		self.connect(const.EVENT_EXPOSE, self.repaint)
		self.connect(const.EVENT_BUTTON_RELEASE, self.click_event)
		self.eventloop.connect(self.eventloop.DOC_MODIFIED, self.check_coords)
		events.connect(events.CONFIG_MODIFIED, self.check_config)
开发者ID:sk1project,项目名称:sk1-gtk2,代码行数:17,代码来源:ruler.py

示例11: __init__

	def __init__(self, mw):

		gtk.VBox.__init__(self)

		self.mw = mw
		self.app = mw.app

		self.nb = gtk.Notebook()
		self.nb.connect('switch-page', self.change_plugin)
		self.nb.set_property('scrollable', True)
		self.nb.set_tab_pos(gtk.POS_RIGHT)
		self.pack_start(self.nb, True, True, 0)

		self.set_size_request(200, -1)
		self.build_dict()
		events.connect(events.NO_DOCS, self.no_docs)
		events.connect(events.DOC_CHANGED, self.doc_changed)
开发者ID:sk1project,项目名称:sk1-gtk2,代码行数:17,代码来源:__init__.py

示例12: __init__

	def __init__(self, app, mw):
		self.app = app
		self.mw = mw
		wx.Menu.__init__(self)

		self.empty_item = wx.MenuItem(self, wx.NewId(), _('Empty'))
		self.empty_item.Enable(False)

		self.items.append(self.AppendSeparator())
		action = self.app.actions[pdids.ID_CLEAR_LOG]
		menuitem = ActionMenuItem(self.mw, self, action)
		self.AppendItem(menuitem)
		self.items.append(menuitem)

		self.persistent_items += self.items

		self.rebuild()
		events.connect(events.HISTORY_CHANGED, self.rebuild)
开发者ID:Scrik,项目名称:sk1-wx,代码行数:18,代码来源:menubar.py

示例13: __init__

	def __init__(self, app, parent, val=0.0, step=1.0,
				 onchange=None, onenter=None, can_be_negative=False):
		self.app = app
		self.insp = app.insp
		self.point_value = val
		self.ucallback = onchange
		val_range = (0.0, 100000.0)
		if can_be_negative:val_range = (-100000.0, 100000.0)
		if self.insp.is_doc(): self.units = app.current_doc.model.doc_units
		val = self.point_value * point_dict[self.units]
		FloatSpin.__init__(self, parent, val, val_range,
						step=step, width=5,
						onchange=self.update_point_value, onenter=onenter,
						spin_overlay=config.spin_overlay)
		events.connect(events.DOC_MODIFIED, self.update_units)
		events.connect(events.DOC_CHANGED, self.update_units)
		self._set_digits(unit_accuracy[self.units])
		self.set_value(self.point_value * point_dict[self.units])
开发者ID:Scrik,项目名称:sk1-wx,代码行数:18,代码来源:unitctrls.py

示例14: build

	def build(self):
		spacer = gtk.VBox()
		self.add(spacer)
		self.set_border_width(5)

		doc_model = self.app.current_doc.doc_presenter.model
		self.listmodel = ObjectTreeModel(doc_model)

		self.treeview = gtk.TreeView()

		self.column = gtk.TreeViewColumn()
		self.column.set_title(_('Document Object Model'))
		render_pixbuf = gtk.CellRendererPixbuf()
		self.column.pack_start(render_pixbuf, expand=False)
		self.column.add_attribute(render_pixbuf, 'pixbuf', 0)
		render_text = gtk.CellRendererText()
		self.column.pack_start(render_text, expand=True)
		self.column.add_attribute(render_text, 'text', 1)
		self.treeview.append_column(self.column)

		self.column1 = gtk.TreeViewColumn()
		render_text = gtk.CellRendererText()
		self.column1.pack_start(render_text, expand=False)
		self.column1.add_attribute(render_text, 'text', 2)
		self.column1.add_attribute(render_text, 'foreground', 3)
		self.treeview.append_column(self.column1)

		self.treeview.connect('cursor-changed', self.view_object)

		self.scrolledwindow = gtk.ScrolledWindow()
		self.scrolledwindow.add(self.treeview)
		self.scrolledwindow.set_shadow_type(gtk.SHADOW_ETCHED_IN)
		self.scrolledwindow.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
		spacer.pack_end(self.scrolledwindow, True)

		self.treeview.set_model(self.listmodel)
		self.treeview.set_rules_hint(True)
		self.treeview.set_enable_tree_lines(True)

		self.expand_all()

		self.loaded = True
		events.connect(events.DOC_CHANGED, self.update_view)
		events.connect(events.DOC_MODIFIED, self.update_view)
开发者ID:tisn05,项目名称:sk1,代码行数:44,代码来源:dom_plg.py

示例15: build_ui

	def build_ui(self):
		self.icon = get_icon(PLUGIN_ICON)
		self.panel.pack(wal.Label(self.panel, _('Layers'), fontbold=True),
					padding=3)
		self.panel.pack(wal.HLine(self.panel), fill=True)

		pnl = wal.HPanel(self.panel)
		self.layer_new = wal.ImageButton(pnl, icons.PD_LAYER_NEW,
			tooltip=_('Create new layer'), onclick=self.new_layer)
		self.layer_to_bottom = wal.ImageButton(pnl, icons.PD_LOWER_TO_BOTTOM,
			tooltip=_('Layer to bottom'), onclick=self.lower_layer_to_bottom)
		self.layer_lower = wal.ImageButton(pnl, icons.PD_LOWER,
			tooltip=_('Lower layer'), onclick=self.lower_layer)
		self.layer_raise = wal.ImageButton(pnl, icons.PD_RAISE,
			tooltip=_('Raise layer'), onclick=self.raise_layer)
		self.layer_to_top = wal.ImageButton(pnl, icons.PD_RAISE_TO_TOP,
			tooltip=_('Layer to top'), onclick=self.raise_layer_to_top)
		self.layer_delete = wal.ImageButton(pnl, icons.PD_LAYER_DELETE,
			tooltip=_('Delete layer'), onclick=self.delete_layer)
		self.layer_edit = wal.ImageButton(pnl, icons.PD_EDIT,
			tooltip=_('Rename layer'), onclick=self.rename_layer)
		pnl.pack(self.layer_new)
		pnl.pack(self.layer_to_bottom)
		pnl.pack(self.layer_lower)
		pnl.pack(self.layer_raise)
		pnl.pack(self.layer_to_top)
		pnl.pack(self.layer_delete)
		pnl.pack(self.layer_edit)
		self.panel.pack(pnl)

		bmp = []
		for item in BITMAPS: bmp.append(make_artid(item))
		pnl = wal.VPanel(self.panel, border=True)
		self.viewer = wal.LayerList(pnl, self.get_data(), bmp,
								on_select=self.update, on_change=self.changed,
								on_double_click=self.rename_layer)
		pnl.pack(self.viewer, fill=True, expand=True)
		self.panel.pack(pnl, padding_all=3, fill=True, expand=True)

		events.connect(events.DOC_CHANGED, self.update)
		events.connect(events.DOC_MODIFIED, self.update)
		self.update()
开发者ID:sk1project,项目名称:sk1-wx,代码行数:42,代码来源:__init__.py


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