Commit Graph

68 Commits

Author SHA1 Message Date
Akuli
fe07a522b7 don't allow _TextIndex in last argument of tkinter.Text.replace() or insert() (#4927)
Fixes #4919
2021-01-11 15:34:46 +01:00
Akuli
206da3280e make BitmapImage keyword arguments optional (#4926) 2021-01-09 21:26:49 +01:00
Akuli
41ba271160 tkinter: add type hints to Wm methods (#4925) 2021-01-09 19:26:30 +01:00
Akuli
a5f0761161 tkinter: add PhotoImage and BitmapImage type hints (#4923) 2021-01-09 19:24:36 +01:00
Akuli
4145873604 tkinter: add types to register and deletecommand methods (#4924) 2021-01-09 19:23:25 +01:00
Akuli
21547df35b tkinter: add types to clipboard methods (#4922) 2021-01-09 19:21:24 +01:00
Akuli
64c6ef77c7 more tkinter types (#4921) 2021-01-09 19:20:52 +01:00
Akuli
599ce2969b add types for tkinter focus methods (#4920) 2021-01-09 19:19:45 +01:00
Akuli
804281c547 tkinter nametowidget() type (#4904)
* nametowidget type

* return Any to prevent having to check return type
2021-01-08 15:04:38 +01:00
Akuli
eaf29453fc tkinter: type hints for Menu add_foo and insert_foo methods (#4903) 2021-01-06 12:15:25 +01:00
Akuli
effd7c53fa tkinter: more winfo_foo methods (#4911) 2021-01-06 11:54:16 +01:00
Rebecca Chen
7489e1b9c2 Remove __del__ from the tkinter _Image protocol. (#4909)
See https://github.com/python/typeshed/pull/4766#issuecomment-753341778.
2021-01-05 22:38:41 +01:00
Akuli
916a3a0392 add types to destroy methods (#4902) 2021-01-05 16:55:01 +01:00
Akuli
2691d74796 tkinter: use bool instead of Literal[0, 1] (#4901) 2021-01-05 13:21:35 +01:00
Akuli
930de94c30 tkinter: event_foo method type hints (#4900) 2021-01-05 13:04:43 +01:00
Akuli
7710191cf4 tkinter.font.Font: make __getitem__ and cget behave the same (#4899) 2021-01-04 15:58:44 +01:00
Akuli
bc1fe548b9 Don't use Literal for tkinter widget options (#4891) 2021-01-03 16:07:47 -08:00
Akuli
c45a879b1f add types to winfo methods that return coordinates or sizes (#4894) 2021-01-03 16:47:31 +01:00
melassa
7eed4a9edb Type Menu.tk_popup() (#4893) 2021-01-03 12:53:03 +01:00
melassa
2ab1b03a5b Removed bbox comment in Misc (#4892) 2021-01-02 19:57:16 +01:00
melassa
3c26c7221c _PlaceInfo and place_configure fix #4872 (#4873)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-01-02 19:56:41 +01:00
melassa
1cc3282d65 Added **kw to place/pack/grid_configure #4836 (#4874) 2021-01-02 15:03:00 +01:00
melassa
85d6df4742 Added children field to Misc #4834 (#4871)
Co-authored-by: you <you@example.com>
2020-12-30 02:09:18 +01:00
melassa
1ae3158174 Pack ipadx ipady do not accept tuple (#4869)
Closes #4861
2020-12-29 15:26:08 +01:00
melassa
350095e960 Add name field to tk widgets (#4867) 2020-12-28 21:59:27 +01:00
melassa
87278af3e5 Changed Dict with Mapping in grid/pack/place_configure #4836.2 (#4859)
Part of #4836
2020-12-27 12:34:28 +01:00
melassa
be55392a87 Grid padx/pady accept tuple (#4860)
Closes: #4830
2020-12-27 12:32:59 +01:00
Akuli
eb7381a3c1 use bool for tkinter.FALSE and its friends (#4853)
Fixes #4669
2020-12-25 16:07:55 +01:00
Rebecca Chen
8c20938ba1 Add an _Image protocol to tkinter. (#4766) 2020-11-13 20:59:29 +01:00
Rebecca Chen
a42f545215 Change some tkinter function parameter types from bool to int. (#4765)
Change some tkinter function parameter types from bool to int.

Based on the fact that tk.{YES,NO,TRUE,FALSE} are defined as ints
and that the usage example in the source code also uses an int as a bool.
2020-11-13 11:34:39 +01:00
Sebastian Rittau
d2a7889fe0 Drop support for Python 3.5 (#4675)
Python 3.5 EOL was on 2020-09-30.
2020-11-02 16:18:20 +01:00
Jelle Zijlstra
5f9fd3d127 upgrade black version (#4486)
Manually removed a number of trailing commas to prevent black from unnecessarily
exploding some collections.
2020-08-26 18:36:01 +02:00
Akuli
e3e395b28c fix assigning to tkinter.Tk().report_callback_exception (#4484) 2020-08-26 13:56:07 +02:00
Akuli
27e0ea0199 use Any for ignored callback return types in tkinter (#4485) 2020-08-26 13:54:44 +02:00
Akuli
910ecd1f56 add types to tkinter after methods (#4479) 2020-08-26 12:06:40 +02:00
Akuli
770fe90b0b add types to tkinter.Text methods (#4460) 2020-08-24 13:09:07 +02:00
Akuli
ff35f99d44 fix tkinter config methods (#4459) 2020-08-24 13:06:36 +02:00
Akuli
39ddef28bf make tkinter.font.Font behave similarly to tkinter widgets (#4469) 2020-08-24 13:00:20 +02:00
Akuli
7d1abc962d fix master attributes (#4468) 2020-08-20 11:55:49 +02:00
Akuli
6a06ff53f0 make canvas offset option optional (#4458) 2020-08-18 16:50:09 +02:00
Rebecca Chen
61537be530 Upgrade the pytype version to one that can parse the tkinter stubs. (#4456)
The latest pytype release fixes two pyi parser bugs that allow files
affected by them to be taken off the pytype exclude list. I removed two
`total=False` declarations in tkinter/__init__ that pytype does not like
(because it checks that `total` is present only when TypedDict is a
class's immediate parent) and which shouldn't be needed because
_InMiscNonTotal already specifies totality. I double-checked that mypy
reports no errors in 3.7 on a .py file containing:

  from typing_extensions import TypedDict
  Foo = TypedDict('Foo', {'x': int}, total=False)
  class Bar(Foo): pass
  x: Foo = {}

showing that it doesn't require `total` to be repeated.
2020-08-17 19:49:58 -07:00
Akuli
e9ecea0033 Add options to tkinter widgets (#4363)
In tkinter, `widget['foo'] = bar` and `widget.config(foo=bar)` do the same thing, but they will now type-check differently: the `widget['foo'] = bar` syntax allows 'foo' to be any string (e.g. a variable, not necessarily a Literal) and bar to be any object, while `widget.config(foo=bar)` checks the existence of the option and the type of bar. Similarly, cget takes a Literal argument but __getitem__ takes a string. 

Testing script can still be found at c42a72c53e
2020-08-17 13:59:51 -07:00
Akuli
e1c4d2a713 more permissive type for tkinter fonts (#4453) 2020-08-17 15:52:16 +02:00
Akuli
0ebe4c2b65 fix eval and call return types (#4451) 2020-08-16 12:30:04 -07:00
Akuli
954ce8c703 create _tkinter stub (#4372) 2020-08-08 14:14:52 +02:00
Eric Traut
04c74640f0 Removed imported symbols that are not accessed or re-exported (#4387)
Co-authored-by: Eric Traut <erictr@microsoft.com>
2020-08-05 22:49:17 -07:00
Akuli
8bf7efe94e add types for tkinter geometry manager (aka pack,grid,place) methods (#4379) 2020-07-31 14:34:47 +02:00
Akuli
09c91a00ac add type hints for tkinter.Variable and its subclasses (#4378) 2020-07-31 10:53:57 +02:00
Akuli
2c37551fd1 make tkinter.Event generic and add missing type hints to bind methods (#4347) 2020-07-25 14:23:26 +02:00
Akuli
9efc9d8818 add tkinter.font stub (#4350) 2020-07-22 11:46:04 -07:00