MCPcopy Index your code
hub / github.com/python/cpython / Button

Class Button

Lib/tkinter/__init__.py:2915–2959  ·  view source on GitHub ↗

Button widget.

Source from the content-addressed store, hash-verified

2913
2914
2915class Button(Widget):
2916 """Button widget."""
2917
2918 def __init__(self, master=None, cnf={}, **kw):
2919 """Construct a button widget with the parent MASTER.
2920
2921 STANDARD OPTIONS
2922
2923 activebackground, activeforeground, anchor,
2924 background, bitmap, borderwidth, cursor,
2925 disabledforeground, font, foreground
2926 highlightbackground, highlightcolor,
2927 highlightthickness, image, justify,
2928 padx, pady, relief, repeatdelay,
2929 repeatinterval, takefocus, text,
2930 textvariable, underline, wraplength
2931
2932 WIDGET-SPECIFIC OPTIONS
2933
2934 command, compound, default, height,
2935 overrelief, state, width
2936 """
2937 Widget.__init__(self, master, 'button', cnf, kw)
2938
2939 def flash(self):
2940 """Flash the button.
2941
2942 This is accomplished by redisplaying
2943 the button several times, alternating between active and
2944 normal colors. At the end of the flash the button is left
2945 in the same normal/active state as when the command was
2946 invoked. This command is ignored if the button's state is
2947 disabled.
2948 """
2949 self.tk.call(self._w, 'flash')
2950
2951 def invoke(self):
2952 """Invoke the command associated with the button.
2953
2954 The return value is the return value from the command,
2955 or an empty string if there is no command associated with
2956 the button. This command is ignored if the button's state
2957 is disabled.
2958 """
2959 return self.tk.call(self._w, 'invoke')
2960
2961
2962class Canvas(Widget, XView, YView):

Callers 1

_testFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…