desc
stringlengths 3
26.7k
| decl
stringlengths 11
7.89k
| bodies
stringlengths 8
553k
|
---|---|---|
'Create oval with coordinates x1,y1,x2,y2.'
| def create_oval(self, *args, **kw):
| return self._create('oval', args, kw)
|
'Create polygon with coordinates x1,y1,...,xn,yn.'
| def create_polygon(self, *args, **kw):
| return self._create('polygon', args, kw)
|
'Create rectangle with coordinates x1,y1,x2,y2.'
| def create_rectangle(self, *args, **kw):
| return self._create('rectangle', args, kw)
|
'Create text with coordinates x1,y1.'
| def create_text(self, *args, **kw):
| return self._create('text', args, kw)
|
'Create window with coordinates x1,y1,x2,y2.'
| def create_window(self, *args, **kw):
| return self._create('window', args, kw)
|
'Delete characters of text items identified by tag or id in ARGS (possibly
several times) from FIRST to LAST character (including).'
| def dchars(self, *args):
| self.tk.call(((self._w, 'dchars') + args))
|
'Delete items identified by all tag or ids contained in ARGS.'
| def delete(self, *args):
| self.tk.call(((self._w, 'delete') + args))
|
'Delete tag or id given as last arguments in ARGS from items
identified by first argument in ARGS.'
| def dtag(self, *args):
| self.tk.call(((self._w, 'dtag') + args))
|
'Internal function.'
| def find(self, *args):
| return (self._getints(self.tk.call(((self._w, 'find') + args))) or ())
|
'Return items above TAGORID.'
| def find_above(self, tagOrId):
| return self.find('above', tagOrId)
|
'Return all items.'
| def find_all(self):
| return self.find('all')
|
'Return all items below TAGORID.'
| def find_below(self, tagOrId):
| return self.find('below', tagOrId)
|
'Return item which is closest to pixel at X, Y.
If several match take the top-most.
All items closer than HALO are considered overlapping (all are
closests). If START is specified the next below this tag is taken.'
| def find_closest(self, x, y, halo=None, start=None):
| return self.find('closest', x, y, halo, start)
|
'Return all items in rectangle defined
by X1,Y1,X2,Y2.'
| def find_enclosed(self, x1, y1, x2, y2):
| return self.find('enclosed', x1, y1, x2, y2)
|
'Return all items which overlap the rectangle
defined by X1,Y1,X2,Y2.'
| def find_overlapping(self, x1, y1, x2, y2):
| return self.find('overlapping', x1, y1, x2, y2)
|
'Return all items with TAGORID.'
| def find_withtag(self, tagOrId):
| return self.find('withtag', tagOrId)
|
'Set focus to the first item specified in ARGS.'
| def focus(self, *args):
| return self.tk.call(((self._w, 'focus') + args))
|
'Return tags associated with the first item specified in ARGS.'
| def gettags(self, *args):
| return self.tk.splitlist(self.tk.call(((self._w, 'gettags') + args)))
|
'Set cursor at position POS in the item identified by TAGORID.
In ARGS TAGORID must be first.'
| def icursor(self, *args):
| self.tk.call(((self._w, 'icursor') + args))
|
'Return position of cursor as integer in item specified in ARGS.'
| def index(self, *args):
| return getint(self.tk.call(((self._w, 'index') + args)))
|
'Insert TEXT in item TAGORID at position POS. ARGS must
be TAGORID POS TEXT.'
| def insert(self, *args):
| self.tk.call(((self._w, 'insert') + args))
|
'Return the resource value for an OPTION for item TAGORID.'
| def itemcget(self, tagOrId, option):
| return self.tk.call(((self._w, 'itemcget') + (tagOrId, ('-' + option))))
|
'Configure resources of an item TAGORID.
The values for resources are specified as keyword
arguments. To get an overview about
the allowed keyword arguments call the method without arguments.'
| def itemconfigure(self, tagOrId, cnf=None, **kw):
| return self._configure(('itemconfigure', tagOrId), cnf, kw)
|
'Lower an item TAGORID given in ARGS
(optional below another item).'
| def tag_lower(self, *args):
| self.tk.call(((self._w, 'lower') + args))
|
'Move an item TAGORID given in ARGS.'
| def move(self, *args):
| self.tk.call(((self._w, 'move') + args))
|
'Print the contents of the canvas to a postscript
file. Valid options: colormap, colormode, file, fontmap,
height, pageanchor, pageheight, pagewidth, pagex, pagey,
rotate, witdh, x, y.'
| def postscript(self, cnf={}, **kw):
| return self.tk.call(((self._w, 'postscript') + self._options(cnf, kw)))
|
'Raise an item TAGORID given in ARGS
(optional above another item).'
| def tag_raise(self, *args):
| self.tk.call(((self._w, 'raise') + args))
|
'Scale item TAGORID with XORIGIN, YORIGIN, XSCALE, YSCALE.'
| def scale(self, *args):
| self.tk.call(((self._w, 'scale') + args))
|
'Remember the current X, Y coordinates.'
| def scan_mark(self, x, y):
| self.tk.call(self._w, 'scan', 'mark', x, y)
|
'Adjust the view of the canvas to GAIN times the
difference between X and Y and the coordinates given in
scan_mark.'
| def scan_dragto(self, x, y, gain=10):
| self.tk.call(self._w, 'scan', 'dragto', x, y, gain)
|
'Adjust the end of the selection near the cursor of an item TAGORID to index.'
| def select_adjust(self, tagOrId, index):
| self.tk.call(self._w, 'select', 'adjust', tagOrId, index)
|
'Clear the selection if it is in this widget.'
| def select_clear(self):
| self.tk.call(self._w, 'select', 'clear')
|
'Set the fixed end of a selection in item TAGORID to INDEX.'
| def select_from(self, tagOrId, index):
| self.tk.call(self._w, 'select', 'from', tagOrId, index)
|
'Return the item which has the selection.'
| def select_item(self):
| return (self.tk.call(self._w, 'select', 'item') or None)
|
'Set the variable end of a selection in item TAGORID to INDEX.'
| def select_to(self, tagOrId, index):
| self.tk.call(self._w, 'select', 'to', tagOrId, index)
|
'Return the type of the item TAGORID.'
| def type(self, tagOrId):
| return (self.tk.call(self._w, 'type', tagOrId) or None)
|
'Construct a checkbutton widget with the parent MASTER.
Valid resource names: activebackground, activeforeground, anchor,
background, bd, bg, bitmap, borderwidth, command, cursor,
disabledforeground, fg, font, foreground, height,
highlightbackground, highlightcolor, highlightthickness, image,
indicatoron, justify, offvalue, onvalue, padx, pady, relief,
selectcolor, selectimage, state, takefocus, text, textvariable,
underline, variable, width, wraplength.'
| def __init__(self, master=None, cnf={}, **kw):
| Widget.__init__(self, master, 'checkbutton', cnf, kw)
|
'Put the button in off-state.'
| def deselect(self):
| self.tk.call(self._w, 'deselect')
|
'Flash the button.'
| def flash(self):
| self.tk.call(self._w, 'flash')
|
'Toggle the button and invoke a command if given as resource.'
| def invoke(self):
| return self.tk.call(self._w, 'invoke')
|
'Put the button in on-state.'
| def select(self):
| self.tk.call(self._w, 'select')
|
'Toggle the button.'
| def toggle(self):
| self.tk.call(self._w, 'toggle')
|
'Construct an entry widget with the parent MASTER.
Valid resource names: background, bd, bg, borderwidth, cursor,
exportselection, fg, font, foreground, highlightbackground,
highlightcolor, highlightthickness, insertbackground,
insertborderwidth, insertofftime, insertontime, insertwidth,
invalidcommand, invcmd, justify, relief, selectbackground,
selectborderwidth, selectforeground, show, state, takefocus,
textvariable, validate, validatecommand, vcmd, width,
xscrollcommand.'
| def __init__(self, master=None, cnf={}, **kw):
| Widget.__init__(self, master, 'entry', cnf, kw)
|
'Delete text from FIRST to LAST (not included).'
| def delete(self, first, last=None):
| self.tk.call(self._w, 'delete', first, last)
|
'Return the text.'
| def get(self):
| return self.tk.call(self._w, 'get')
|
'Insert cursor at INDEX.'
| def icursor(self, index):
| self.tk.call(self._w, 'icursor', index)
|
'Return position of cursor.'
| def index(self, index):
| return getint(self.tk.call(self._w, 'index', index))
|
'Insert STRING at INDEX.'
| def insert(self, index, string):
| self.tk.call(self._w, 'insert', index, string)
|
'Remember the current X, Y coordinates.'
| def scan_mark(self, x):
| self.tk.call(self._w, 'scan', 'mark', x)
|
'Adjust the view of the canvas to 10 times the
difference between X and Y and the coordinates given in
scan_mark.'
| def scan_dragto(self, x):
| self.tk.call(self._w, 'scan', 'dragto', x)
|
'Adjust the end of the selection near the cursor to INDEX.'
| def selection_adjust(self, index):
| self.tk.call(self._w, 'selection', 'adjust', index)
|
'Clear the selection if it is in this widget.'
| def selection_clear(self):
| self.tk.call(self._w, 'selection', 'clear')
|
'Set the fixed end of a selection to INDEX.'
| def selection_from(self, index):
| self.tk.call(self._w, 'selection', 'from', index)
|
'Return True if there are characters selected in the entry, False
otherwise.'
| def selection_present(self):
| return self.tk.getboolean(self.tk.call(self._w, 'selection', 'present'))
|
'Set the selection from START to END (not included).'
| def selection_range(self, start, end):
| self.tk.call(self._w, 'selection', 'range', start, end)
|
'Set the variable end of a selection to INDEX.'
| def selection_to(self, index):
| self.tk.call(self._w, 'selection', 'to', index)
|
'Construct a frame widget with the parent MASTER.
Valid resource names: background, bd, bg, borderwidth, class,
colormap, container, cursor, height, highlightbackground,
highlightcolor, highlightthickness, relief, takefocus, visual, width.'
| def __init__(self, master=None, cnf={}, **kw):
| cnf = _cnfmerge((cnf, kw))
extra = ()
if ('class_' in cnf):
extra = ('-class', cnf['class_'])
del cnf['class_']
elif ('class' in cnf):
extra = ('-class', cnf['class'])
del cnf['class']
Widget.__init__(self, master, 'frame', cnf, {}, extra)
|
'Construct a label widget with the parent MASTER.
STANDARD OPTIONS
activebackground, activeforeground, anchor,
background, bitmap, borderwidth, cursor,
disabledforeground, font, foreground,
highlightbackground, highlightcolor,
highlightthickness, image, justify,
padx, pady, relief, takefocus, text,
textvariable, underline, wraplength
WIDGET-SPECIFIC OPTIONS
height, state, width'
| def __init__(self, master=None, cnf={}, **kw):
| Widget.__init__(self, master, 'label', cnf, kw)
|
'Construct a listbox widget with the parent MASTER.
Valid resource names: background, bd, bg, borderwidth, cursor,
exportselection, fg, font, foreground, height, highlightbackground,
highlightcolor, highlightthickness, relief, selectbackground,
selectborderwidth, selectforeground, selectmode, setgrid, takefocus,
width, xscrollcommand, yscrollcommand, listvariable.'
| def __init__(self, master=None, cnf={}, **kw):
| Widget.__init__(self, master, 'listbox', cnf, kw)
|
'Activate item identified by INDEX.'
| def activate(self, index):
| self.tk.call(self._w, 'activate', index)
|
'Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle
which encloses the item identified by index in ARGS.'
| def bbox(self, *args):
| return (self._getints(self.tk.call(((self._w, 'bbox') + args))) or None)
|
'Return list of indices of currently selected item.'
| def curselection(self):
| return self.tk.splitlist(self.tk.call(self._w, 'curselection'))
|
'Delete items from FIRST to LAST (not included).'
| def delete(self, first, last=None):
| self.tk.call(self._w, 'delete', first, last)
|
'Get list of items from FIRST to LAST (not included).'
| def get(self, first, last=None):
| if last:
return self.tk.splitlist(self.tk.call(self._w, 'get', first, last))
else:
return self.tk.call(self._w, 'get', first)
|
'Return index of item identified with INDEX.'
| def index(self, index):
| i = self.tk.call(self._w, 'index', index)
if (i == 'none'):
return None
return getint(i)
|
'Insert ELEMENTS at INDEX.'
| def insert(self, index, *elements):
| self.tk.call(((self._w, 'insert', index) + elements))
|
'Get index of item which is nearest to y coordinate Y.'
| def nearest(self, y):
| return getint(self.tk.call(self._w, 'nearest', y))
|
'Remember the current X, Y coordinates.'
| def scan_mark(self, x, y):
| self.tk.call(self._w, 'scan', 'mark', x, y)
|
'Adjust the view of the listbox to 10 times the
difference between X and Y and the coordinates given in
scan_mark.'
| def scan_dragto(self, x, y):
| self.tk.call(self._w, 'scan', 'dragto', x, y)
|
'Scroll such that INDEX is visible.'
| def see(self, index):
| self.tk.call(self._w, 'see', index)
|
'Set the fixed end oft the selection to INDEX.'
| def selection_anchor(self, index):
| self.tk.call(self._w, 'selection', 'anchor', index)
|
'Clear the selection from FIRST to LAST (not included).'
| def selection_clear(self, first, last=None):
| self.tk.call(self._w, 'selection', 'clear', first, last)
|
'Return 1 if INDEX is part of the selection.'
| def selection_includes(self, index):
| return self.tk.getboolean(self.tk.call(self._w, 'selection', 'includes', index))
|
'Set the selection from FIRST to LAST (not included) without
changing the currently selected elements.'
| def selection_set(self, first, last=None):
| self.tk.call(self._w, 'selection', 'set', first, last)
|
'Return the number of elements in the listbox.'
| def size(self):
| return getint(self.tk.call(self._w, 'size'))
|
'Return the resource value for an ITEM and an OPTION.'
| def itemcget(self, index, option):
| return self.tk.call(((self._w, 'itemcget') + (index, ('-' + option))))
|
'Configure resources of an ITEM.
The values for resources are specified as keyword arguments.
To get an overview about the allowed keyword arguments
call the method without arguments.
Valid resource names: background, bg, foreground, fg,
selectbackground, selectforeground.'
| def itemconfigure(self, index, cnf=None, **kw):
| return self._configure(('itemconfigure', index), cnf, kw)
|
'Construct menu widget with the parent MASTER.
Valid resource names: activebackground, activeborderwidth,
activeforeground, background, bd, bg, borderwidth, cursor,
disabledforeground, fg, font, foreground, postcommand, relief,
selectcolor, takefocus, tearoff, tearoffcommand, title, type.'
| def __init__(self, master=None, cnf={}, **kw):
| Widget.__init__(self, master, 'menu', cnf, kw)
|
'Post the menu at position X,Y with entry ENTRY.'
| def tk_popup(self, x, y, entry=''):
| self.tk.call('tk_popup', self._w, x, y, entry)
|
'Activate entry at INDEX.'
| def activate(self, index):
| self.tk.call(self._w, 'activate', index)
|
'Internal function.'
| def add(self, itemType, cnf={}, **kw):
| self.tk.call(((self._w, 'add', itemType) + self._options(cnf, kw)))
|
'Add hierarchical menu item.'
| def add_cascade(self, cnf={}, **kw):
| self.add('cascade', (cnf or kw))
|
'Add checkbutton menu item.'
| def add_checkbutton(self, cnf={}, **kw):
| self.add('checkbutton', (cnf or kw))
|
'Add command menu item.'
| def add_command(self, cnf={}, **kw):
| self.add('command', (cnf or kw))
|
'Addd radio menu item.'
| def add_radiobutton(self, cnf={}, **kw):
| self.add('radiobutton', (cnf or kw))
|
'Add separator.'
| def add_separator(self, cnf={}, **kw):
| self.add('separator', (cnf or kw))
|
'Internal function.'
| def insert(self, index, itemType, cnf={}, **kw):
| self.tk.call(((self._w, 'insert', index, itemType) + self._options(cnf, kw)))
|
'Add hierarchical menu item at INDEX.'
| def insert_cascade(self, index, cnf={}, **kw):
| self.insert(index, 'cascade', (cnf or kw))
|
'Add checkbutton menu item at INDEX.'
| def insert_checkbutton(self, index, cnf={}, **kw):
| self.insert(index, 'checkbutton', (cnf or kw))
|
'Add command menu item at INDEX.'
| def insert_command(self, index, cnf={}, **kw):
| self.insert(index, 'command', (cnf or kw))
|
'Addd radio menu item at INDEX.'
| def insert_radiobutton(self, index, cnf={}, **kw):
| self.insert(index, 'radiobutton', (cnf or kw))
|
'Add separator at INDEX.'
| def insert_separator(self, index, cnf={}, **kw):
| self.insert(index, 'separator', (cnf or kw))
|
'Delete menu items between INDEX1 and INDEX2 (included).'
| def delete(self, index1, index2=None):
| if (index2 is None):
index2 = index1
(num_index1, num_index2) = (self.index(index1), self.index(index2))
if ((num_index1 is None) or (num_index2 is None)):
(num_index1, num_index2) = (0, (-1))
for i in range(num_index1, (num_index2 + 1)):
if ('command' in self.entryconfig(i)):
c = str(self.entrycget(i, 'command'))
if c:
self.deletecommand(c)
self.tk.call(self._w, 'delete', index1, index2)
|
'Return the resource value of an menu item for OPTION at INDEX.'
| def entrycget(self, index, option):
| return self.tk.call(self._w, 'entrycget', index, ('-' + option))
|
'Configure a menu item at INDEX.'
| def entryconfigure(self, index, cnf=None, **kw):
| return self._configure(('entryconfigure', index), cnf, kw)
|
'Return the index of a menu item identified by INDEX.'
| def index(self, index):
| i = self.tk.call(self._w, 'index', index)
if (i == 'none'):
return None
return getint(i)
|
'Invoke a menu item identified by INDEX and execute
the associated command.'
| def invoke(self, index):
| return self.tk.call(self._w, 'invoke', index)
|
'Display a menu at position X,Y.'
| def post(self, x, y):
| self.tk.call(self._w, 'post', x, y)
|
'Return the type of the menu item at INDEX.'
| def type(self, index):
| return self.tk.call(self._w, 'type', index)
|
'Unmap a menu.'
| def unpost(self):
| self.tk.call(self._w, 'unpost')
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.