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


Python libttk.TFrame类代码示例

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


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

示例1: __init__

	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)
开发者ID:kindlychung,项目名称:sk1,代码行数:27,代码来源:pager.py

示例2: build_dlg

	def build_dlg(self):

		parent = TFrame(self.top, style='FlatFrame', borderwidth=10)
		parent.pack(side=TOP, fill=BOTH, expand=1)

		bwpanel = BrowsePanel(parent, self, style='FlatFrame')
		bwpanel.pack(side=TOP, fill=X, expand=0)

		Frame(parent, relief='flat', height=5).pack(side=TOP, fill=X, expand=0)

		cmdpanel = CommandPanel(parent, self, style='FlatFrame')
		cmdpanel.pack(side=BOTTOM, fill=X, expand=0)

		Frame(parent, relief='flat', height=5).pack(side=BOTTOM, fill=X, expand=0)

		places = PlacesPanel(parent, self, borderwidth=3)
		places.pack(side=LEFT, fill=Y, expand=0)

		Frame(parent, relief='flat', width=5).pack(side=LEFT, fill=Y, expand=0)

		filepnl = FilePanel(parent, self, clr='white')
		filepnl.pack(side=TOP, fill=BOTH, expand=1)

		self.top.bind('<Escape>', self.cancel)
		self.top.protocol('WM_DELETE_WINDOW', self.cancel)
开发者ID:kindlychung,项目名称:sk1,代码行数:25,代码来源:filedialog.py

示例3: init

	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)
开发者ID:kindlychung,项目名称:sk1,代码行数:32,代码来源:ppanel.py

示例4: __init__

	def __init__(self, parent, color=None, **kw):
		TFrame.__init__(self, parent, style='FlatFrame', **kw)

		frame = TFrame(self, style="RoundedFrame", borderwidth=5)
		frame.pack(side=LEFT)

		self.color_monitor = Canvas(frame, width=100, height=50, relief='flat')
		self.color_monitor.pack(side=TOP)
开发者ID:kindlychung,项目名称:sk1,代码行数:8,代码来源:colorchooser.py

示例5: destroy

	def destroy(self):
		self.entry.unbind_all(self.entry)
		self.entry.destroy()
		self.button_frame.destroy()
		self.up_button.destroy()
		self.down_button.destroy()
		self.command = self.args = None
		TFrame.destroy(self)
开发者ID:kindlychung,项目名称:sk1,代码行数:8,代码来源:ttk_ext.py

示例6: __init__

	def __init__(self, parent, mainwindow):
		self.parent = parent
		self.mainwindow = mainwindow
		TFrame.__init__(self, self.parent, name='tabsPanel', style='FlatFrame',
					borderwidth=0)
		self.left_label = TLabel(self, style=LEFT_CORNER, image='space_3')
		self.right_label = TLabel(self, style=RIGHT_CORNER, image='space_3')
		self.stub_label = TLabel(self, style='DrawingAreaTop', image='space_5')
		self.stub_label.pack(side=TOP, fill=X)
开发者ID:kindlychung,项目名称:sk1,代码行数:9,代码来源:doctabs.py

示例7: build_dlg

	def build_dlg(self):
		root = TFrame(self.top, style='FlatFrame', borderwidth = 10)
		root.pack(side = TOP, fill = BOTH, expand = 1)

		middle = TFrame(root, style='FlatFrame', borderwidth = 5)
		middle.pack(side = TOP, fill = X, expand = 1)
	
		label = TLabel(middle, text = _("Go to page No.:")+" ", style='FlatLabel')
		label.pack(side = LEFT)
		self.pagenum_spin = TSpinbox(middle, var=app.mw.document.active_page+1, vartype=0, textvariable = self.pagenum,
						min = 1, max = len(app.mw.document.pages), step = 1, width = 6, command = self.ok)
		self.pagenum_spin.pack(side = LEFT)
		if len(app.mw.document.pages)==1:
			self.pagenum_spin.set_state('disabled')
			

		bottom = TFrame(root, style='FlatFrame', borderwidth = 5)
		bottom.pack(side = BOTTOM, fill = X, expand = 1)
		cancel = TButton(bottom, text=_("Cancel"), command=self.cancel)
		cancel.pack(side = RIGHT)

		label = TLabel(bottom, text = '  ', style='FlatLabel')
		label.pack(side = RIGHT)
		ok = TButton(bottom, text=_("OK"), command=self.ok)
		ok.pack(side = RIGHT)
		self.focus_widget = ok
		
		self.top.bind('<Escape>', self.cancel)
		self.top.protocol('WM_DELETE_WINDOW', self.cancel)		
		self.top.resizable (width=0, height=0)
开发者ID:kindlychung,项目名称:sk1,代码行数:30,代码来源:gotopagedlg.py

示例8: init

	def init(self, master):
		PluginPanel.init(self, master)

		top = TFrame(self.panel, style='FlatFrame', borderwidth=5)
		top.pack(side = TOP, fill=BOTH)
		
		sign = TFrame(top, style='RoundedFrame', borderwidth=5)
		sign.pack(side = TOP)

		self.sign=TLabel(sign, image='shaping_divide')
		self.sign.pack(side=TOP)

		button = UpdatedButton(top, text = _("Apply"),
								command = self.apply_action,
								sensitivecb = self.is_correct_selection)
		button.pack(side = BOTTOM, expand = 1, fill = X)
		self.Subscribe(SELECTION, button.Update)
		
		button_frame = TFrame(top, style='FlatFrame', borderwidth=1)
		button_frame.pack(side = BOTTOM, fill=X, pady=5)
				
		self.var_originals = IntVar(top)
		self.var_originals.set(1)
		
		self.autoupdate_check = TCheckbutton(button_frame, text = _("Leave originals"), 
											variable = self.var_originals)
		self.autoupdate_check.pack(side = LEFT, anchor=W, padx=10)

		self.init_from_doc()
		self.subscribe_receivers()
开发者ID:kindlychung,项目名称:sk1,代码行数:30,代码来源:divide.py

示例9: __init__

	def __init__(self, parent, callback, color=None, **kw):
		self.color = color
		self.parent = parent
		TFrame.__init__(self, parent, style='FlatFrame', **kw)
		self.rgb_digitizer = RGBDigitizer(self, callback)
		self.cmyk_digitizer = CMYKDigitizer(self, callback)
		self.spot_digitizer = SPOTDigitizer(self)
		self.empty_digitizer = EmptyDigitizer(self)
		self.current_digitizer = self.empty_digitizer
		self.current_digitizer.pack(side=LEFT)
		self.set_color(color)
开发者ID:kindlychung,项目名称:sk1,代码行数:11,代码来源:colordigitizer.py

示例10: __init__

class ScrolledCanvas:
	def __init__(self, master, **opts):
		if not opts.has_key('yscrollincrement'):
			opts['yscrollincrement'] = 20
		self.master = master		
		self.frame = TFrame(master, style="FlatFrame")
		self.frame.rowconfigure(0, weight=1)
		self.frame.columnconfigure(0, weight=1)
		self.canvas = Canvas(self.frame, **opts)
		self.canvas.grid(row=0, column=0, sticky="nsew")
		self.vbar = TScrollbar(self.frame, name="vbar")
		self.vbar.grid(row=0, column=1, sticky="nse")
		self.hbar = TScrollbar(self.frame, name="hbar", orient="horizontal")
		self.hbar.grid(row=1, column=0, sticky="ews")
		self.canvas['yscrollcommand'] = lambda f, l: self.scroll_sh(self.vbar, f, l)
		self.vbar['command'] = self.canvas.yview
		self.canvas['xscrollcommand'] = lambda f, l: self.scroll_sh(self.hbar, f, l)
		self.hbar['command'] = self.canvas.xview
		self.canvas.bind("<Key-Prior>", self.page_up)
		self.canvas.bind("<Key-Next>", self.page_down)
		self.canvas.bind("<Key-Up>", self.unit_up)
		self.canvas.bind("<Key-Down>", self.unit_down)
		self.canvas.bind("<Alt-Key-2>", self.zoom_height)
		self.canvas.bind("<Button-4>", self.unit_up)
		self.canvas.bind("<Button-5>", self.unit_down)
		self.canvas.focus_set()
	def page_up(self, event):
		self.canvas.yview_scroll(-1, "page")
		return "break"
	def page_down(self, event):
		self.canvas.yview_scroll(1, "page")
		return "break"
	def unit_up(self, event):
		first,last=self.vbar.get()
		if first <= 0 and last >= 1:
			return "break"
		self.canvas.yview_scroll(-1, "unit")
		return "break"
	def unit_down(self, event):
		first,last=self.vbar.get()
		if first <= 0 and last >= 1:
			return "break"
		self.canvas.yview_scroll(1, "unit")
		return "break"
	def zoom_height(self, event):
		return "break"
	def scroll_sh(self, scroll, first, last):
	    first, last = float(first), float(last)
	    if first <= 0 and last >= 1:
	        scroll.grid_remove()
	    else:
	        scroll.grid()
	    scroll.set(first, last)
开发者ID:kindlychung,项目名称:sk1,代码行数:53,代码来源:scrolledcanvas.py

示例11: build_dlg

	def build_dlg(self):		
		root = TFrame(self.top, style='FlatFrame', borderwidth = 10)
		root.pack(side = TOP, fill = BOTH, expand = 1)
	
		label = TLabel(root, text = '', style='FlatLabel', textvariable=info1)
		label.pack(side = TOP, anchor=W, pady=5)
		
		label = TLabel(root, text = '', style='FlatLabel', textvariable=info2)
		label.pack(side = TOP, anchor=W, pady=5)
		
		self.prgrs = TProgressbar(root, orient = 'horizontal', style='Horizontal.Progress',
								length = 450, value=10, variable=info3)
		self.prgrs.pack(side = TOP, anchor=W)

		self.top.protocol('WM_DELETE_WINDOW', self.cancel)		
		self.top.resizable (width=0, height=0)
开发者ID:kindlychung,项目名称:sk1,代码行数:16,代码来源:progressdialog.py

示例12: PluginBrowser

class PluginBrowser(PluginPanel):

	name = 'PluginBrowser'
	title = _("Plugin Browser")
	icon = 'strip_pbrowser'

	built = 0
	fill = BOTH
	expand = 1

	def init(self, master):
		PluginPanel.init(self, master)
		top = self.panel
		ctheme = app.uimanager.currentColorTheme

		self.browserframe = TFrame(top, style='RoundedFrame', borderwidth=5)
		self.browserframe.pack(side=TOP, fill=BOTH, expand=1)
		self.scanvas = ScrolledCanvas(self.browserframe, bg=ctheme.editfieldbackground, height=150, width=170)
		self.scanvas.frame.pack(side=TOP, fill=BOTH, expand=1)
		self.after_idle(self.rebuild_pb)


	def rebuild_pb(self):
		self.build_plugins_tree()
		ctheme = app.uimanager.currentColorTheme
		item = PluginsTreeItem(self.ptree, self.pcontainer)
		node = TreeNode(self.scanvas.canvas, None, item, ctheme)
		node.expand()

	def build_plugins_tree(self):
		self.ptree = PluginCategory('ROOT', _("Plugins"))
		objprop_group = PluginCategory('ObjProp', _("Object properties"))
		layout_group = PluginCategory('Layout', _("Layout"))
		transform_group = PluginCategory('Transform', _("Transformation"))
		shaping_group = PluginCategory('Shaping', _("Shaping"))
		effects_group = PluginCategory('Effects', _("Effects"))
		extentions_group = PluginCategory('Extentions', _("Extensions"))

		objprop_group.contents = app.objprop_plugins
		layout_group.contents = app.layout_plugins
		transform_group.contents = app.transform_plugins
		shaping_group.contents = app.shaping_plugins
		effects_group.contents = app.effects_plugins
		extentions_group.contents = app.extentions_plugins

		self.ptree.contents += [objprop_group, layout_group, transform_group,
							shaping_group, effects_group, extentions_group]
开发者ID:kindlychung,项目名称:sk1,代码行数:47,代码来源:pbrowser.py

示例13: __init__

	def __init__(self, parent, callback, color, sign, allow_emtpy=1, **kw):
		self.color=color
		self.callback=callback
		TFrame.__init__(self, parent, style='FlatFrame', **kw)
		self.cs_name = StringVar(self)
		self.set_cs_name(self.color)
		
		self.colorspaces = TCombobox(self, state='readonly', postcommand = self.set_cs, 
									 values=self.make_cs_list(allow_emtpy), width=17, style='ComboNormal',
									 textvariable=self.cs_name)
		self.colorspaces.pack(side = BOTTOM, fill=X, pady=3)
		
		label = TLabel(self, text=_("Colorspace:")+" ")
		label.pack(side = LEFT, anchor='sw')
		
		label = TLabel(self, image=sign)
		label.pack(side = RIGHT)
开发者ID:kindlychung,项目名称:sk1,代码行数:17,代码来源:colorspacesel.py

示例14: init

	def init(self, master):
		PluginPanel.init(self, master)
		top = self.panel
		ctheme = app.uimanager.currentColorTheme

		self.browserframe = TFrame(top, style='RoundedFrame', borderwidth=5)
		self.browserframe.pack(side=TOP, fill=BOTH, expand=1)
		self.scanvas = ScrolledCanvas(self.browserframe, bg=ctheme.editfieldbackground, height=150, width=170)
		self.scanvas.frame.pack(side=TOP, fill=BOTH, expand=1)
		self.after_idle(self.rebuild_pb)
开发者ID:kindlychung,项目名称:sk1,代码行数:10,代码来源:pbrowser.py

示例15: init

	def init(self, master):
		
		TFrame.__init__(self, master)
		
		##### Title #########################
		
		self.title_label=TLabel(self, text=self.title, font=config.preferences.large_font, justify=LEFT)
		self.title_label.pack(side=TOP, anchor=W)
		
		##### line #########################
				
		line = TLabel(self, style='HLine2')
		line.pack(side = TOP, fill = X)				

		##### here should be panel content #########################
		
		self.init_vars()		
		self.build()
		self.activated=1
开发者ID:kindlychung,项目名称:sk1,代码行数:19,代码来源:prefpanel.py


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