Metadata-Version: 2.1
Name: ptray
Version: 1.1.1
Summary: A Python module to interact with the Windows tray.
Home-page: https://github.com/donno2048/pytray
Author: Elisha Hollander
Author-email: just4now666666@gmail.com
License: MIT
Project-URL: Documentation, https://github.com/donno2048/pytray#readme
Project-URL: Bug Reports, https://github.com/donno2048/pytray/issues
Project-URL: Source Code, https://github.com/donno2048/pytray
Platform: win32
Classifier: Environment :: Win32 (MS Windows)
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Description-Content-Type: text/markdown
License-File: LICENSE

# pytray

A Python module to interact with the Windows tray.

## Installation

### From PyPI

```sh
pip3 install ptray
```

### From GitHub

```sh
pip3 install git+https://github.com/donno2048/pytray
```

## Usage

Here is a simple example:

```py
import pytray, time, os
pytray.create_tray_element()
pytray.create_menu(
    ("Exit", 1), ("Close", 2)
)
pytray.add_icon()
i = 0
while True:
    start_time = time.time()
    while time.time() - start_time < 0.3:
        click = pytray.what_is_clicked()
        if click == 1:
            exit()
        elif click == 2:
            pytray.hide_menu()
        elif click == None:
            pass
        time.sleep(0.1) # make sure only one click is registered
    pytray.set_icon(os.path.abspath(f"cat\\{i}.ico")) # requires the cat directory from this repo (by Kyome22)
    i = (i + 1) % 5
```


