Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e6d9805

Browse files
Issue #4350: Removed a number of out-of-dated and non-working for a long time
Tkinter methods.
1 parent 9d63ce4 commit e6d9805

3 files changed

Lines changed: 3 additions & 92 deletions

File tree

Lib/tkinter/__init__.py

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,6 @@ def tk_setPalette(self, *args, **kw):
419419
disabledForeground, insertBackground, troughColor."""
420420
self.tk.call(('tk_setPalette',)
421421
+ _flatten(args) + _flatten(list(kw.items())))
422-
def tk_menuBar(self, *args):
423-
"""Do not use. Needed in Tk 3.6 and earlier."""
424-
pass # obsolete since Tk 4.0
425422
def wait_variable(self, name='PY_VAR'):
426423
"""Wait until the variable is modified.
427424
@@ -719,9 +716,6 @@ def tkraise(self, aboveThis=None):
719716
"""Raise this widget in the stacking order."""
720717
self.tk.call('raise', self._w, aboveThis)
721718
lift = tkraise
722-
def colormodel(self, value=None):
723-
"""Useless. Not implemented in Tk."""
724-
return self.tk.call('tk', 'colormodel', self._w, value)
725719
def winfo_atom(self, name, displayof=0):
726720
"""Return integer which represents atom NAME."""
727721
args = ('winfo', 'atom') + self._displayof(displayof) + (name,)
@@ -2165,21 +2159,6 @@ def __init__(self, master=None, cnf={}, **kw):
21652159
"""
21662160
Widget.__init__(self, master, 'button', cnf, kw)
21672161

2168-
def tkButtonEnter(self, *dummy):
2169-
self.tk.call('tkButtonEnter', self._w)
2170-
2171-
def tkButtonLeave(self, *dummy):
2172-
self.tk.call('tkButtonLeave', self._w)
2173-
2174-
def tkButtonDown(self, *dummy):
2175-
self.tk.call('tkButtonDown', self._w)
2176-
2177-
def tkButtonUp(self, *dummy):
2178-
self.tk.call('tkButtonUp', self._w)
2179-
2180-
def tkButtonInvoke(self, *dummy):
2181-
self.tk.call('tkButtonInvoke', self._w)
2182-
21832162
def flash(self):
21842163
"""Flash the button.
21852164
@@ -2678,28 +2657,6 @@ def __init__(self, master=None, cnf={}, **kw):
26782657
disabledforeground, fg, font, foreground, postcommand, relief,
26792658
selectcolor, takefocus, tearoff, tearoffcommand, title, type."""
26802659
Widget.__init__(self, master, 'menu', cnf, kw)
2681-
def tk_bindForTraversal(self):
2682-
pass # obsolete since Tk 4.0
2683-
def tk_mbPost(self):
2684-
self.tk.call('tk_mbPost', self._w)
2685-
def tk_mbUnpost(self):
2686-
self.tk.call('tk_mbUnpost')
2687-
def tk_traverseToMenu(self, char):
2688-
self.tk.call('tk_traverseToMenu', self._w, char)
2689-
def tk_traverseWithinMenu(self, char):
2690-
self.tk.call('tk_traverseWithinMenu', self._w, char)
2691-
def tk_getMenuButtons(self):
2692-
return self.tk.call('tk_getMenuButtons', self._w)
2693-
def tk_nextMenu(self, count):
2694-
self.tk.call('tk_nextMenu', count)
2695-
def tk_nextMenuEntry(self, count):
2696-
self.tk.call('tk_nextMenuEntry', count)
2697-
def tk_invokeMenu(self):
2698-
self.tk.call('tk_invokeMenu', self._w)
2699-
def tk_firstMenu(self):
2700-
self.tk.call('tk_firstMenu', self._w)
2701-
def tk_mbButtonDown(self):
2702-
self.tk.call('tk_mbButtonDown', self._w)
27032660
def tk_popup(self, x, y, entry=""):
27042661
"""Post the menu at position X,Y with entry ENTRY."""
27052662
self.tk.call('tk_popup', self._w, x, y, entry)
@@ -2938,14 +2895,6 @@ def bbox(self, index):
29382895
box of the visible part of the character at the given index."""
29392896
return self._getints(
29402897
self.tk.call(self._w, 'bbox', index)) or None
2941-
def tk_textSelectTo(self, index):
2942-
self.tk.call('tk_textSelectTo', self._w, index)
2943-
def tk_textBackspace(self):
2944-
self.tk.call('tk_textBackspace', self._w)
2945-
def tk_textIndexCloser(self, a, b, c):
2946-
self.tk.call('tk_textIndexCloser', self._w, a, b, c)
2947-
def tk_textResetAnchor(self, index):
2948-
self.tk.call('tk_textResetAnchor', self._w, index)
29492898
def compare(self, index1, op, index2):
29502899
"""Return whether between index INDEX1 and index INDEX2 the
29512900
relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=."""
@@ -3823,28 +3772,6 @@ def panes(self):
38233772
"""Returns an ordered list of the child panes."""
38243773
return self.tk.splitlist(self.tk.call(self._w, 'panes'))
38253774

3826-
######################################################################
3827-
# Extensions:
3828-
3829-
class Studbutton(Button):
3830-
def __init__(self, master=None, cnf={}, **kw):
3831-
Widget.__init__(self, master, 'studbutton', cnf, kw)
3832-
self.bind('<Any-Enter>', self.tkButtonEnter)
3833-
self.bind('<Any-Leave>', self.tkButtonLeave)
3834-
self.bind('<1>', self.tkButtonDown)
3835-
self.bind('<ButtonRelease-1>', self.tkButtonUp)
3836-
3837-
class Tributton(Button):
3838-
def __init__(self, master=None, cnf={}, **kw):
3839-
Widget.__init__(self, master, 'tributton', cnf, kw)
3840-
self.bind('<Any-Enter>', self.tkButtonEnter)
3841-
self.bind('<Any-Leave>', self.tkButtonLeave)
3842-
self.bind('<1>', self.tkButtonDown)
3843-
self.bind('<ButtonRelease-1>', self.tkButtonUp)
3844-
self['fg'] = self['bg']
3845-
self['activebackground'] = self['bg']
3846-
3847-
######################################################################
38483775
# Test:
38493776

38503777
def _test():

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ Core and Builtins
108108
Library
109109
-------
110110

111+
- Issue #4350: Removed a number of out-of-dated and non-working for a long time
112+
Tkinter methods.
113+
111114
- Issue #6167: Scrollbar.activate() now returns the name of active element if
112115
the argument is not specified. Scrollbar.set() now always accepts only 2
113116
arguments.

Modules/tkappinit.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ static int tk_load_failed;
2626
int
2727
Tcl_AppInit(Tcl_Interp *interp)
2828
{
29-
#ifdef WITH_MOREBUTTONS
30-
Tk_Window main_window;
31-
#endif
3229
const char *_tkinter_skip_tk_init;
3330
#ifdef TKINTER_PROTECT_LOADTK
3431
const char *_tkinter_tk_failed;
@@ -113,29 +110,13 @@ Tcl_AppInit(Tcl_Interp *interp)
113110
return TCL_ERROR;
114111
}
115112

116-
#ifdef WITH_MOREBUTTONS
117-
main_window = Tk_MainWindow(interp);
118-
#else
119113
Tk_MainWindow(interp);
120-
#endif
121114

122115
#ifdef TK_AQUA
123116
TkMacOSXInitAppleEvents(interp);
124117
TkMacOSXInitMenus(interp);
125118
#endif
126119

127-
#ifdef WITH_MOREBUTTONS
128-
{
129-
extern Tcl_CmdProc studButtonCmd;
130-
extern Tcl_CmdProc triButtonCmd;
131-
132-
Tcl_CreateCommand(interp, "studbutton", studButtonCmd,
133-
(ClientData) main_window, NULL);
134-
Tcl_CreateCommand(interp, "tributton", triButtonCmd,
135-
(ClientData) main_window, NULL);
136-
}
137-
#endif
138-
139120
#ifdef WITH_PIL /* 0.2b5 and later -- not yet released as of May 14 */
140121
{
141122
extern void TkImaging_Init(Tcl_Interp *);

0 commit comments

Comments
 (0)