Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/smanonr..../lib64/python3..../tkinter
File: ttk.py
class, cursor, style, takefocus
[1000] Fix | Delete
[1001] Fix | Delete
WIDGET-SPECIFIC OPTIONS
[1002] Fix | Delete
[1003] Fix | Delete
orient, length, mode, maximum, value, variable, phase
[1004] Fix | Delete
"""
[1005] Fix | Delete
Widget.__init__(self, master, "ttk::progressbar", kw)
[1006] Fix | Delete
[1007] Fix | Delete
[1008] Fix | Delete
def start(self, interval=None):
[1009] Fix | Delete
"""Begin autoincrement mode: schedules a recurring timer event
[1010] Fix | Delete
that calls method step every interval milliseconds.
[1011] Fix | Delete
[1012] Fix | Delete
interval defaults to 50 milliseconds (20 steps/second) if omitted."""
[1013] Fix | Delete
self.tk.call(self._w, "start", interval)
[1014] Fix | Delete
[1015] Fix | Delete
[1016] Fix | Delete
def step(self, amount=None):
[1017] Fix | Delete
"""Increments the value option by amount.
[1018] Fix | Delete
[1019] Fix | Delete
amount defaults to 1.0 if omitted."""
[1020] Fix | Delete
self.tk.call(self._w, "step", amount)
[1021] Fix | Delete
[1022] Fix | Delete
[1023] Fix | Delete
def stop(self):
[1024] Fix | Delete
"""Stop autoincrement mode: cancels any recurring timer event
[1025] Fix | Delete
initiated by start."""
[1026] Fix | Delete
self.tk.call(self._w, "stop")
[1027] Fix | Delete
[1028] Fix | Delete
[1029] Fix | Delete
class Radiobutton(Widget):
[1030] Fix | Delete
"""Ttk Radiobutton widgets are used in groups to show or change a
[1031] Fix | Delete
set of mutually-exclusive options."""
[1032] Fix | Delete
[1033] Fix | Delete
def __init__(self, master=None, **kw):
[1034] Fix | Delete
"""Construct a Ttk Radiobutton with parent master.
[1035] Fix | Delete
[1036] Fix | Delete
STANDARD OPTIONS
[1037] Fix | Delete
[1038] Fix | Delete
class, compound, cursor, image, state, style, takefocus,
[1039] Fix | Delete
text, textvariable, underline, width
[1040] Fix | Delete
[1041] Fix | Delete
WIDGET-SPECIFIC OPTIONS
[1042] Fix | Delete
[1043] Fix | Delete
command, value, variable
[1044] Fix | Delete
"""
[1045] Fix | Delete
Widget.__init__(self, master, "ttk::radiobutton", kw)
[1046] Fix | Delete
[1047] Fix | Delete
[1048] Fix | Delete
def invoke(self):
[1049] Fix | Delete
"""Sets the option variable to the option value, selects the
[1050] Fix | Delete
widget, and invokes the associated command.
[1051] Fix | Delete
[1052] Fix | Delete
Returns the result of the command, or an empty string if
[1053] Fix | Delete
no command is specified."""
[1054] Fix | Delete
return self.tk.call(self._w, "invoke")
[1055] Fix | Delete
[1056] Fix | Delete
[1057] Fix | Delete
class Scale(Widget, tkinter.Scale):
[1058] Fix | Delete
"""Ttk Scale widget is typically used to control the numeric value of
[1059] Fix | Delete
a linked variable that varies uniformly over some range."""
[1060] Fix | Delete
[1061] Fix | Delete
def __init__(self, master=None, **kw):
[1062] Fix | Delete
"""Construct a Ttk Scale with parent master.
[1063] Fix | Delete
[1064] Fix | Delete
STANDARD OPTIONS
[1065] Fix | Delete
[1066] Fix | Delete
class, cursor, style, takefocus
[1067] Fix | Delete
[1068] Fix | Delete
WIDGET-SPECIFIC OPTIONS
[1069] Fix | Delete
[1070] Fix | Delete
command, from, length, orient, to, value, variable
[1071] Fix | Delete
"""
[1072] Fix | Delete
Widget.__init__(self, master, "ttk::scale", kw)
[1073] Fix | Delete
[1074] Fix | Delete
[1075] Fix | Delete
def configure(self, cnf=None, **kw):
[1076] Fix | Delete
"""Modify or query scale options.
[1077] Fix | Delete
[1078] Fix | Delete
Setting a value for any of the "from", "from_" or "to" options
[1079] Fix | Delete
generates a <<RangeChanged>> event."""
[1080] Fix | Delete
retval = Widget.configure(self, cnf, **kw)
[1081] Fix | Delete
if not isinstance(cnf, (type(None), str)):
[1082] Fix | Delete
kw.update(cnf)
[1083] Fix | Delete
if any(['from' in kw, 'from_' in kw, 'to' in kw]):
[1084] Fix | Delete
self.event_generate('<<RangeChanged>>')
[1085] Fix | Delete
return retval
[1086] Fix | Delete
[1087] Fix | Delete
[1088] Fix | Delete
def get(self, x=None, y=None):
[1089] Fix | Delete
"""Get the current value of the value option, or the value
[1090] Fix | Delete
corresponding to the coordinates x, y if they are specified.
[1091] Fix | Delete
[1092] Fix | Delete
x and y are pixel coordinates relative to the scale widget
[1093] Fix | Delete
origin."""
[1094] Fix | Delete
return self.tk.call(self._w, 'get', x, y)
[1095] Fix | Delete
[1096] Fix | Delete
[1097] Fix | Delete
class Scrollbar(Widget, tkinter.Scrollbar):
[1098] Fix | Delete
"""Ttk Scrollbar controls the viewport of a scrollable widget."""
[1099] Fix | Delete
[1100] Fix | Delete
def __init__(self, master=None, **kw):
[1101] Fix | Delete
"""Construct a Ttk Scrollbar with parent master.
[1102] Fix | Delete
[1103] Fix | Delete
STANDARD OPTIONS
[1104] Fix | Delete
[1105] Fix | Delete
class, cursor, style, takefocus
[1106] Fix | Delete
[1107] Fix | Delete
WIDGET-SPECIFIC OPTIONS
[1108] Fix | Delete
[1109] Fix | Delete
command, orient
[1110] Fix | Delete
"""
[1111] Fix | Delete
Widget.__init__(self, master, "ttk::scrollbar", kw)
[1112] Fix | Delete
[1113] Fix | Delete
[1114] Fix | Delete
class Separator(Widget):
[1115] Fix | Delete
"""Ttk Separator widget displays a horizontal or vertical separator
[1116] Fix | Delete
bar."""
[1117] Fix | Delete
[1118] Fix | Delete
def __init__(self, master=None, **kw):
[1119] Fix | Delete
"""Construct a Ttk Separator with parent master.
[1120] Fix | Delete
[1121] Fix | Delete
STANDARD OPTIONS
[1122] Fix | Delete
[1123] Fix | Delete
class, cursor, style, takefocus
[1124] Fix | Delete
[1125] Fix | Delete
WIDGET-SPECIFIC OPTIONS
[1126] Fix | Delete
[1127] Fix | Delete
orient
[1128] Fix | Delete
"""
[1129] Fix | Delete
Widget.__init__(self, master, "ttk::separator", kw)
[1130] Fix | Delete
[1131] Fix | Delete
[1132] Fix | Delete
class Sizegrip(Widget):
[1133] Fix | Delete
"""Ttk Sizegrip allows the user to resize the containing toplevel
[1134] Fix | Delete
window by pressing and dragging the grip."""
[1135] Fix | Delete
[1136] Fix | Delete
def __init__(self, master=None, **kw):
[1137] Fix | Delete
"""Construct a Ttk Sizegrip with parent master.
[1138] Fix | Delete
[1139] Fix | Delete
STANDARD OPTIONS
[1140] Fix | Delete
[1141] Fix | Delete
class, cursor, state, style, takefocus
[1142] Fix | Delete
"""
[1143] Fix | Delete
Widget.__init__(self, master, "ttk::sizegrip", kw)
[1144] Fix | Delete
[1145] Fix | Delete
[1146] Fix | Delete
class Spinbox(Entry):
[1147] Fix | Delete
"""Ttk Spinbox is an Entry with increment and decrement arrows
[1148] Fix | Delete
[1149] Fix | Delete
It is commonly used for number entry or to select from a list of
[1150] Fix | Delete
string values.
[1151] Fix | Delete
"""
[1152] Fix | Delete
[1153] Fix | Delete
def __init__(self, master=None, **kw):
[1154] Fix | Delete
"""Construct a Ttk Spinbox widget with the parent master.
[1155] Fix | Delete
[1156] Fix | Delete
STANDARD OPTIONS
[1157] Fix | Delete
[1158] Fix | Delete
class, cursor, style, takefocus, validate,
[1159] Fix | Delete
validatecommand, xscrollcommand, invalidcommand
[1160] Fix | Delete
[1161] Fix | Delete
WIDGET-SPECIFIC OPTIONS
[1162] Fix | Delete
[1163] Fix | Delete
to, from_, increment, values, wrap, format, command
[1164] Fix | Delete
"""
[1165] Fix | Delete
Entry.__init__(self, master, "ttk::spinbox", **kw)
[1166] Fix | Delete
[1167] Fix | Delete
[1168] Fix | Delete
def set(self, value):
[1169] Fix | Delete
"""Sets the value of the Spinbox to value."""
[1170] Fix | Delete
self.tk.call(self._w, "set", value)
[1171] Fix | Delete
[1172] Fix | Delete
[1173] Fix | Delete
class Treeview(Widget, tkinter.XView, tkinter.YView):
[1174] Fix | Delete
"""Ttk Treeview widget displays a hierarchical collection of items.
[1175] Fix | Delete
[1176] Fix | Delete
Each item has a textual label, an optional image, and an optional list
[1177] Fix | Delete
of data values. The data values are displayed in successive columns
[1178] Fix | Delete
after the tree label."""
[1179] Fix | Delete
[1180] Fix | Delete
def __init__(self, master=None, **kw):
[1181] Fix | Delete
"""Construct a Ttk Treeview with parent master.
[1182] Fix | Delete
[1183] Fix | Delete
STANDARD OPTIONS
[1184] Fix | Delete
[1185] Fix | Delete
class, cursor, style, takefocus, xscrollcommand,
[1186] Fix | Delete
yscrollcommand
[1187] Fix | Delete
[1188] Fix | Delete
WIDGET-SPECIFIC OPTIONS
[1189] Fix | Delete
[1190] Fix | Delete
columns, displaycolumns, height, padding, selectmode, show
[1191] Fix | Delete
[1192] Fix | Delete
ITEM OPTIONS
[1193] Fix | Delete
[1194] Fix | Delete
text, image, values, open, tags
[1195] Fix | Delete
[1196] Fix | Delete
TAG OPTIONS
[1197] Fix | Delete
[1198] Fix | Delete
foreground, background, font, image
[1199] Fix | Delete
"""
[1200] Fix | Delete
Widget.__init__(self, master, "ttk::treeview", kw)
[1201] Fix | Delete
[1202] Fix | Delete
[1203] Fix | Delete
def bbox(self, item, column=None):
[1204] Fix | Delete
"""Returns the bounding box (relative to the treeview widget's
[1205] Fix | Delete
window) of the specified item in the form x y width height.
[1206] Fix | Delete
[1207] Fix | Delete
If column is specified, returns the bounding box of that cell.
[1208] Fix | Delete
If the item is not visible (i.e., if it is a descendant of a
[1209] Fix | Delete
closed item or is scrolled offscreen), returns an empty string."""
[1210] Fix | Delete
return self._getints(self.tk.call(self._w, "bbox", item, column)) or ''
[1211] Fix | Delete
[1212] Fix | Delete
[1213] Fix | Delete
def get_children(self, item=None):
[1214] Fix | Delete
"""Returns a tuple of children belonging to item.
[1215] Fix | Delete
[1216] Fix | Delete
If item is not specified, returns root children."""
[1217] Fix | Delete
return self.tk.splitlist(
[1218] Fix | Delete
self.tk.call(self._w, "children", item or '') or ())
[1219] Fix | Delete
[1220] Fix | Delete
[1221] Fix | Delete
def set_children(self, item, *newchildren):
[1222] Fix | Delete
"""Replaces item's child with newchildren.
[1223] Fix | Delete
[1224] Fix | Delete
Children present in item that are not present in newchildren
[1225] Fix | Delete
are detached from tree. No items in newchildren may be an
[1226] Fix | Delete
ancestor of item."""
[1227] Fix | Delete
self.tk.call(self._w, "children", item, newchildren)
[1228] Fix | Delete
[1229] Fix | Delete
[1230] Fix | Delete
def column(self, column, option=None, **kw):
[1231] Fix | Delete
"""Query or modify the options for the specified column.
[1232] Fix | Delete
[1233] Fix | Delete
If kw is not given, returns a dict of the column option values. If
[1234] Fix | Delete
option is specified then the value for that option is returned.
[1235] Fix | Delete
Otherwise, sets the options to the corresponding values."""
[1236] Fix | Delete
if option is not None:
[1237] Fix | Delete
kw[option] = None
[1238] Fix | Delete
return _val_or_dict(self.tk, kw, self._w, "column", column)
[1239] Fix | Delete
[1240] Fix | Delete
[1241] Fix | Delete
def delete(self, *items):
[1242] Fix | Delete
"""Delete all specified items and all their descendants. The root
[1243] Fix | Delete
item may not be deleted."""
[1244] Fix | Delete
self.tk.call(self._w, "delete", items)
[1245] Fix | Delete
[1246] Fix | Delete
[1247] Fix | Delete
def detach(self, *items):
[1248] Fix | Delete
"""Unlinks all of the specified items from the tree.
[1249] Fix | Delete
[1250] Fix | Delete
The items and all of their descendants are still present, and may
[1251] Fix | Delete
be reinserted at another point in the tree, but will not be
[1252] Fix | Delete
displayed. The root item may not be detached."""
[1253] Fix | Delete
self.tk.call(self._w, "detach", items)
[1254] Fix | Delete
[1255] Fix | Delete
[1256] Fix | Delete
def exists(self, item):
[1257] Fix | Delete
"""Returns True if the specified item is present in the tree,
[1258] Fix | Delete
False otherwise."""
[1259] Fix | Delete
return self.tk.getboolean(self.tk.call(self._w, "exists", item))
[1260] Fix | Delete
[1261] Fix | Delete
[1262] Fix | Delete
def focus(self, item=None):
[1263] Fix | Delete
"""If item is specified, sets the focus item to item. Otherwise,
[1264] Fix | Delete
returns the current focus item, or '' if there is none."""
[1265] Fix | Delete
return self.tk.call(self._w, "focus", item)
[1266] Fix | Delete
[1267] Fix | Delete
[1268] Fix | Delete
def heading(self, column, option=None, **kw):
[1269] Fix | Delete
"""Query or modify the heading options for the specified column.
[1270] Fix | Delete
[1271] Fix | Delete
If kw is not given, returns a dict of the heading option values. If
[1272] Fix | Delete
option is specified then the value for that option is returned.
[1273] Fix | Delete
Otherwise, sets the options to the corresponding values.
[1274] Fix | Delete
[1275] Fix | Delete
Valid options/values are:
[1276] Fix | Delete
text: text
[1277] Fix | Delete
The text to display in the column heading
[1278] Fix | Delete
image: image_name
[1279] Fix | Delete
Specifies an image to display to the right of the column
[1280] Fix | Delete
heading
[1281] Fix | Delete
anchor: anchor
[1282] Fix | Delete
Specifies how the heading text should be aligned. One of
[1283] Fix | Delete
the standard Tk anchor values
[1284] Fix | Delete
command: callback
[1285] Fix | Delete
A callback to be invoked when the heading label is
[1286] Fix | Delete
pressed.
[1287] Fix | Delete
[1288] Fix | Delete
To configure the tree column heading, call this with column = "#0" """
[1289] Fix | Delete
cmd = kw.get('command')
[1290] Fix | Delete
if cmd and not isinstance(cmd, str):
[1291] Fix | Delete
# callback not registered yet, do it now
[1292] Fix | Delete
kw['command'] = self.master.register(cmd, self._substitute)
[1293] Fix | Delete
[1294] Fix | Delete
if option is not None:
[1295] Fix | Delete
kw[option] = None
[1296] Fix | Delete
[1297] Fix | Delete
return _val_or_dict(self.tk, kw, self._w, 'heading', column)
[1298] Fix | Delete
[1299] Fix | Delete
[1300] Fix | Delete
def identify(self, component, x, y):
[1301] Fix | Delete
"""Returns a description of the specified component under the
[1302] Fix | Delete
point given by x and y, or the empty string if no such component
[1303] Fix | Delete
is present at that position."""
[1304] Fix | Delete
return self.tk.call(self._w, "identify", component, x, y)
[1305] Fix | Delete
[1306] Fix | Delete
[1307] Fix | Delete
def identify_row(self, y):
[1308] Fix | Delete
"""Returns the item ID of the item at position y."""
[1309] Fix | Delete
return self.identify("row", 0, y)
[1310] Fix | Delete
[1311] Fix | Delete
[1312] Fix | Delete
def identify_column(self, x):
[1313] Fix | Delete
"""Returns the data column identifier of the cell at position x.
[1314] Fix | Delete
[1315] Fix | Delete
The tree column has ID #0."""
[1316] Fix | Delete
return self.identify("column", x, 0)
[1317] Fix | Delete
[1318] Fix | Delete
[1319] Fix | Delete
def identify_region(self, x, y):
[1320] Fix | Delete
"""Returns one of:
[1321] Fix | Delete
[1322] Fix | Delete
heading: Tree heading area.
[1323] Fix | Delete
separator: Space between two columns headings;
[1324] Fix | Delete
tree: The tree area.
[1325] Fix | Delete
cell: A data cell.
[1326] Fix | Delete
[1327] Fix | Delete
* Availability: Tk 8.6"""
[1328] Fix | Delete
return self.identify("region", x, y)
[1329] Fix | Delete
[1330] Fix | Delete
[1331] Fix | Delete
def identify_element(self, x, y):
[1332] Fix | Delete
"""Returns the element at position x, y.
[1333] Fix | Delete
[1334] Fix | Delete
* Availability: Tk 8.6"""
[1335] Fix | Delete
return self.identify("element", x, y)
[1336] Fix | Delete
[1337] Fix | Delete
[1338] Fix | Delete
def index(self, item):
[1339] Fix | Delete
"""Returns the integer index of item within its parent's list
[1340] Fix | Delete
of children."""
[1341] Fix | Delete
return self.tk.getint(self.tk.call(self._w, "index", item))
[1342] Fix | Delete
[1343] Fix | Delete
[1344] Fix | Delete
def insert(self, parent, index, iid=None, **kw):
[1345] Fix | Delete
"""Creates a new item and return the item identifier of the newly
[1346] Fix | Delete
created item.
[1347] Fix | Delete
[1348] Fix | Delete
parent is the item ID of the parent item, or the empty string
[1349] Fix | Delete
to create a new top-level item. index is an integer, or the value
[1350] Fix | Delete
end, specifying where in the list of parent's children to insert
[1351] Fix | Delete
the new item. If index is less than or equal to zero, the new node
[1352] Fix | Delete
is inserted at the beginning, if index is greater than or equal to
[1353] Fix | Delete
the current number of children, it is inserted at the end. If iid
[1354] Fix | Delete
is specified, it is used as the item identifier, iid must not
[1355] Fix | Delete
already exist in the tree. Otherwise, a new unique identifier
[1356] Fix | Delete
is generated."""
[1357] Fix | Delete
opts = _format_optdict(kw)
[1358] Fix | Delete
if iid is not None:
[1359] Fix | Delete
res = self.tk.call(self._w, "insert", parent, index,
[1360] Fix | Delete
"-id", iid, *opts)
[1361] Fix | Delete
else:
[1362] Fix | Delete
res = self.tk.call(self._w, "insert", parent, index, *opts)
[1363] Fix | Delete
[1364] Fix | Delete
return res
[1365] Fix | Delete
[1366] Fix | Delete
[1367] Fix | Delete
def item(self, item, option=None, **kw):
[1368] Fix | Delete
"""Query or modify the options for the specified item.
[1369] Fix | Delete
[1370] Fix | Delete
If no options are given, a dict with options/values for the item
[1371] Fix | Delete
is returned. If option is specified then the value for that option
[1372] Fix | Delete
is returned. Otherwise, sets the options to the corresponding
[1373] Fix | Delete
values as given by kw."""
[1374] Fix | Delete
if option is not None:
[1375] Fix | Delete
kw[option] = None
[1376] Fix | Delete
return _val_or_dict(self.tk, kw, self._w, "item", item)
[1377] Fix | Delete
[1378] Fix | Delete
[1379] Fix | Delete
def move(self, item, parent, index):
[1380] Fix | Delete
"""Moves item to position index in parent's list of children.
[1381] Fix | Delete
[1382] Fix | Delete
It is illegal to move an item under one of its descendants. If
[1383] Fix | Delete
index is less than or equal to zero, item is moved to the
[1384] Fix | Delete
beginning, if greater than or equal to the number of children,
[1385] Fix | Delete
it is moved to the end. If item was detached it is reattached."""
[1386] Fix | Delete
self.tk.call(self._w, "move", item, parent, index)
[1387] Fix | Delete
[1388] Fix | Delete
reattach = move # A sensible method name for reattaching detached items
[1389] Fix | Delete
[1390] Fix | Delete
[1391] Fix | Delete
def next(self, item):
[1392] Fix | Delete
"""Returns the identifier of item's next sibling, or '' if item
[1393] Fix | Delete
is the last child of its parent."""
[1394] Fix | Delete
return self.tk.call(self._w, "next", item)
[1395] Fix | Delete
[1396] Fix | Delete
[1397] Fix | Delete
def parent(self, item):
[1398] Fix | Delete
"""Returns the ID of the parent of item, or '' if item is at the
[1399] Fix | Delete
top level of the hierarchy."""
[1400] Fix | Delete
return self.tk.call(self._w, "parent", item)
[1401] Fix | Delete
[1402] Fix | Delete
[1403] Fix | Delete
def prev(self, item):
[1404] Fix | Delete
"""Returns the identifier of item's previous sibling, or '' if
[1405] Fix | Delete
item is the first child of its parent."""
[1406] Fix | Delete
return self.tk.call(self._w, "prev", item)
[1407] Fix | Delete
[1408] Fix | Delete
[1409] Fix | Delete
def see(self, item):
[1410] Fix | Delete
"""Ensure that item is visible.
[1411] Fix | Delete
[1412] Fix | Delete
Sets all of item's ancestors open option to True, and scrolls
[1413] Fix | Delete
the widget if necessary so that item is within the visible
[1414] Fix | Delete
portion of the tree."""
[1415] Fix | Delete
self.tk.call(self._w, "see", item)
[1416] Fix | Delete
[1417] Fix | Delete
[1418] Fix | Delete
def selection(self):
[1419] Fix | Delete
"""Returns the tuple of selected items."""
[1420] Fix | Delete
return self.tk.splitlist(self.tk.call(self._w, "selection"))
[1421] Fix | Delete
[1422] Fix | Delete
[1423] Fix | Delete
def _selection(self, selop, items):
[1424] Fix | Delete
if len(items) == 1 and isinstance(items[0], (tuple, list)):
[1425] Fix | Delete
items = items[0]
[1426] Fix | Delete
[1427] Fix | Delete
self.tk.call(self._w, "selection", selop, items)
[1428] Fix | Delete
[1429] Fix | Delete
[1430] Fix | Delete
def selection_set(self, *items):
[1431] Fix | Delete
"""The specified items becomes the new selection."""
[1432] Fix | Delete
self._selection("set", items)
[1433] Fix | Delete
[1434] Fix | Delete
[1435] Fix | Delete
def selection_add(self, *items):
[1436] Fix | Delete
"""Add all of the specified items to the selection."""
[1437] Fix | Delete
self._selection("add", items)
[1438] Fix | Delete
[1439] Fix | Delete
[1440] Fix | Delete
def selection_remove(self, *items):
[1441] Fix | Delete
"""Remove all of the specified items from the selection."""
[1442] Fix | Delete
self._selection("remove", items)
[1443] Fix | Delete
[1444] Fix | Delete
[1445] Fix | Delete
def selection_toggle(self, *items):
[1446] Fix | Delete
"""Toggle the selection state of each specified item."""
[1447] Fix | Delete
self._selection("toggle", items)
[1448] Fix | Delete
[1449] Fix | Delete
[1450] Fix | Delete
def set(self, item, column=None, value=None):
[1451] Fix | Delete
"""Query or set the value of given item.
[1452] Fix | Delete
[1453] Fix | Delete
With one argument, return a dictionary of column/value pairs
[1454] Fix | Delete
for the specified item. With two arguments, return the current
[1455] Fix | Delete
value of the specified column. With three arguments, set the
[1456] Fix | Delete
value of given column in given item to the specified value."""
[1457] Fix | Delete
res = self.tk.call(self._w, "set", item, column, value)
[1458] Fix | Delete
if column is None and value is None:
[1459] Fix | Delete
return _splitdict(self.tk, res,
[1460] Fix | Delete
cut_minus=False, conv=_tclobj_to_py)
[1461] Fix | Delete
else:
[1462] Fix | Delete
return res
[1463] Fix | Delete
[1464] Fix | Delete
[1465] Fix | Delete
def tag_bind(self, tagname, sequence=None, callback=None):
[1466] Fix | Delete
"""Bind a callback for the given event sequence to the tag tagname.
[1467] Fix | Delete
When an event is delivered to an item, the callbacks for each
[1468] Fix | Delete
of the item's tags option are called."""
[1469] Fix | Delete
self._bind((self._w, "tag", "bind", tagname), sequence, callback, add=0)
[1470] Fix | Delete
[1471] Fix | Delete
[1472] Fix | Delete
def tag_configure(self, tagname, option=None, **kw):
[1473] Fix | Delete
"""Query or modify the options for the specified tagname.
[1474] Fix | Delete
[1475] Fix | Delete
If kw is not given, returns a dict of the option settings for tagname.
[1476] Fix | Delete
If option is specified, returns the value for that option for the
[1477] Fix | Delete
specified tagname. Otherwise, sets the options to the corresponding
[1478] Fix | Delete
values for the given tagname."""
[1479] Fix | Delete
if option is not None:
[1480] Fix | Delete
kw[option] = None
[1481] Fix | Delete
return _val_or_dict(self.tk, kw, self._w, "tag", "configure",
[1482] Fix | Delete
tagname)
[1483] Fix | Delete
[1484] Fix | Delete
[1485] Fix | Delete
def tag_has(self, tagname, item=None):
[1486] Fix | Delete
"""If item is specified, returns 1 or 0 depending on whether the
[1487] Fix | Delete
specified item has the given tagname. Otherwise, returns a list of
[1488] Fix | Delete
all items which have the specified tag.
[1489] Fix | Delete
[1490] Fix | Delete
* Availability: Tk 8.6"""
[1491] Fix | Delete
if item is None:
[1492] Fix | Delete
return self.tk.splitlist(
[1493] Fix | Delete
self.tk.call(self._w, "tag", "has", tagname))
[1494] Fix | Delete
else:
[1495] Fix | Delete
return self.tk.getboolean(
[1496] Fix | Delete
self.tk.call(self._w, "tag", "has", tagname, item))
[1497] Fix | Delete
[1498] Fix | Delete
[1499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function