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


Python TLabel.bind方法代码示例

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


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

示例1: build_tab_about

# 需要导入模块: from sk1sdk.libttk import TLabel [as 别名]
# 或者: from sk1sdk.libttk.TLabel import bind [as 别名]
	def build_tab_about(self):
		panel = TFrame(self.root, style='FlatFrame', borderwidth=10)
		self.nb.add(panel, text=_('About application'))

		subpanel = TFrame(panel, style='FlatFrame', borderwidth=0)
		subpanel.pack(side=TOP, fill=Y, expand=1)

		subpanel = TFrame(subpanel, style='FlatFrame', borderwidth=5)
		subpanel.pack(side=LEFT, anchor='center')

		text = TLabel(subpanel, style='FlatLabel',
				text=_("Illustration program for prepress"))
		text.pack(side=TOP, anchor=W, pady=10)

		from time import gmtime, strftime
		year = strftime("%Y", gmtime())

		text = TLabel(subpanel, style='FlatLabel', text="(c)2003-%s sK1 Team" % (year))
		text.pack(side=TOP, anchor=W, pady=10)

		text = TLabel(subpanel, style='FlatLabel', text='http://sk1project.org',
				foreground='blue', underline=20, cursor='hand2')
		text.pack(side=TOP, anchor=W)
		text.bind('<Button-1>', self.goToSite)
开发者ID:kindlychung,项目名称:sk1,代码行数:26,代码来源:aboutdlg.py

示例2: Pager

# 需要导入模块: from sk1sdk.libttk import TLabel [as 别名]
# 或者: from sk1sdk.libttk.TLabel import bind [as 别名]
class Pager(TFrame, Publisher):
	
	hidden=1
	
	def __init__(self, parent, mainwindow):
		self.parent=parent
		self.mainwindow=mainwindow
		TFrame.__init__(self, self.parent, name = 'pagerPanel', style='FlatFrame', borderwidth=0)
		top_border=TLabel(self, style='FlatLabel', image='space_1')
		top_border.pack(side=TOP, fill=X)
		
		self.container=TFrame(self, style='FlatFrame', borderwidth=0)

		space=TLabel(self.container, style='FlatLabel', image='space_3')
		space.pack(side=LEFT, fill=Y)
		self.home_but=TButton(self.container, style='PagerHome', command=self.PageHome)
		self.home_but.pack(side=LEFT)
		self.home_but=TButton(self.container, style='PagerPrevious', command=self.PagePrevious)
		self.home_but.pack(side=LEFT)
		self.text=TLabel(self.container, style='FlatLabel', text=' '+_('Page 2 of 2')+' ')
		self.text.pack(side=LEFT)
		self.home_but=TButton(self.container, style='PagerNext', command=self.PageNext)
		self.home_but.pack(side=LEFT)
		self.home_but=TButton(self.container, style='PagerEnd', command=self.PageEnd)
		self.home_but.pack(side=LEFT)
		space=TLabel(self.container, style='FlatLabel', image='space_3')
		space.pack(side=LEFT, fill=Y)
		self.mainwindow.Subscribe(DOCUMENT, self.Resubscribe)
		self.Resubscribe()
		self.doc_paged()
		self.text.bind('<Double-Button-1>', self.GoToPage)
				
	def stub(self):
		pass
	
	def doc_paged(self):		
		current_page=self.mainwindow.document.active_page+1
		num_pages=len(self.mainwindow.document.pages)
		if self.hidden and num_pages>1:
			self.container.pack(side=LEFT, fill=Y)
			self.hidden=0
		if not self.hidden and num_pages==1:
			self.container.forget()
			self.hidden=1		
		self.text['text']=' '+_('Page %u of %u')%(current_page,num_pages)+' '
		
	def Resubscribe(self, *arg):
		self.mainwindow.document.Subscribe(PAGE, self.doc_paged)
		self.doc_paged()
		
	def PageHome(self):
		self.mainwindow.document.GoToPage(0)
		self.mainwindow.document.SelectNone()
		self.mainwindow.canvas.ForceRedraw()
	
	def PageEnd(self):
		self.mainwindow.document.GoToPage(len(self.mainwindow.document.pages)-1)
		self.mainwindow.document.SelectNone()
		self.mainwindow.canvas.ForceRedraw()
				
	def PagePrevious(self):
		self.mainwindow.PreviousPage()
		
	def PageNext(self):
		self.mainwindow.NextPage()	
		
	def GoToPage(self, *args):
		self.mainwindow.GotoPage()
开发者ID:kindlychung,项目名称:sk1,代码行数:70,代码来源:pager.py

示例3: PluginPanel

# 需要导入模块: from sk1sdk.libttk import TLabel [as 别名]
# 或者: from sk1sdk.libttk.TLabel import bind [as 别名]
class PluginPanel(TFrame, Publisher):

	receivers = [(SELECTION, 'issue', SELECTION)]

	name = ''
	category = ''
	title = ''
	icon = 'strip_dialog'
	contents = []
	category = ''
	category_title = ''

	activated = 0
	collapsed = 0
	visible = 0
	packed = 0
	fill = X
	expand = 0

	def init(self, master):
		self.master = master
		self.mw = app.mw
		self.pcontainer = self.master.master
		self.document = self.mw.document
		TFrame.__init__(self, self.master, style='FlatFrame', borderwidth=0)
		self.top = TFrame(self, style='PWinHead', borderwidth=3)
		self.panel = TFrame(self, style='PWinBody', borderwidth=3)
		self.activated = 1
		self.visible = 1
		self.packed = 1

		for item in self.pcontainer.loaded:
			if not item.collapsed:
				item.collapse_panel()

		self.pack(side=TOP, fill=self.fill, expand=self.expand, padx=1, pady=1)
		self.top.pack(side=TOP, fill=X)
		self.panel.pack(side=TOP, fill=BOTH, expand=1)

		self.iconlabel = TLabel(self.top, style='PWLabel', image=self.icon)
		self.textlabel = TLabel(self.top, style='PWLabel', text=self.title, anchor=W)
		if not 'bold' in self.textlabel['font'].split():
			self.textlabel['font'] += ' bold'
		self.closebut = TButton(self.top, style='PWButton', image='close_pw', command=self.close_panel)
		self.collapsebut = TButton(self.top, style='PWButton', image='minimize_pw', command=self.click)
		self.iconlabel.pack(side=LEFT, padx=2)
		self.textlabel.pack(side=LEFT, fill=BOTH, expand=1, padx=3)
		self.closebut.pack(side=RIGHT)
		self.collapsebut.pack(side=RIGHT)
		self.textlabel.bind("<Button-1>", self.click)
		self.mw.Subscribe(DOCUMENT, self.doc_changed)

	def click(self, *args):
		if self.collapsed:
			self.decollapse_panel()
		else:
			self.collapse_panel()

	def close_panel(self):
		self.packed = 0
		self.forget()
		self.pcontainer.remove_plugin(self)

	def restore_panel(self):
		for item in self.pcontainer.loaded:
			if not item.collapsed:
				item.collapse_panel()
		self.forget()
		self.packed = 1
		self.pack(side=TOP, fill=self.fill, expand=self.expand, padx=1, pady=1)
		self.decollapse_panel()

	def decollapse_panel(self, *arg):
		if self.collapsed:
			for item in self.pcontainer.loaded:
				if not item.collapsed:
					item.collapse_panel()
			self.forget()
			self.pack(side=TOP, fill=X, padx=1, pady=1)
			self.panel.pack(side=TOP, fill=BOTH, expand=1)
			self.collapsebut['image'] = 'minimize_pw'
			self.collapsed = 0
			self.textlabel['foreground'] = app.uimanager.currentColorTheme.foreground
			self.forget()
			self.pack(side=TOP, fill=self.fill, expand=self.expand, padx=1, pady=1)

	def collapse_panel(self, *arg):
		if not self.collapsed:
			self.panel.forget()
			self.collapsebut['image'] = 'restore_pw'
			self.collapsed = 1
			self.textlabel['foreground'] = app.uimanager.currentColorTheme.menudisabledforeground
			self.forget()
			self.pack(side=TOP, fill=X, expand=0, padx=1, pady=1)


	def doc_changed(self, *arg):
		self.SetDocument(self.mw.document)

	def doc_has_selection(self):
#.........这里部分代码省略.........
开发者ID:kindlychung,项目名称:sk1,代码行数:103,代码来源:ppanel.py


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