Canvas 類別

Canvas 類別

結構化的繪圖畫布(structured graphics canvas)。

選項

在建構這個元件時使用關鍵字引數或是組態方法。

Option Resource Class Default
background background Background systembuttonface
bd (see borderwidth )
bg (see background )
borderwidth borderWidth BorderWidth 0
closeenough closeEnough CloseEnough 1
confine confine Confine 1
cursor cursor Cursor
height height Height 7c
highlightbackground highlightBackground HighlightBackground systembuttonface
highlightcolor highlightColor HighlightColor black
highlightthickness highlightThickness HighlightThickness 2
insertbackground insertBackground Foreground black
insertborderwidth insertBorderWidth BorderWidth 0
insertofftime insertOffTime OffTime 300
insertontime insertOnTime OnTime 600
insertwidth insertWidth InsertWidth 2
relief relief Relief flat
scrollregion scrollRegion ScrollRegion
selectbackground selectBackground Foreground systemhighlight
selectborderwidth selectBorderWidth BorderWidth 1
selectforeground selectForeground Background black
takefocus takeFocus TakeFocus
width width Width 10c
xscrollcommand xScrollCommand ScrollCommand
xscrollincrement xScrollIncrement ScrollIncrement 0
yscrollcommand yScrollCommand ScrollCommand
yscrollincrement yScrollIncrement ScrollIncrement 0

基本方法

方法定義自 Canvas 或繼承自 Widget 或 Pack。

addtag(self, *args)
addtag_above(self, newtag, tagOrId)
addtag_all(self, newtag)
addtag_below(self, newtag, tagOrId)
addtag_closest(self, newtag, x, y, halo=None, start=None)
addtag_enclosed(self, newtag, x1, y1, x2, y2)
addtag_overlapping(self, newtag, x1, y1, x2, y2)
addtag_withtag(self, newtag, tagOrId)
bbox(self, *args)
canvasx(self, screenx, gridspacing=None)
canvasy(self, screeny, gridspacing=None)
cget(self, key) (from Widget)
config(self, cnf=None, **kw) (from Widget)
configure(self, cnf=None, **kw) (from Widget)
coords(self, *args)
create_arc(self, *args, **kw)
create_bitmap(self, *args, **kw)
create_image(self, *args, **kw)
create_line(self, *args, **kw)
create_oval(self, *args, **kw)
create_polygon(self, *args, **kw)
create_rectangle(self, *args, **kw)
create_text(self, *args, **kw)
create_window(self, *args, **kw)
dchars(self, *args)
delete(self, *args)
destroy(self) (from Widget)
dtag(self, *args)
find(self, *args)
find_above(self, tagOrId)
find_all(self)
find_below(self, tagOrId)
find_closest(self, x, y, halo=None, start=None)
find_enclosed(self, x1, y1, x2, y2)
find_overlapping(self, x1, y1, x2, y2)
find_withtag(self, tagOrId)
focus(self, *args)
forget(self) (from Pack)
gettags(self, *args)
icursor(self, *args)
index(self, *args)
info(self) (from Pack)
insert(self, *args)
itemcget(self, tagOrId, option)
itemconfig(self, tagOrId, cnf=None, **kw)
itemconfigure(self, tagOrId, cnf=None, **kw)
keys(self) (from Widget)
lift(self, *args)
lower(self, *args)
move(self, *args)
pack(self, cnf={}, **kw) (from Pack)
pack_forget(self) (from Pack)
pack_info(self) (from Pack)
pack_propagate(self, flag=[‘_noarg_’]) (from Pack)
pack_slaves(self) (from Pack)
postscript(self, cnf={}, **kw)
propagate(self, flag=[‘_noarg_’]) (from Pack)
scale(self, *args)
scan_dragto(self, x, y)
scan_mark(self, x, y)
select_adjust(self, tagOrId, index)
select_clear(self)
select_from(self, tagOrId, index)
select_item(self)
select_to(self, tagOrId, index)
slaves(self) (from Pack)
tag_bind(self, tagOrId, sequence=None, func=None, add=None)
tag_unbind(self, tagOrId, sequence)
tkraise(self, *args)
type(self, tagOrId)
xview(self, *args)
yview(self, *args)

其他方法

方法繼承自超類別而不是 Widget 或 Pack。

after(self, ms, func=None, *args) (from Misc)
after_cancel(self, id) (from Misc)
after_idle(self, func, *args) (from Misc)
bell(self, displayof=0) (from Misc)
bind(self, sequence=None, func=None, add=None) (from Misc)
bind_all(self, sequence=None, func=None, add=None) (from Misc)
bind_class(self, className, sequence=None, func=None, add=None) (from Misc)
bindtags(self, tagList=None) (from Misc)
clipboard_append(self, string, **kw) (from Misc)
clipboard_clear(self, **kw) (from Misc)
colormodel(self, value=None) (from Misc)
columnconfigure(self, index, cnf={}, **kw) (from Grid)
focus_displayof(self) (from Misc)
focus_force(self) (from Misc)
focus_get(self) (from Misc)
focus_lastfor(self) (from Misc)
focus_set(self) (from Misc)
getboolean(self, s) (from Misc)
getdouble(self, s) (from Misc)
getint(self, s) (from Misc)
getvar(self, name=’PY_VAR’) (from Misc)
grab_current(self) (from Misc)
grab_release(self) (from Misc)
grab_set(self) (from Misc)
grab_set_global(self) (from Misc)
grab_status(self) (from Misc)
grid(self, cnf={}, **kw) (from Grid)
grid_bbox(self, column, row) (from Grid)
grid_forget(self) (from Grid)
grid_info(self) (from Grid)
grid_propagate(self, flag=[‘_noarg_’]) (from Grid)
grid_slaves(self, *args) (from Grid)
location(self, x, y) (from Grid)
mainloop(self, n=0) (from Misc)
option_add(self, pattern, value, priority=None) (from Misc)
option_clear(self) (from Misc)
option_get(self, name, className) (from Misc)
option_readfile(self, fileName, priority=None) (from Misc)
place(self, cnf={}, **kw) (from Place)
place_forget(self) (from Place)
place_info(self) (from Place)
place_slaves(self) (from Place)
quit(self) (from Misc)
register(self, func, subst=None) (from Misc)
rowconfigure(self, index, cnf={}, **kw) (from Grid)
selection_clear(self, **kw) (from Misc)
selection_get(self, **kw) (from Misc)
selection_handle(self, command, **kw) (from Misc)
selection_own(self, **kw) (from Misc)
selection_own_get(self, **kw) (from Misc)
send(self, interp, cmd, *args) (from Misc)
setvar(self, name=’PY_VAR’, value=’1′) (from Misc)
size(self) (from Grid)
tk_bisque(self) (from Misc)
tk_focusFollowsMouse(self) (from Misc)
tk_focusNext(self) (from Misc)
tk_focusPrev(self) (from Misc)
tk_menuBar(self, *args) (from Misc)
tk_setPalette(self, *args, **kw) (from Misc)
tk_strictMotif(self, boolean=None) (from Misc)
unbind(self, sequence) (from Misc)
unbind_all(self, sequence) (from Misc)
unbind_class(self, className, sequence) (from Misc)
update(self) (from Misc)
update_idletasks(self) (from Misc)
wait_variable(self, name=’PY_VAR’) (from Misc)
wait_visibility(self, window=None) (from Misc)
wait_window(self, window=None) (from Misc)
waitvar(self, name=’PY_VAR’) (from Misc)
winfo_atom(self, name, displayof=0) (from Misc)
winfo_atomname(self, id, displayof=0) (from Misc)
winfo_cells(self) (from Misc)
winfo_children(self) (from Misc)
winfo_class(self) (from Misc)
winfo_colormapfull(self) (from Misc)
winfo_containing(self, rootX, rootY, displayof=0) (from Misc)
winfo_depth(self) (from Misc)
winfo_exists(self) (from Misc)
winfo_fpixels(self, number) (from Misc)
winfo_geometry(self) (from Misc)
winfo_height(self) (from Misc)
winfo_id(self) (from Misc)
winfo_interps(self, displayof=0) (from Misc)
winfo_ismapped(self) (from Misc)
winfo_name(self) (from Misc)
winfo_parent(self) (from Misc)
winfo_pathname(self, id, displayof=0) (from Misc)
winfo_pixels(self, number) (from Misc)
winfo_reqheight(self) (from Misc)
winfo_reqwidth(self) (from Misc)
winfo_rgb(self, color) (from Misc)
winfo_rootx(self) (from Misc)
winfo_rooty(self) (from Misc)
winfo_screen(self) (from Misc)
winfo_screencells(self) (from Misc)
winfo_screendepth(self) (from Misc)
winfo_screenheight(self) (from Misc)
winfo_screenmmheight(self) (from Misc)
winfo_screenmmwidth(self) (from Misc)
winfo_screenvisual(self) (from Misc)
winfo_screenwidth(self) (from Misc)
winfo_toplevel(self) (from Misc)
winfo_visual(self) (from Misc)
winfo_vrootheight(self) (from Misc)
winfo_vrootwidth(self) (from Misc)
winfo_vrootx(self) (from Misc)
winfo_vrooty(self) (from Misc)
winfo_width(self) (from Misc)
winfo_x(self) (from Misc)
winfo_y(self) (from Misc)

適用於 Tkinter 1.63、 Tcl 7.6 及 Tk 4.2

Print Friendly, PDF & Email
馬上成為工作達人的Fans

About ㄚ琪

工作達人Fun Taiwan的創辦者及總編,可以在這裡更認識他。

2 comments

發表迴響

你的電子郵件位址並不會被公開。 Required fields are marked *

*

這個網站採用 Akismet 服務減少垃圾留言。進一步瞭解 Akismet 如何處理網站訪客的留言資料

Scroll To Top