本文整理汇总了Python中sk1sdk.libttk.TFrame.rowconfigure方法的典型用法代码示例。如果您正苦于以下问题:Python TFrame.rowconfigure方法的具体用法?Python TFrame.rowconfigure怎么用?Python TFrame.rowconfigure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sk1sdk.libttk.TFrame
的用法示例。
在下文中一共展示了TFrame.rowconfigure方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build_tab_license
# 需要导入模块: from sk1sdk.libttk import TFrame [as 别名]
# 或者: from sk1sdk.libttk.TFrame import rowconfigure [as 别名]
def build_tab_license(self):
panel = TFrame(self.root, style='FlatFrame', borderwidth=5)
self.nb.add(panel, text=_('License'))
subpanel = TFrame(panel, style='RoundedFrame', borderwidth=4)
subpanel.grid(sticky=N + S + E + W)
panel.rowconfigure(0, weight=1)
panel.columnconfigure(0, weight=1)
subpanel.rowconfigure(0, weight=1)
subpanel.columnconfigure(0, weight=1)
sb = TScrollbar(subpanel)
sb.grid(row=0, column=1, sticky=N + S)
text = Text(subpanel, highlightthickness=0,
font=app.config.preferences.fixed_font, wrap=NONE)
text.grid(row=0, column=0, sticky=N + S + E + W)
text['yscrollcommand'] = sb.set
sb['command'] = text.yview
text['state'] = NORMAL
import aboutdlg_lic
txt = aboutdlg_lic.LICENSE
text.insert(END, txt)
text['state'] = DISABLED
示例2: build_tab_authors
# 需要导入模块: from sk1sdk.libttk import TFrame [as 别名]
# 或者: from sk1sdk.libttk.TFrame import rowconfigure [as 别名]
def build_tab_authors(self):
panel = TFrame(self.root, style='FlatFrame', borderwidth=5)
self.nb.add(panel, text=_('Authors'))
subpanel = TFrame(panel, style='RoundedFrame', borderwidth=4)
subpanel.grid(sticky=N + S + E + W)
panel.rowconfigure(0, weight=1)
panel.columnconfigure(0, weight=1)
subpanel.rowconfigure(0, weight=1)
subpanel.columnconfigure(0, weight=1)
sb = TScrollbar(subpanel)
sb.grid(row=0, column=1, sticky=N + S)
text = Text(subpanel, bg='white', highlightthickness=0, wrap=NONE)
text.grid(row=0, column=0, sticky=N + S + E + W)
text['yscrollcommand'] = sb.set
sb['command'] = text.yview
txt = _('\nTo report bugs please use project bugtracker: https://bugs.launchpad.net/sk1/\n\n')
txt += _('Igor Novikov\n [email protected]\n Project Leader\n\n')
txt += _('Maxim Barabash\n [email protected]\n Designer\n\n')
txt += _('Acknowledgments:\n=======================================\n')
txt += _('Valek Fillipov\n CDR format reverse engineering\n\n')
txt += _('Alexandre Prokoudine\n [email protected]\n Information support (http://linuxgraphics.ru)')
text['state'] = NORMAL
text.insert(END, txt)
text['state'] = DISABLED
示例3: __init__
# 需要导入模块: from sk1sdk.libttk import TFrame [as 别名]
# 或者: from sk1sdk.libttk.TFrame import rowconfigure [as 别名]
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)
示例4: build_tab_localization
# 需要导入模块: from sk1sdk.libttk import TFrame [as 别名]
# 或者: from sk1sdk.libttk.TFrame import rowconfigure [as 别名]
def build_tab_localization(self):
panel = TFrame(self.root, style='FlatFrame', borderwidth=5)
self.nb.add(panel, text=_('Localization'))
subpanel = TFrame(panel, style='RoundedFrame', borderwidth=4)
subpanel.grid(sticky=N + S + E + W)
panel.rowconfigure(0, weight=1)
panel.columnconfigure(0, weight=1)
subpanel.rowconfigure(0, weight=1)
subpanel.columnconfigure(0, weight=1)
sb = TScrollbar(subpanel)
sb.grid(row=0, column=1, sticky=N + S)
text = Text(subpanel, bg='white', highlightthickness=0, wrap=NONE)
text.grid(row=0, column=0, sticky=N + S + E + W)
text['yscrollcommand'] = sb.set
sb['command'] = text.yview
text['state'] = NORMAL
text.insert(END, TRANSLATORS)
text['state'] = DISABLED
示例5: build_window
# 需要导入模块: from sk1sdk.libttk import TFrame [as 别名]
# 或者: from sk1sdk.libttk.TFrame import rowconfigure [as 别名]
#.........这里部分代码省略.........
bg=config.preferences.ruler_color, relief='flat')
hrule.grid(in_=frame, column=2, row=0, sticky='nsew', columnspan=2)
hrule.bind('<Double-Button-1>', self.RulerDoublePressH)
####################################
vrule = tkruler.Ruler(frame, orient=tkruler.VERTICAL,
bg=config.preferences.ruler_color, relief='flat')
vrule.grid(in_=frame, column=1, row=1, sticky='nsew', rowspan=2)
vrule.bind('<Double-Button-1>', self.RulerDoublePressV)
#ruler corner
b = tkruler.RulerCorner(frame, bg=config.preferences.ruler_color)
tooltips.AddDescription(b, _('Change system coordinates'))
b.grid(column=1, row=0, sticky='news')
resolution = config.preferences.screen_resolution
self.canvas = SketchCanvas(root, toplevel=root, background='white', name='canvas',
width=self.root.winfo_screenwidth(), height=self.root.winfo_screenheight(),
resolution=resolution, main_window=self, document=self.document)
self.canvas.grid(in_=frame, column=2, row=1, sticky='news')
self.canvas.focus()
self.canvas.SetScrollbars(hbar, vbar)
self.canvas.SetRulers(hrule, vrule)
vrule.SetCanvas(self.canvas)
hrule.SetCanvas(self.canvas)
frame.columnconfigure(0, weight=0)
frame.columnconfigure(1, weight=0)
frame.columnconfigure(2, weight=1)
frame.columnconfigure(3, weight=0)
frame.rowconfigure(0, weight=0)
frame.rowconfigure(1, weight=1)
frame.rowconfigure(2, weight=0)
hbar['command'] = self.canvas._w + ' xview'
vbar['command'] = self.canvas._w + ' yview'
# the palette
pal = palette.get_default_palette()
palette_trough = TFrame(palette_frame, style='FlatFrame')
palette_container = TFrame(palette_trough, style='FlatFrame')
self.palette = palette.PaletteWidget(palette_container)
self.palette.SetPalette(pal)
ScrollXUnits = self.palette.ScrollXUnits
ScrollXPages = self.palette.ScrollXPages
CanScrollLeft = self.palette.CanScrollLeft
CanScrollRight = self.palette.CanScrollRight
but1 = UpdatedTButton(palette_frame, class_='Repeater', style='Pal2TopButton', image='pal_dbl_arrow_up',
command=ScrollXPages, args=-1, sensitivecb=CanScrollLeft)
but1.pack(side=TOP)
but2 = UpdatedTButton(palette_frame, class_='Repeater', style='PalTopButton', image='pal_arrow_up',
command=ScrollXUnits, args=-1, sensitivecb=CanScrollLeft)
but2.pack(side=TOP)
palette_trough.pack(side=TOP, fill=Y, expand=1)
b = TLabel(palette_trough, style='PalLBorder')
b.pack(side=LEFT, fill=Y)
palette_container.pack(side=LEFT, fill=Y, expand=1)
but = UpdatedTButton(palette_container, style='PalNoColorButton', image='pal_no_color',
command=self.no_pattern, args='fill')
but.pack(side=TOP)
but.bind('<ButtonPress-3>', self.no_pattern, 'line')
tooltips.AddDescription(but, _("No color"))
self.palette.pack(side=LEFT, fill=Y, expand=1)
b = TLabel(palette_trough, style='PalRBorder')
b.pack(side='right', fill=Y)
but3 = UpdatedTButton(palette_frame, class_='Repeater', style='PalBottomButton', image='pal_arrow_down',
command=ScrollXUnits, args=+1, sensitivecb=CanScrollRight)
but3.pack(side=TOP)
but4 = UpdatedTButton(palette_frame, class_='Repeater', style='Pal2BottomButton', image='pal_dbl_arrow_down',
command=ScrollXPages, args=+1, sensitivecb=CanScrollRight)
but4.pack(side=TOP)
self.palette.Subscribe(COLOR1, self.canvas.FillSolid)
self.palette.Subscribe(COLOR2, self.canvas.LineColor)
root.protocol('WM_DELETE_WINDOW', tkext.MakeMethodCommand(self.Exit))
#Binding for mouse wheel
self.palette.bind('<Button-4>', self.ScrollUpPallette)
self.palette.bind('<Button-5>', self.ScrollDownPallette)
self.canvas.bind('<Button-4>', self.ScrollUpCanvas)
self.canvas.bind('<Button-5>', self.ScrollDownCanvas)
self.canvas.bind('<Control-Button-4>', self.ScrollLeftCanvas)
self.canvas.bind('<Control-Button-5>', self.ScrollRightCanvas)
self.canvas.bind('<Shift-Button-4>', self.CanvasZoomingOut)
self.canvas.bind('<Shift-Button-5>', self.CanvasZoomingIn)