contextmenuwidget


Namecontextmenuwidget JSON
Version 1.0.6 PyPI version JSON
download
home_page
SummaryExtended widget with a context menu for tkinter, including Cut, Copy, and Paste commands.
upload_time2024-03-12 07:53:55
maintainer
docs_urlNone
authorDiablo76
requires_python
license
keywords tkinter context-menu cut copy paste
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # context_menu_widget

[![PyPI version](https://badge.fury.io/py/ContextMenuWidget.svg)](https://badge.fury.io/py/ContextMenuWidget)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

## Description

ContextMenuWidget is a Python package that provides an extended `tk.Menu` class with a context menu for specified widgets, including commands like Cut, Copy, Paste, and Select All.

## Installation

Install the package using pip:

```bash
pip install ContextMenuWidget
```
## Usage
from contextmenuwidget import ContextMenuWidget

## Current version : V1.0.6

## Release Notes

### Version 1.0.5 (March 03, 2024)
- Fixed a bug related to displaying shortcut (MacOS)


# Example usage of the ContextMenuWidget class

```python
from contextmenuwidget import ContextMenuWidget

root = tk.Tk()

label_entry = tk.Label(root, text="Entry Widget : ")
label_entry.grid(column=0, row=0, sticky="w")

widget_entry = tk.Entry(root, width=31)
widget_entry.grid(column=1, row=0, sticky="w")
context_menu = ContextMenuWidget(widget_entry)

label_text = tk.Label(root, text="Text Widget : ")
label_text.grid(column=0, row=1, sticky="wn")

widget_text = tk.Text(root, height=13, width=31, wrap=tk.NONE)
widget_text.grid(column=1, row=1, sticky="w")
context_menu = ContextMenuWidget(widget_text)

vertical_scrollbar = tk.Scrollbar(root, orient=tk.VERTICAL)
vertical_scrollbar.grid(column=2, row=1, sticky="ns")
widget_text.config(yscrollcommand=vertical_scrollbar.set)
vertical_scrollbar.config(command=widget_text.yview)

horizontal_scrollbar = tk.Scrollbar(root, orient=tk.HORIZONTAL)
horizontal_scrollbar.grid(column=1, row=2, sticky="we")
widget_text.config(xscrollcommand=horizontal_scrollbar.set)
horizontal_scrollbar.config(command=widget_text.xview)

root.mainloop()
```

## Features
Context Menu: Extends tk.Menu with Cut, Copy, Paste, and Select All commands.
Icons: Utilizes icons for visual representation of menu commands.
Dynamic Updates: Dynamically updates menu entry states based on widget content and clipboard status.
Cross-Platform: Supports right-click events on different platforms.

## Dependencies
tkinter (Ensure that tkinter is installed)

## License
This project is licensed under the MIT License - see the LICENSE file for details.


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "contextmenuwidget",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "tkinter context-menu cut copy paste",
    "author": "Diablo76",
    "author_email": "el_diablo76@msn.com",
    "download_url": "https://files.pythonhosted.org/packages/75/aa/7ecf5b9ff6fef3c2cd9d4f64017dafb009a4b24dccf498c358edb9c75720/contextmenuwidget-1.0.6.tar.gz",
    "platform": "Windows",
    "description": "# context_menu_widget\n\n[![PyPI version](https://badge.fury.io/py/ContextMenuWidget.svg)](https://badge.fury.io/py/ContextMenuWidget)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n## Description\n\nContextMenuWidget is a Python package that provides an extended `tk.Menu` class with a context menu for specified widgets, including commands like Cut, Copy, Paste, and Select All.\n\n## Installation\n\nInstall the package using pip:\n\n```bash\npip install ContextMenuWidget\n```\n## Usage\nfrom contextmenuwidget import ContextMenuWidget\n\n## Current version : V1.0.6\n\n## Release Notes\n\n### Version 1.0.5 (March 03, 2024)\n- Fixed a bug related to displaying shortcut (MacOS)\n\n\n# Example usage of the ContextMenuWidget class\n\n```python\nfrom contextmenuwidget import ContextMenuWidget\n\nroot = tk.Tk()\n\nlabel_entry = tk.Label(root, text=\"Entry Widget : \")\nlabel_entry.grid(column=0, row=0, sticky=\"w\")\n\nwidget_entry = tk.Entry(root, width=31)\nwidget_entry.grid(column=1, row=0, sticky=\"w\")\ncontext_menu = ContextMenuWidget(widget_entry)\n\nlabel_text = tk.Label(root, text=\"Text Widget : \")\nlabel_text.grid(column=0, row=1, sticky=\"wn\")\n\nwidget_text = tk.Text(root, height=13, width=31, wrap=tk.NONE)\nwidget_text.grid(column=1, row=1, sticky=\"w\")\ncontext_menu = ContextMenuWidget(widget_text)\n\nvertical_scrollbar = tk.Scrollbar(root, orient=tk.VERTICAL)\nvertical_scrollbar.grid(column=2, row=1, sticky=\"ns\")\nwidget_text.config(yscrollcommand=vertical_scrollbar.set)\nvertical_scrollbar.config(command=widget_text.yview)\n\nhorizontal_scrollbar = tk.Scrollbar(root, orient=tk.HORIZONTAL)\nhorizontal_scrollbar.grid(column=1, row=2, sticky=\"we\")\nwidget_text.config(xscrollcommand=horizontal_scrollbar.set)\nhorizontal_scrollbar.config(command=widget_text.xview)\n\nroot.mainloop()\n```\n\n## Features\nContext Menu: Extends tk.Menu with Cut, Copy, Paste, and Select All commands.\nIcons: Utilizes icons for visual representation of menu commands.\nDynamic Updates: Dynamically updates menu entry states based on widget content and clipboard status.\nCross-Platform: Supports right-click events on different platforms.\n\n## Dependencies\ntkinter (Ensure that tkinter is installed)\n\n## License\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Extended widget with a context menu for tkinter, including Cut, Copy, and Paste commands.",
    "version": "1.0.6",
    "project_urls": null,
    "split_keywords": [
        "tkinter",
        "context-menu",
        "cut",
        "copy",
        "paste"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "75aa7ecf5b9ff6fef3c2cd9d4f64017dafb009a4b24dccf498c358edb9c75720",
                "md5": "1444544cff904021c991d52f4e62984f",
                "sha256": "7c028c650fff6a98916c93b8d5359469e768f0ba5224c29c7e1f3cb0e24c7e4f"
            },
            "downloads": -1,
            "filename": "contextmenuwidget-1.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "1444544cff904021c991d52f4e62984f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 7858,
            "upload_time": "2024-03-12T07:53:55",
            "upload_time_iso_8601": "2024-03-12T07:53:55.918546Z",
            "url": "https://files.pythonhosted.org/packages/75/aa/7ecf5b9ff6fef3c2cd9d4f64017dafb009a4b24dccf498c358edb9c75720/contextmenuwidget-1.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-12 07:53:55",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "contextmenuwidget"
}
        
Elapsed time: 0.19205s