desc stringlengths 3 26.7k | decl stringlengths 11 7.89k | bodies stringlengths 8 553k |
|---|---|---|
'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)):
... |
'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
else:
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')
|
'Return the y-position of the topmost pixel of the menu item at INDEX.'
| def yposition(self, index):
| return getint(self.tk.call(self._w, 'yposition', index))
|
'Construct a radiobutton 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, padx... | def __init__(self, master=None, cnf={}, **kw):
| Widget.__init__(self, master, 'radiobutton', 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')
|
'Construct a scale widget with the parent MASTER.
Valid resource names: activebackground, background, bigincrement, bd,
bg, borderwidth, command, cursor, digits, fg, font, foreground, from,
highlightbackground, highlightcolor, highlightthickness, label,
length, orient, relief, repeatdelay, repeatinterval, resolution,
s... | def __init__(self, master=None, cnf={}, **kw):
| Widget.__init__(self, master, 'scale', cnf, kw)
|
'Get the current value as integer or float.'
| def get(self):
| value = self.tk.call(self._w, 'get')
try:
return getint(value)
except ValueError:
return getdouble(value)
|
'Set the value to VALUE.'
| def set(self, value):
| self.tk.call(self._w, 'set', value)
|
'Return a tuple (X,Y) of the point along the centerline of the
trough that corresponds to VALUE or the current value if None is
given.'
| def coords(self, value=None):
| return self._getints(self.tk.call(self._w, 'coords', value))
|
'Return where the point X,Y lies. Valid return values are "slider",
"though1" and "though2".'
| def identify(self, x, y):
| return self.tk.call(self._w, 'identify', x, y)
|
'Construct a scrollbar widget with the parent MASTER.
Valid resource names: activebackground, activerelief,
background, bd, bg, borderwidth, command, cursor,
elementborderwidth, highlightbackground,
highlightcolor, highlightthickness, jump, orient,
relief, repeatdelay, repeatinterval, takefocus,
troughcolor, width.'
| def __init__(self, master=None, cnf={}, **kw):
| Widget.__init__(self, master, 'scrollbar', cnf, kw)
|
'Display the element at INDEX with activebackground and activerelief.
INDEX can be "arrow1","slider" or "arrow2".'
| def activate(self, index):
| self.tk.call(self._w, 'activate', index)
|
'Return the fractional change of the scrollbar setting if it
would be moved by DELTAX or DELTAY pixels.'
| def delta(self, deltax, deltay):
| return getdouble(self.tk.call(self._w, 'delta', deltax, deltay))
|
'Return the fractional value which corresponds to a slider
position of X,Y.'
| def fraction(self, x, y):
| return getdouble(self.tk.call(self._w, 'fraction', x, y))
|
'Return the element under position X,Y as one of
"arrow1","slider","arrow2" or "".'
| def identify(self, x, y):
| return self.tk.call(self._w, 'identify', x, y)
|
'Return the current fractional values (upper and lower end)
of the slider position.'
| def get(self):
| return self._getdoubles(self.tk.call(self._w, 'get'))
|
'Set the fractional values of the slider position (upper and
lower ends as value between 0 and 1).'
| def set(self, *args):
| self.tk.call(((self._w, 'set') + args))
|
'Construct a text widget with the parent MASTER.
STANDARD OPTIONS
background, borderwidth, cursor,
exportselection, font, foreground,
highlightbackground, highlightcolor,
highlightthickness, insertbackground,
insertborderwidth, insertofftime,
insertontime, insertwidth, padx, pady,
relief, selectbackground,
selectborder... | def __init__(self, master=None, cnf={}, **kw):
| Widget.__init__(self, master, 'text', cnf, kw)
|
'Return a tuple of (x,y,width,height) which gives the bounding
box of the visible part of the character at the index in ARGS.'
| def bbox(self, *args):
| return (self._getints(self.tk.call(((self._w, 'bbox') + args))) or None)
|
'Return whether between index INDEX1 and index INDEX2 the
relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=.'
| def compare(self, index1, op, index2):
| return self.tk.getboolean(self.tk.call(self._w, 'compare', index1, op, index2))
|
'Turn on the internal consistency checks of the B-Tree inside the text
widget according to BOOLEAN.'
| def debug(self, boolean=None):
| return self.tk.getboolean(self.tk.call(self._w, 'debug', boolean))
|
'Delete the characters between INDEX1 and INDEX2 (not included).'
| def delete(self, index1, index2=None):
| self.tk.call(self._w, 'delete', index1, index2)
|
'Return tuple (x,y,width,height,baseline) giving the bounding box
and baseline position of the visible part of the line containing
the character at INDEX.'
| def dlineinfo(self, index):
| return self._getints(self.tk.call(self._w, 'dlineinfo', index))
|
'Return the contents of the widget between index1 and index2.
The type of contents returned in filtered based on the keyword
parameters; if \'all\', \'image\', \'mark\', \'tag\', \'text\', or \'window\' are
given and true, then the corresponding items are returned. The result
is a list of triples of the form (key, valu... | def dump(self, index1, index2=None, command=None, **kw):
| args = []
func_name = None
result = None
if (not command):
result = []
def append_triple(key, value, index, result=result):
result.append((key, value, index))
command = append_triple
try:
if (not isinstance(command, str)):
func_name = command =... |
'Internal method
This method controls the undo mechanism and
the modified flag. The exact behavior of the
command depends on the option argument that
follows the edit argument. The following forms
of the command are currently supported:
edit_modified, edit_redo, edit_reset, edit_separator
and edit_undo'
| def edit(self, *args):
| return self.tk.call(self._w, 'edit', *args)
|
'Get or Set the modified flag
If arg is not specified, returns the modified
flag of the widget. The insert, delete, edit undo and
edit redo commands or the user can set or clear the
modified flag. If boolean is specified, sets the
modified flag of the widget to arg.'
| def edit_modified(self, arg=None):
| return self.edit('modified', arg)
|
'Redo the last undone edit
When the undo option is true, reapplies the last
undone edits provided no other edits were done since
then. Generates an error when the redo stack is empty.
Does nothing when the undo option is false.'
| def edit_redo(self):
| return self.edit('redo')
|
'Clears the undo and redo stacks'
| def edit_reset(self):
| return self.edit('reset')
|
'Inserts a separator (boundary) on the undo stack.
Does nothing when the undo option is false'
| def edit_separator(self):
| return self.edit('separator')
|
'Undoes the last edit action
If the undo option is true. An edit action is defined
as all the insert and delete commands that are recorded
on the undo stack in between two separators. Generates
an error when the undo stack is empty. Does nothing
when the undo option is false'
| def edit_undo(self):
| return self.edit('undo')
|
'Return the text from INDEX1 to INDEX2 (not included).'
| def get(self, index1, index2=None):
| return self.tk.call(self._w, 'get', index1, index2)
|
'Return the value of OPTION of an embedded image at INDEX.'
| def image_cget(self, index, option):
| if (option[:1] != '-'):
option = ('-' + option)
if (option[(-1):] == '_'):
option = option[:(-1)]
return self.tk.call(self._w, 'image', 'cget', index, option)
|
'Configure an embedded image at INDEX.'
| def image_configure(self, index, cnf=None, **kw):
| return self._configure(('image', 'configure', index), cnf, kw)
|
'Create an embedded image at INDEX.'
| def image_create(self, index, cnf={}, **kw):
| return self.tk.call(self._w, 'image', 'create', index, *self._options(cnf, kw))
|
'Return all names of embedded images in this widget.'
| def image_names(self):
| return self.tk.call(self._w, 'image', 'names')
|
'Return the index in the form line.char for INDEX.'
| def index(self, index):
| return str(self.tk.call(self._w, 'index', index))
|
'Insert CHARS before the characters at INDEX. An additional
tag can be given in ARGS. Additional CHARS and tags can follow in ARGS.'
| def insert(self, index, chars, *args):
| self.tk.call(((self._w, 'insert', index, chars) + args))
|
'Change the gravity of a mark MARKNAME to DIRECTION (LEFT or RIGHT).
Return the current value if None is given for DIRECTION.'
| def mark_gravity(self, markName, direction=None):
| return self.tk.call((self._w, 'mark', 'gravity', markName, direction))
|
'Return all mark names.'
| def mark_names(self):
| return self.tk.splitlist(self.tk.call(self._w, 'mark', 'names'))
|
'Set mark MARKNAME before the character at INDEX.'
| def mark_set(self, markName, index):
| self.tk.call(self._w, 'mark', 'set', markName, index)
|
'Delete all marks in MARKNAMES.'
| def mark_unset(self, *markNames):
| self.tk.call(((self._w, 'mark', 'unset') + markNames))
|
'Return the name of the next mark after INDEX.'
| def mark_next(self, index):
| return (self.tk.call(self._w, 'mark', 'next', index) or None)
|
'Return the name of the previous mark before INDEX.'
| def mark_previous(self, index):
| return (self.tk.call(self._w, 'mark', 'previous', index) or None)
|
'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 text 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)
|
'Search PATTERN beginning from INDEX until STOPINDEX.
Return the index of the first character of a match or an
empty string.'
| def search(self, pattern, index, stopindex=None, forwards=None, backwards=None, exact=None, regexp=None, nocase=None, count=None, elide=None):
| args = [self._w, 'search']
if forwards:
args.append('-forwards')
if backwards:
args.append('-backwards')
if exact:
args.append('-exact')
if regexp:
args.append('-regexp')
if nocase:
args.append('-nocase')
if elide:
args.append('-elide')
if ... |
'Scroll such that the character at INDEX is visible.'
| def see(self, index):
| self.tk.call(self._w, 'see', index)
|
'Add tag TAGNAME to all characters between INDEX1 and index2 in ARGS.
Additional pairs of indices may follow in ARGS.'
| def tag_add(self, tagName, index1, *args):
| self.tk.call(((self._w, 'tag', 'add', tagName, index1) + args))
|
'Unbind for all characters with TAGNAME for event SEQUENCE the
function identified with FUNCID.'
| def tag_unbind(self, tagName, sequence, funcid=None):
| self.tk.call(self._w, 'tag', 'bind', tagName, sequence, '')
if funcid:
self.deletecommand(funcid)
|
'Bind to all characters with TAGNAME at event SEQUENCE a call to function FUNC.
An additional boolean parameter ADD specifies whether FUNC will be
called additionally to the other bound function or whether it will
replace the previous function. See bind for the return value.'
| def tag_bind(self, tagName, sequence, func, add=None):
| return self._bind((self._w, 'tag', 'bind', tagName), sequence, func, add)
|
'Return the value of OPTION for tag TAGNAME.'
| def tag_cget(self, tagName, option):
| if (option[:1] != '-'):
option = ('-' + option)
if (option[(-1):] == '_'):
option = option[:(-1)]
return self.tk.call(self._w, 'tag', 'cget', tagName, option)
|
'Configure a tag TAGNAME.'
| def tag_configure(self, tagName, cnf=None, **kw):
| return self._configure(('tag', 'configure', tagName), cnf, kw)
|
'Delete all tags in TAGNAMES.'
| def tag_delete(self, *tagNames):
| self.tk.call(((self._w, 'tag', 'delete') + tagNames))
|
'Change the priority of tag TAGNAME such that it is lower
than the priority of BELOWTHIS.'
| def tag_lower(self, tagName, belowThis=None):
| self.tk.call(self._w, 'tag', 'lower', tagName, belowThis)
|
'Return a list of all tag names.'
| def tag_names(self, index=None):
| return self.tk.splitlist(self.tk.call(self._w, 'tag', 'names', index))
|
'Return a list of start and end index for the first sequence of
characters between INDEX1 and INDEX2 which all have tag TAGNAME.
The text is searched forward from INDEX1.'
| def tag_nextrange(self, tagName, index1, index2=None):
| return self.tk.splitlist(self.tk.call(self._w, 'tag', 'nextrange', tagName, index1, index2))
|
'Return a list of start and end index for the first sequence of
characters between INDEX1 and INDEX2 which all have tag TAGNAME.
The text is searched backwards from INDEX1.'
| def tag_prevrange(self, tagName, index1, index2=None):
| return self.tk.splitlist(self.tk.call(self._w, 'tag', 'prevrange', tagName, index1, index2))
|
'Change the priority of tag TAGNAME such that it is higher
than the priority of ABOVETHIS.'
| def tag_raise(self, tagName, aboveThis=None):
| self.tk.call(self._w, 'tag', 'raise', tagName, aboveThis)
|
'Return a list of ranges of text which have tag TAGNAME.'
| def tag_ranges(self, tagName):
| return self.tk.splitlist(self.tk.call(self._w, 'tag', 'ranges', tagName))
|
'Remove tag TAGNAME from all characters between INDEX1 and INDEX2.'
| def tag_remove(self, tagName, index1, index2=None):
| self.tk.call(self._w, 'tag', 'remove', tagName, index1, index2)
|
'Return the value of OPTION of an embedded window at INDEX.'
| def window_cget(self, index, option):
| if (option[:1] != '-'):
option = ('-' + option)
if (option[(-1):] == '_'):
option = option[:(-1)]
return self.tk.call(self._w, 'window', 'cget', index, option)
|
'Configure an embedded window at INDEX.'
| def window_configure(self, index, cnf=None, **kw):
| return self._configure(('window', 'configure', index), cnf, kw)
|
'Create a window at INDEX.'
| def window_create(self, index, cnf={}, **kw):
| self.tk.call(((self._w, 'window', 'create', index) + self._options(cnf, kw)))
|
'Return all names of embedded windows in this widget.'
| def window_names(self):
| return self.tk.splitlist(self.tk.call(self._w, 'window', 'names'))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.