Name | CTkCodeBoxPlus JSON |
Version |
1.0
JSON |
| download |
home_page | None |
Summary | A code editor widget for customtkinter with enhanced features |
upload_time | 2025-08-25 19:45:51 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License
Copyright (c) 2024 Akash Bora
Copyright (c) 2025 xzyqox
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
|
keywords |
customtkinter
codebox
code
gui
tkinter
context-menu
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# CTkCodeBoxPlus
A code editor widget for customtkinter (Enhanced Edition).

## Features
- Multiple language support
- Code syntax highlighting
- Line highlighting (Enhanced)
- Auto-Indent and Outdent (Enhanced)
- Custom history with undo and redo (Enhanced)
- Smart selection on double and triple click (Enhanced)
- Implemented actions like copy, paste, cut (Enhanced)
- Keybindings for implemented actions (Enhanced)
- Multiple Themes
- Right-click menu (Enhanced)
- Line numbers on left side
- Fully customizable
- Easy to Use
## Installation
```bash
pip install CTkCodeBoxPlus
```
## Simple Usage
```python
import customtkinter
from CTkCodeBoxPlus import *
root = customtkinter.CTk()
codebox = CTkCodeBox(root, language="python")
codebox.pack(padx=10, pady=10, expand=True,fill="both")
root.mainloop()
```
### Arguments
| Parameter | Type | Default | Description |
|----------------------------------|--------------------------|-------------------|--------------------------------------------------------|
| **master** | Widget | - | Parent widget |
| **language** | str/pygments.lexer.Lexer | - | Pygments language name (str) or a lexer class |
| **height** | int | 200 | Widget height in pixels (passed to CTkTextbox) |
| **theme** | str | "solarized-light" | Pygments style name used for highlighting |
| **line_numbering** | bool | True | Enable line numbers |
| **numbering_color** | str | None | Color for line numbers |
| **menu** | bool | True | Enable context menu |
| **menu_fg_color** | str | None | Context menu background color |
| **menu_text_color** | str | None | Context menu text color |
| **menu_hover_color** | str | None | Context menu active background color |
| **wrap** | bool | True | Enable word wrap |
| **select_color** | str | None | Override selection background color |
| **cursor_color** | str | None | Cursor color I (blinking) |
| **highlight_current_line** | bool | True | Highlight the active line |
| **highlight_current_line_color** | str | None | Explicit color for active line |
| **history_enabled** | bool | True | Enable built-in undo/redo history |
| **history_cooldown** (ms) | int | 2500 | Cooldown for pushing history in _on_keypress_history() |
| **history_max** | int | 100 | Maximum undo frames to keep. |
| **indent_width** | int | 4 | Number of spaces for indent/outdent. |
| ****kwargs** | various | - | Additional CTkTextBox parameters |
### Methods
- **.insert(index, code, push_history)**: Insert code/text in the box and trigger a non-editing highlight update with pushing history (if push_history is True)
- **.get(index1, index2)**: Get code/text from the box
- **.configure(kwargs)**: Change parameters of the codebox
- **.cget(parameter)**: Get the parameter value from the codebox by name
- **.update_code()**: Schedule a debounced re-highlight and update edited flag
- **.clear_code()**: Remove all highlighting tags while preserving selection
- **.set_wrap(enabled)**: Enable/disable word wrap
- **.toggle_wrap()**: Toggle wrap mode
- **.is_edited()**: Return True if the text has been edited since last reset
- **.reset_edited()**: Reset edited state flag to False
- **.cut_text()**: Cut selected text to clipboard and notify change
- **.copy_text()**: Copy selected text to clipboard
- **.paste_text()**: Paste clipboard text, replacing selection if present, and refresh highlighting/lines with notify change
- **.clear_all_text()**: Delete all content and notify change
- **.select_all_text()**: Select all content
- **.set_history_enabled(enabled)**: Enable/disable the internal undo/redo history
- **.set_history_limit(limit)**: Set maximum number of undo frames to keep
- **.clear_history()**: Clear undo and redo stacks
- **.undo()**: Undo the last change if history is enabled
- **.redo()**: Redo the last undone change if available
<br>
<a href="https://github-readme-tech-stack.vercel.app">
<img src="https://github-readme-tech-stack.vercel.app/api/cards?title=Languages&lineCount=4&width=520&bg=%230D1117&badge=%23161B22&border=%2321262D&titleColor=%2358A6FF&line1=python%2Cpython%2Cfff800%3BCplusplus%2C%2B%2B%2C7bc9b1%3Bcplusplus%2Csharp%2C6c3bb2%3BCplusplus%2C+%2C4a82cc%3Bjavascript%2Cjavascript%2Cf0fc0d%3B&line2=lua%2Clua%2C5d72e6%3BRust%2Crust%2Ce62323%3Bperl%2Cperl%2C92d5d3%3Bkotlin%2Ckotlin%2C6dfa21%3Bruby%2Cruby%2Cff0000%3B&line3=swift%2Cswift%2Cfe811b%3Bphp%2Cphp%2C3749b3%3Breact%2Creact%2Cd3ff00%3Bjson%2Cjson%2Cffe300%3Bgo%2Cgo%2C11ffdc%3B&line4=yaml%2Cyaml%2C6dc2af%3Bxml%2Cxml%2C63f030%3Bcss%2Ccss%2C1ff9f2%3Bhtml%2Chtml%2C2bc5b4%3BTypescript%2CTypescript%2C42b1c2%3BJAVA%2Cjava%2Ceffc00%3B" alt="Languages" />
</a>
More lexers available here: https://pygments.org/docs/lexers/
## Color Themes
```
abap, arduino, autumn, borland, colorful, default, dracula, emacs,
friendly_grayscale, friendly, fruity, github-dark, gruvbox-dark,
gruvbox-light, igor, inkpot, lightbulb, lilypond, lovelace, manni, material,
monokai, murphy, native, nord-darker, nord, one-dark, paraiso-dark, paraiso-light,
pastie, perldoc, rainbow_dash, rrt, sas, solarized-dark, solarized-light, staroffice,
stata-dark, stata-light, tango, trac, vim, vs, xcode, zenburn
```
More style examples given here: https://pygments.org/styles/
---
## Support & Issues
- **GitHub Issues**: [Report bugs or request features](https://github.com/KiTant/CTkCodeBoxPlus/issues)
- **Discussions**: [Community support and questions](https://github.com/KiTant/CTkCodeBoxPlus/discussions)
---
## Authors
- **Original Author**: [Akash Bora (Akascape)](https://github.com/Akascape) - CTkCodeBox
- **Author**: [xzyqox (KiTant)](https://github.com/KiTant) - CTkCodeBoxPlus (Enhanced version with new\better features)
---
## License
This project is licensed under the MIT License.
---
Raw data
{
"_id": null,
"home_page": null,
"name": "CTkCodeBoxPlus",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "xzyqox <xzyqox@gmail.com>",
"keywords": "customtkinter, codebox, code, gui, tkinter, context-menu",
"author": null,
"author_email": "xzyqox <xzyqox@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/7d/23/007cde694374763b1d66f01c07ab5771ebd9b131f472e5379703fb9ffbab/ctkcodeboxplus-1.0.tar.gz",
"platform": null,
"description": "# CTkCodeBoxPlus\n\nA code editor widget for customtkinter (Enhanced Edition).\n\n\n\n## Features\n- Multiple language support\n- Code syntax highlighting\n- Line highlighting (Enhanced)\n- Auto-Indent and Outdent (Enhanced)\n- Custom history with undo and redo (Enhanced)\n- Smart selection on double and triple click (Enhanced)\n- Implemented actions like copy, paste, cut (Enhanced)\n- Keybindings for implemented actions (Enhanced)\n- Multiple Themes\n- Right-click menu (Enhanced)\n- Line numbers on left side\n- Fully customizable\n- Easy to Use\n\n## Installation\n\n```bash\npip install CTkCodeBoxPlus\n```\n\n## Simple Usage\n```python\nimport customtkinter\nfrom CTkCodeBoxPlus import *\n\nroot = customtkinter.CTk()\n\ncodebox = CTkCodeBox(root, language=\"python\")\ncodebox.pack(padx=10, pady=10, expand=True,fill=\"both\")\n\nroot.mainloop()\n```\n\n### Arguments\n| Parameter | Type | Default | Description |\n|----------------------------------|--------------------------|-------------------|--------------------------------------------------------|\n| **master** | Widget | - | Parent widget |\n| **language** | str/pygments.lexer.Lexer | - | Pygments language name (str) or a lexer class |\n| **height** | int | 200 | Widget height in pixels (passed to CTkTextbox) |\n| **theme** | str | \"solarized-light\" | Pygments style name used for highlighting |\n| **line_numbering** | bool | True | Enable line numbers |\n| **numbering_color** | str | None | Color for line numbers |\n| **menu** | bool | True | Enable context menu |\n| **menu_fg_color** | str | None | Context menu background color |\n| **menu_text_color** | str | None | Context menu text color |\n| **menu_hover_color** | str | None | Context menu active background color |\n| **wrap** | bool | True | Enable word wrap |\n| **select_color** | str | None | Override selection background color |\n| **cursor_color** | str | None | Cursor color I (blinking) |\n| **highlight_current_line** | bool | True | Highlight the active line |\n| **highlight_current_line_color** | str | None | Explicit color for active line |\n| **history_enabled** | bool | True | Enable built-in undo/redo history |\n| **history_cooldown** (ms) | int | 2500 | Cooldown for pushing history in _on_keypress_history() |\n| **history_max** | int | 100 | Maximum undo frames to keep. |\n| **indent_width** | int | 4 | Number of spaces for indent/outdent. |\n| ****kwargs** | various | - | Additional CTkTextBox parameters |\n\n### Methods\n- **.insert(index, code, push_history)**: Insert code/text in the box and trigger a non-editing highlight update with pushing history (if push_history is True)\n- **.get(index1, index2)**: Get code/text from the box\n- **.configure(kwargs)**: Change parameters of the codebox\n- **.cget(parameter)**: Get the parameter value from the codebox by name\n- **.update_code()**: Schedule a debounced re-highlight and update edited flag\n- **.clear_code()**: Remove all highlighting tags while preserving selection\n- **.set_wrap(enabled)**: Enable/disable word wrap\n- **.toggle_wrap()**: Toggle wrap mode\n- **.is_edited()**: Return True if the text has been edited since last reset\n- **.reset_edited()**: Reset edited state flag to False\n- **.cut_text()**: Cut selected text to clipboard and notify change\n- **.copy_text()**: Copy selected text to clipboard\n- **.paste_text()**: Paste clipboard text, replacing selection if present, and refresh highlighting/lines with notify change\n- **.clear_all_text()**: Delete all content and notify change\n- **.select_all_text()**: Select all content\n- **.set_history_enabled(enabled)**: Enable/disable the internal undo/redo history\n- **.set_history_limit(limit)**: Set maximum number of undo frames to keep\n- **.clear_history()**: Clear undo and redo stacks\n- **.undo()**: Undo the last change if history is enabled\n- **.redo()**: Redo the last undone change if available\n\n<br>\n<a href=\"https://github-readme-tech-stack.vercel.app\">\n<img src=\"https://github-readme-tech-stack.vercel.app/api/cards?title=Languages&lineCount=4&width=520&bg=%230D1117&badge=%23161B22&border=%2321262D&titleColor=%2358A6FF&line1=python%2Cpython%2Cfff800%3BCplusplus%2C%2B%2B%2C7bc9b1%3Bcplusplus%2Csharp%2C6c3bb2%3BCplusplus%2C+%2C4a82cc%3Bjavascript%2Cjavascript%2Cf0fc0d%3B&line2=lua%2Clua%2C5d72e6%3BRust%2Crust%2Ce62323%3Bperl%2Cperl%2C92d5d3%3Bkotlin%2Ckotlin%2C6dfa21%3Bruby%2Cruby%2Cff0000%3B&line3=swift%2Cswift%2Cfe811b%3Bphp%2Cphp%2C3749b3%3Breact%2Creact%2Cd3ff00%3Bjson%2Cjson%2Cffe300%3Bgo%2Cgo%2C11ffdc%3B&line4=yaml%2Cyaml%2C6dc2af%3Bxml%2Cxml%2C63f030%3Bcss%2Ccss%2C1ff9f2%3Bhtml%2Chtml%2C2bc5b4%3BTypescript%2CTypescript%2C42b1c2%3BJAVA%2Cjava%2Ceffc00%3B\" alt=\"Languages\" />\n</a>\n\nMore lexers available here: https://pygments.org/docs/lexers/\n\n## Color Themes\n```\nabap, arduino, autumn, borland, colorful, default, dracula, emacs, \nfriendly_grayscale, friendly, fruity, github-dark, gruvbox-dark, \ngruvbox-light, igor, inkpot, lightbulb, lilypond, lovelace, manni, material, \nmonokai, murphy, native, nord-darker, nord, one-dark, paraiso-dark, paraiso-light, \npastie, perldoc, rainbow_dash, rrt, sas, solarized-dark, solarized-light, staroffice, \nstata-dark, stata-light, tango, trac, vim, vs, xcode, zenburn\n```\nMore style examples given here: https://pygments.org/styles/\n\n---\n\n## Support & Issues\n\n- **GitHub Issues**: [Report bugs or request features](https://github.com/KiTant/CTkCodeBoxPlus/issues)\n- **Discussions**: [Community support and questions](https://github.com/KiTant/CTkCodeBoxPlus/discussions)\n\n---\n\n## Authors\n\n- **Original Author**: [Akash Bora (Akascape)](https://github.com/Akascape) - CTkCodeBox\n- **Author**: [xzyqox (KiTant)](https://github.com/KiTant) - CTkCodeBoxPlus (Enhanced version with new\\better features)\n\n---\n\n## License\n\nThis project is licensed under the MIT License.\n\n---\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2024 Akash Bora\n Copyright (c) 2025 xzyqox\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n ",
"summary": "A code editor widget for customtkinter with enhanced features",
"version": "1.0",
"project_urls": {
"Documentation": "https://github.com/KiTant/CTkCodeBoxPlus#readme",
"Homepage": "https://github.com/KiTant/CTkCodeBoxPlus",
"Issues": "https://github.com/KiTant/CTkCodeBoxPlus/issues",
"Repository": "https://github.com/KiTant/CTkCodeBoxPlus"
},
"split_keywords": [
"customtkinter",
" codebox",
" code",
" gui",
" tkinter",
" context-menu"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "0030691a942939fe3065fb2a069832af3947bac76317e6dedade5d1db8fd3e78",
"md5": "f7a5bf64b67b77d0a761626e6015a96d",
"sha256": "a249905609ac3b35a774d1c7e48b98769c13b8de491bae24a2aa0b7fec0bcc23"
},
"downloads": -1,
"filename": "ctkcodeboxplus-1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f7a5bf64b67b77d0a761626e6015a96d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 22565,
"upload_time": "2025-08-25T19:45:50",
"upload_time_iso_8601": "2025-08-25T19:45:50.786738Z",
"url": "https://files.pythonhosted.org/packages/00/30/691a942939fe3065fb2a069832af3947bac76317e6dedade5d1db8fd3e78/ctkcodeboxplus-1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "7d23007cde694374763b1d66f01c07ab5771ebd9b131f472e5379703fb9ffbab",
"md5": "41314ecb3b9e24da5f55083a95fbde4e",
"sha256": "64bfdfd8a8e7f3c49b4aed37d35797bf5bd1ad912998b28f540a8472aebf7680"
},
"downloads": -1,
"filename": "ctkcodeboxplus-1.0.tar.gz",
"has_sig": false,
"md5_digest": "41314ecb3b9e24da5f55083a95fbde4e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 20618,
"upload_time": "2025-08-25T19:45:51",
"upload_time_iso_8601": "2025-08-25T19:45:51.997933Z",
"url": "https://files.pythonhosted.org/packages/7d/23/007cde694374763b1d66f01c07ab5771ebd9b131f472e5379703fb9ffbab/ctkcodeboxplus-1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-25 19:45:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "KiTant",
"github_project": "CTkCodeBoxPlus#readme",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "ctkcodeboxplus"
}