本文整理汇总了Python中sk1sdk.libttk.TLabel.pack方法的典型用法代码示例。如果您正苦于以下问题:Python TLabel.pack方法的具体用法?Python TLabel.pack怎么用?Python TLabel.pack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sk1sdk.libttk.TLabel
的用法示例。
在下文中一共展示了TLabel.pack方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build_dlg
# 需要导入模块: from sk1sdk.libttk import TLabel [as 别名]
# 或者: from sk1sdk.libttk.TLabel import pack [as 别名]
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)
示例2: __init__
# 需要导入模块: from sk1sdk.libttk import TLabel [as 别名]
# 或者: from sk1sdk.libttk.TLabel import pack [as 别名]
def __init__(self, parent, **kw):
TFrame.__init__(self, parent, style='FlatFrame', **kw)
spot_frame = TFrame(self, borderwidth=2, style='FlatFrame')
spot_frame.pack(side=TOP)
label = TLabel(spot_frame, text=_('Color name:'), justify=LEFT)
label.pack(side=TOP)
self.colorname_value = StringVar('')
self.colorname = TEntrybox(spot_frame, text='', width=25, textvariable=self.colorname_value)
self.colorname.set_state('readonly')
self.colorname.pack(side=BOTTOM, fill=X)
cmyk_frame = TFrame(self, borderwidth=2, style='FlatFrame')
cmyk_frame.pack(side=TOP)
self.CMYK_label = TLabel(cmyk_frame, text='C:\nM:\nY:\nK:', justify=LEFT)
self.CMYK_label.pack(side=LEFT, padx=10)
self.RGB_label = TLabel(cmyk_frame, text='R:\nG:\nB:', justify=LEFT)
self.RGB_label.pack(side=LEFT, padx=10)
self.HTML_label = TLabel(self, text='HTML:', justify=LEFT)
self.HTML_label.pack(side=BOTTOM, pady=5)
示例3: build_dlg
# 需要导入模块: from sk1sdk.libttk import TLabel [as 别名]
# 或者: from sk1sdk.libttk.TLabel import pack [as 别名]
def build_dlg(self):
root = self.top
top = TFrame(root, style='FlatFrame', borderwidth=10)
top.pack(side=TOP, fill=BOTH, expand=1)
frame = TFrame(top, name='top', style='FlatFrame')
frame.pack(side=TOP, fill=BOTH, expand=1)
label = TLabel(frame, image='messagebox_' + self.image, style='FlatLabel')
label.pack(side=LEFT, padx=5, pady=5)
label = TLabel(frame, text=self.message, name='msg', style='FlatLabel', justify='center', anchor='center')
label.pack(side=RIGHT, fill=BOTH, expand=1)
frame = TFrame(top, name='bot', style='FlatFrame')
frame.pack(side=BOTTOM)#, fill = X, expand = 1)
command = self.ok
for i in range(len(self.buttons)):
button = UpdatedButton(frame, text=' ' + self.buttons[i] + ' ', command=command, args=i)
button.grid(column=i, row=0, sticky='ew', padx=10, pady=0)
if i == self.default:
if TkVersion >= 8.0:
button['default'] = 'active'
self.focus_widget = button
else:
if TkVersion >= 8.0:
button['default'] = 'normal'
if self.default is not None:
top.bind('<Return>', self.invoke_default)
frame = TFrame(top, name='mid', style='FlatFrame', borderwidth=1)
frame.pack(side=TOP, fill=X)
root.resizable (width=0, height=0)
示例4: init
# 需要导入模块: from sk1sdk.libttk import TLabel [as 别名]
# 或者: from sk1sdk.libttk.TLabel import pack [as 别名]
def init(self, master):
PluginPanel.init(self, master)
top = TFrame(self.panel, style='FlatFrame', borderwidth=7)
top.pack(side = TOP, fill=BOTH)
sign = TFrame(top, style='RoundedFrame', borderwidth=5)
sign.pack(side=TOP)
self.sign = TLabel(sign, image='color_converter')
self.sign.pack(side=TOP)
self.cs_name = StringVar(top)
self.cs_name.set(RGB)
label = TLabel(top, text=_("Colorspace:")+" ")
label.pack(side = TOP, anchor=W)
self.colorspaces = TCombobox(top, state='readonly', postcommand = self.set_cs,
values=self.make_cs_list(), width=14, style='ComboNormal',
textvariable=self.cs_name)
self.colorspaces.pack(side = TOP, fill=X, pady=3)
button = UpdatedButton(top, text = _("Apply"),
command = self.apply_colorspace,
sensitivecb = self.is_selection)
button.pack(side = BOTTOM, expand = 1, fill = X, pady=3)
self.Subscribe(SELECTION, button.Update)
self.init_from_doc()
self.subscribe_receivers()
示例5: create_balloon
# 需要导入模块: from sk1sdk.libttk import TLabel [as 别名]
# 或者: from sk1sdk.libttk.TLabel import pack [as 别名]
def create_balloon(self, root):
self.root = root
self.balloon = Toplevel(self.root)
self.balloon.withdraw()
self.balloon.overrideredirect(1)
self.balloon["relief"] = 'flat'
label = TLabel(self.balloon, text='Tooltip', style='Tooltips')
label.pack(ipadx=2, ipady=2)
self.balloon_label = label
示例6: init
# 需要导入模块: from sk1sdk.libttk import TLabel [as 别名]
# 或者: from sk1sdk.libttk.TLabel import pack [as 别名]
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='effects_blend')
self.sign.pack(side=TOP)
button_frame = TFrame(top, style='FlatFrame')
button_frame.pack(side=BOTTOM, fill=BOTH, expand=1)
self.update_buttons = []
button = UpdatedButton(top, text=_("Apply"),
command=self.apply_blend,
sensitivecb=self.doc_can_blend)
button.pack(in_=button_frame, side=LEFT, expand=1, fill=X)
self.document.Subscribe(SELECTION, button.Update)
self.update_buttons.append(button)
steps_frame = TFrame(top, style='FlatFrame', borderwidth=15)
steps_frame.pack(side=TOP)
label = TLabel(steps_frame, text=" " + _("Steps:") + " ")
label.pack(side=LEFT, anchor=E)
self.var_steps = IntVar(top)
self.var_steps.set(config.preferences.blend_panel_default_steps)
self.entry = TSpinbox(steps_frame, var=10, vartype=0, textvariable=self.var_steps,
min=1, max=100000, step=1, width=6, command=self.apply_blend)
self.entry.pack(side=LEFT, anchor=E)
button = UpdatedButton(top, text=_("Select Start"),
sensitivecb=self.can_select,
command=self.select_control,
args=SelectStart)
button.pack(side=BOTTOM, fill=X, expand=1, pady=3)
self.document.Subscribe(SELECTION, button.Update)
self.update_buttons.append(button)
button = UpdatedButton(top, text=_("Select End"),
sensitivecb=self.can_select,
command=self.select_control,
args=SelectEnd)
button.pack(side=BOTTOM, fill=X, expand=1)
self.document.Subscribe(SELECTION, button.Update)
self.update_buttons.append(button)
self.init_from_doc()
self.subscribe_receivers()
示例7: __init__
# 需要导入模块: from sk1sdk.libttk import TLabel [as 别名]
# 或者: from sk1sdk.libttk.TLabel import pack [as 别名]
def __init__(self, parent, mainwindow):
self.parent = parent
self.mainwindow = mainwindow
self.doc = self.mainwindow.document
self.panel = TFrame(self.parent, name='ctxPanel', style='ToolBarFrame', borderwidth=2)
label = TLabel(self.panel, image="toolbar_left")
label.pack(side=LEFT)
self.initPanels()
self.mainwindow.Subscribe(DOCUMENT, self.doc_changed)
self.ReSubscribe()
self.changeContent(forPage)
示例8: build_dlg
# 需要导入模块: from sk1sdk.libttk import TLabel [as 别名]
# 或者: from sk1sdk.libttk.TLabel import pack [as 别名]
def build_dlg(self):
root = self.top
top = TFrame(root, borderwidth=5, style='FlatFrame')
top.pack(side=TOP, expand=0, fill=BOTH)
top2 = TFrame(top, style='FlatFrame')
top2.pack(side=TOP, expand=0, fill=X)
format_label = TLabel(top2, text=_('Style name:'), borderwidth=0)
format_label.pack(side=LEFT, pady=3)
self.entry_name = TEntrybox(top, command=self.ok, width=15)
self.entry_name.pack(side=TOP, fill=X)
top2 = TFrame(top, height=5, style='FlatFrame')
top2.pack(side=TOP, expand=0, fill=X)
prop_cont = TLabelframe(top, text=_('Style properties'), padding=10)
prop_cont.pack(side=TOP, fill=X)
properties = self.object.Properties()
self.flags = {}
for prop in property_names:
type = property_types[prop]
if type == FillProperty:
state = self.object.has_fill and NORMAL or DISABLED
elif type == LineProperty:
state = self.object.has_line and NORMAL or DISABLED
elif type == FontProperty:
state = self.object.has_font and NORMAL or DISABLED
else:
# unknown property type!
continue
long, short = property_titles[prop]
self.flags[prop] = var = IntVar(root)
var.set(state == NORMAL)
radio = TCheckbutton(prop_cont, text=long, state=state, variable=var)
radio.pack(side=TOP, anchor=W)
top2 = TFrame(top, height=3, style='FlatFrame')
top2.pack(side=TOP, expand=0, fill=X)
but_frame = Frame(top)
but_frame.pack(side=TOP, fill=X)
button = TButton(but_frame, text=_("Cancel"), command=self.cancel)
button.pack(side=RIGHT, padx=5)
button = TButton(but_frame, text=_("OK"), command=self.ok)
button.pack(side=RIGHT, padx=5)
root.resizable (width=0, height=0)
self.entry_name.set_focus()
示例9: build_dlg
# 需要导入模块: from sk1sdk.libttk import TLabel [as 别名]
# 或者: from sk1sdk.libttk.TLabel import pack [as 别名]
def build_dlg(self):
if not self.builded:
cmds = self.mw.canvas.commands.Ellipse
label = TLabel(self.panel, text=_("Start:"))
label.pack(side=LEFT, padx=2)
self.entry_start = TSpinbox(self.panel, var=0, vartype=1, textvariable=self.start,
min=-360, max=360, step=5, width=6, command=self.applyAngle)
self.entry_start.pack(side=LEFT, padx=2)
tooltips.AddDescription(self.entry_start, _('Arc start point angle'))
#--------------
sep = FlatFrame(self.panel, width=5, height=2)
sep.pack(side=LEFT)
#--------------
label = TLabel(self.panel, text=_("End:"))
label.pack(side=LEFT, padx=2)
self.entry_end = TSpinbox(self.panel, var=0, vartype=1, textvariable=self.end,
min=-360, max=360, step=5, width=6, command=self.applyAngle)
self.entry_end.pack(side=LEFT, padx=2)
tooltips.AddDescription(self.entry_end, _('Arc end point angle'))
b = TButton(self.panel, command=self.ResetAngle, style='Toolbutton', image='context_arc_reset')
tooltips.AddDescription(b, _('Reset angles'))
b.pack(side=LEFT)
b = TButton(self.panel, command=self.SwapAngle, style='Toolbutton', image='context_arc_swap')
tooltips.AddDescription(b, _('Swap angles'))
b.pack(side=LEFT)
b = TLabel(self.panel, image="toolbar_sep")
b.pack(side=LEFT)
b = TButton(self.panel, command=cmds.EllipseArc.Invoke, style='Toolbutton', image='context_arc')
tooltips.AddDescription(b, _('to Arc'))
b.pack(side=LEFT)
b = TButton(self.panel, command=cmds.EllipseChord.Invoke, style='Toolbutton', image='context_chord')
tooltips.AddDescription(b, _('to Chord'))
b.pack(side=LEFT)
b = TButton(self.panel, command=cmds.EllipsePieSlice.Invoke, style='Toolbutton', image='context_pie')
tooltips.AddDescription(b, _('to Pie'))
b.pack(side=LEFT)
self.builded = 1
else:
obj = self.mw.document.CurrentObject()
if obj and obj.is_Ellipse:
start_angle = round(obj.start_angle / degrees, 2)
end_angle = round(obj.end_angle / degrees, 2)
self.entry_start.set_value(start_angle)
self.entry_end.set_value(end_angle)
示例10: __init__
# 需要导入模块: from sk1sdk.libttk import TLabel [as 别名]
# 或者: from sk1sdk.libttk.TLabel import pack [as 别名]
def __init__(self, parent):
CtxSubPanel.__init__(self, parent)
self.my_changes=0
self.var_unit = StringVar(self.mw.root)
self.var_unit.set(config.preferences.default_unit)
label = TLabel(self.panel, text=_("Units:"))
label.pack(side = LEFT, padx=2)
self.entry_width = TCombobox(self.panel, state='readonly', postcommand = self.applyUnits,
values=self.make_units(), width=4, style='ComboNormal', textvariable=self.var_unit)
self.entry_width.pack(side = LEFT, padx=2)
config.preferences.Subscribe(CHANGED, self.update)
示例11: __init__
# 需要导入模块: from sk1sdk.libttk import TLabel [as 别名]
# 或者: from sk1sdk.libttk.TLabel import pack [as 别名]
def __init__(self, master, root, mw, cnf={}, **kw):
self.mw = mw
self.root = root
self.master = master
ResizableTFrame.__init__(self, master, root, size=240, orient=LEFT,
min=240, max=400)
b = TLabel(self.panel, style='HLine')
b.pack(side=BOTTOM, fill=X)
self.pbrowser = PluginBrowser()
self.plugins = app.objprop_plugins + app.layout_plugins
self.plugins += app.transform_plugins + app.extentions_plugins
self.plugins += app.effects_plugins + app.shaping_plugins
self.plugins += [self.pbrowser]
示例12: build_dlg
# 需要导入模块: from sk1sdk.libttk import TLabel [as 别名]
# 或者: from sk1sdk.libttk.TLabel import pack [as 别名]
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)
示例13: __init__
# 需要导入模块: from sk1sdk.libttk import TLabel [as 别名]
# 或者: from sk1sdk.libttk.TLabel import pack [as 别名]
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)
示例14: init
# 需要导入模块: from sk1sdk.libttk import TLabel [as 别名]
# 或者: from sk1sdk.libttk.TLabel import pack [as 别名]
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
示例15: __init__
# 需要导入模块: from sk1sdk.libttk import TLabel [as 别名]
# 或者: from sk1sdk.libttk.TLabel import pack [as 别名]
def __init__(self, parent):
self.my_changes=0
CtxSubPanel.__init__(self, parent)
self.var_jump_number=DoubleVar(self.mw.root)
unit = config.preferences.default_unit
var_jump_unit = StringVar(self.mw.root)
self.var_jump = LengthVar(10, unit, self.var_jump_number, var_jump_unit)
label = TLabel(self.panel, text=_("Jump:"))
label.pack(side = LEFT, padx=2)
self.entry_jump = TSpinbox(self.panel, var=0,
vartype=1, textvariable = self.var_jump_number,
min = 0, max = 1000, step = .1, width = 6, command = self.applyJump)
self.entry_jump.pack(side = LEFT, padx=2)
config.preferences.Subscribe(CHANGED, self.update)
self.var_jump.set(config.preferences.handle_jump)
self.update(0, 0)