TkinterMapView icon indicating copy to clipboard operation
TkinterMapView copied to clipboard

Async version of the TkinterMapView widget

Open alex-schulster opened this issue 1 year ago • 4 comments

What?

This PR adds the implementation for an async version of the TkinterMapView widget (called AsyncTkinterMapView).

Why?

If willing to use this widget in an application that makes use of async tasks rather than threads, the original threaded version won't work. See issue #151.

How?

The implementation is basically a copy of the original class with every thread replaced by async actions. This is not pretty, but it works fine for basic usage. A basic example using this implementation is provided.

alex-schulster avatar Jan 22 '25 14:01 alex-schulster

Nice work, only remark: You forgot to update the requirements. You are using aiohttp but it's not installed with the requirements.txt nor with the setup.py.

mke21 avatar Jan 23 '25 07:01 mke21

Oops, you're absolutely right. This is now fixed. Thanks for the insight.

alex-schulster avatar Jan 23 '25 08:01 alex-schulster

Nice, now hopefully this will be merged. But alas the project seems to be very dormant, seeing all the open pull requests here.

mke21 avatar Jan 23 '25 08:01 mke21

I've tried this PR with the accompanying demo async_map_view_demo.py and it works fine.

Running the same demo with customtkinter substituted for tkinter fails with no error report.

import customtkinter

...

root_tk = customtkinter.CTk()

...

async_mainloop(root_tk)

The examples/map_with_customtkinter.py demo also fails when using AsyncTkinterMapView.

stevej2608 avatar Apr 07 '25 08:04 stevej2608