# CTkMenuBar
Modern menu bar widget library for customtkinter.
## Features
- Custom dropdown menus
- Add menu in top of title bar
- Classic and modern menubar with full customisability
- Add commands and submenus
## Installation
```
pip install CTkMenuBar
```
### [<img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/Akascape/CTkMenuBar?&color=white&label=Download%20Source%20Code&logo=Python&logoColor=yellow&style=for-the-badge" width="400">](https://github.com/Akascape/CTkMenuBar/archive/refs/heads/main.zip)
## Menu Types
- ## CTkMenuBar

### Usage
```python
from CTkMenuBar import *
...
menu = CTkMenuBar(master=root)
menu.add_cascade("Menu")
...
```
### Methods
- **.add_cascade(text, ctk_button_args...)**: add new menu button in the menu bar
- .configure(*frame_kwargs)
### Arguments
| Parameter | Description |
|-----------| ------------|
| **master** | define the master widget, can be root or frame |
| bg_color | set the bg color of the menu bar |
| height | set height of the menu bar |
| width | set width of the menu bar buttons |
| padx | set internal padding between menu bar buttons |
| pady | set internal padding in top and bottom of menu bar |
| postcommand | add a command before spawing the dropdown |
| _*other frame parameters_ | other ctk frame parameters can also be passed |
- ## CTkTitleMenu
_This title menu is only supported in windows OS!_

### Usage
```python
from CTkMenuBar import *
...
menu = CTkTitleMenu(master=root)
menu.add_cascade("Menu")
...
```
### Methods
- **.add_cascade(text, ctk_button_kwargs...)**: add new menu button in the menu bar
### Arguments
| Parameter | Description |
|-----------| ------------|
| **master** | define the master window, can be **root or toplevel** only |
| bg_color | set the bg color of the menu bar |
| title_bar_color | set color to the header (**only works with windows 11**), `RGB order: 0x00rrggbb` |
| width | set width of the menu bar buttons |
| padx | set internal padding between menu bar buttons |
| x_offset | set the x distance from the header |
| y_offset | set the y distance from the header |
| postcommand | add a command before spawing the dropdown |
| _*other frame parameters_ | other ctk frame parameters can also be passed |
## CustomDropdownMenu
This is the common dropdown menu class which is used by both ctkmenubar and ctktitlemenu.
### Usage
```python
from CTkMenuBar import *
...
dropdown = CustomDropdownMenu(widget=button)
dropdown.add_option(option="value")
dropdown.add_separator()
submenu = dropdown.add_submenu("submenu")
submenu.add_option(option="value")
...
```
### Methods
- **.add_option(option, command)**: add option to the dropdown and attach the command
- **.add_separator()**: add a separator line between the options
- **.add_submenu(submenu_name)**: add a submenu as option
- **.configure(**args): change dropdown menu options
### Arguments
| Parameter | Description |
|-----------| ------------|
| **widget** | attach the dropdown to the cascade widget |
| master | *optional*, change the spawn window if required |
| bg_color | set the bg color of the dropdown |
| fg_color | set the option button fg color |
| text_color | set the text color |
| hover_color | set hover color of the option button |
| separator_color | change the separator line color |
| font | change the font of the text |
| width | set width of the dropdown |
| height | set height of the dropdown |
| padx | set padding in x for the dropdown frame |
| pady | set padding in y for the dropdown frame |
| _*other frame parameters_ | other ctk frame parameters can also be passed |
_Credits goes to [LucianoSaldivia](https://github.com/LucianoSaldivia) for providing this dropdown menu class._
Raw data
{
"_id": null,
"home_page": "https://github.com/Akascape/CTkMenuBar",
"name": "CTkMenuBar",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "customtkinter, customtkinter-menu, ctkmenubar, titlemenu, menubar, tkinter, menu-widget, tkinter-gui",
"author": "Akash Bora",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/99/a8/06aa3eff34ccbc89d8522780c784b61683a4074556b14e9cc385aeaf84a7/ctkmenubar-0.9.tar.gz",
"platform": null,
"description": "# CTkMenuBar\r\nModern menu bar widget library for customtkinter.\r\n\r\n## Features\r\n- Custom dropdown menus\r\n- Add menu in top of title bar\r\n- Classic and modern menubar with full customisability\r\n- Add commands and submenus\r\n\r\n## Installation\r\n\r\n```\r\npip install CTkMenuBar\r\n```\r\n### [<img alt=\"GitHub repo size\" src=\"https://img.shields.io/github/repo-size/Akascape/CTkMenuBar?&color=white&label=Download%20Source%20Code&logo=Python&logoColor=yellow&style=for-the-badge\" width=\"400\">](https://github.com/Akascape/CTkMenuBar/archive/refs/heads/main.zip)\r\n\r\n## Menu Types\r\n- ## CTkMenuBar\r\n\r\n\r\n\r\n### Usage\r\n```python\r\nfrom CTkMenuBar import *\r\n...\r\nmenu = CTkMenuBar(master=root)\r\nmenu.add_cascade(\"Menu\")\r\n...\r\n```\r\n\r\n### Methods\r\n- **.add_cascade(text, ctk_button_args...)**: add new menu button in the menu bar\r\n- .configure(*frame_kwargs)\r\n\r\n### Arguments\r\n| Parameter | Description |\r\n|-----------| ------------|\r\n| **master** | define the master widget, can be root or frame |\r\n| bg_color | set the bg color of the menu bar |\r\n| height | set height of the menu bar |\r\n| width | set width of the menu bar buttons |\r\n| padx | set internal padding between menu bar buttons |\r\n| pady | set internal padding in top and bottom of menu bar |\r\n| postcommand | add a command before spawing the dropdown |\r\n| _*other frame parameters_ | other ctk frame parameters can also be passed |\r\n\r\n- ## CTkTitleMenu\r\n\r\n_This title menu is only supported in windows OS!_\r\n\r\n\r\n\r\n### Usage\r\n```python\r\nfrom CTkMenuBar import *\r\n...\r\nmenu = CTkTitleMenu(master=root)\r\nmenu.add_cascade(\"Menu\")\r\n...\r\n```\r\n\r\n### Methods\r\n- **.add_cascade(text, ctk_button_kwargs...)**: add new menu button in the menu bar\r\n\r\n### Arguments\r\n| Parameter | Description |\r\n|-----------| ------------|\r\n| **master** | define the master window, can be **root or toplevel** only |\r\n| bg_color | set the bg color of the menu bar |\r\n| title_bar_color | set color to the header (**only works with windows 11**), `RGB order: 0x00rrggbb` |\r\n| width | set width of the menu bar buttons |\r\n| padx | set internal padding between menu bar buttons |\r\n| x_offset | set the x distance from the header |\r\n| y_offset | set the y distance from the header |\r\n| postcommand | add a command before spawing the dropdown |\r\n| _*other frame parameters_ | other ctk frame parameters can also be passed |\r\n\r\n## CustomDropdownMenu\r\n\r\nThis is the common dropdown menu class which is used by both ctkmenubar and ctktitlemenu. \r\n\r\n### Usage\r\n```python\r\nfrom CTkMenuBar import *\r\n...\r\ndropdown = CustomDropdownMenu(widget=button)\r\ndropdown.add_option(option=\"value\") \r\ndropdown.add_separator() \r\nsubmenu = dropdown.add_submenu(\"submenu\") \r\nsubmenu.add_option(option=\"value\") \r\n...\r\n```\r\n\r\n### Methods\r\n- **.add_option(option, command)**: add option to the dropdown and attach the command\r\n- **.add_separator()**: add a separator line between the options\r\n- **.add_submenu(submenu_name)**: add a submenu as option\r\n- **.configure(**args): change dropdown menu options\r\n \r\n### Arguments\r\n| Parameter | Description |\r\n|-----------| ------------|\r\n| **widget** | attach the dropdown to the cascade widget |\r\n| master | *optional*, change the spawn window if required |\r\n| bg_color | set the bg color of the dropdown |\r\n| fg_color | set the option button fg color |\r\n| text_color | set the text color |\r\n| hover_color | set hover color of the option button |\r\n| separator_color | change the separator line color |\r\n| font | change the font of the text |\r\n| width | set width of the dropdown |\r\n| height | set height of the dropdown |\r\n| padx | set padding in x for the dropdown frame |\r\n| pady | set padding in y for the dropdown frame |\r\n| _*other frame parameters_ | other ctk frame parameters can also be passed |\r\n\r\n_Credits goes to [LucianoSaldivia](https://github.com/LucianoSaldivia) for providing this dropdown menu class._\r\n",
"bugtrack_url": null,
"license": "Creative Commons Zero v1.0 Universal",
"summary": "Customtkinter Menu Widget",
"version": "0.9",
"project_urls": {
"Homepage": "https://github.com/Akascape/CTkMenuBar"
},
"split_keywords": [
"customtkinter",
" customtkinter-menu",
" ctkmenubar",
" titlemenu",
" menubar",
" tkinter",
" menu-widget",
" tkinter-gui"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "d0ae68f78d4ef338531716274daa3e7bcb931086eda38814243446bbafd2a95e",
"md5": "94a5529c61645336c865951522421602",
"sha256": "51a379d2ec01ecdeaa00aa47f069672271f126f087d2f460cb1fb5b11067b61f"
},
"downloads": -1,
"filename": "ctkmenubar-0.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "94a5529c61645336c865951522421602",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 16928,
"upload_time": "2025-08-09T09:07:07",
"upload_time_iso_8601": "2025-08-09T09:07:07.291093Z",
"url": "https://files.pythonhosted.org/packages/d0/ae/68f78d4ef338531716274daa3e7bcb931086eda38814243446bbafd2a95e/ctkmenubar-0.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "99a806aa3eff34ccbc89d8522780c784b61683a4074556b14e9cc385aeaf84a7",
"md5": "14393db8f5e3a9f2001f30ed43cd04d7",
"sha256": "cc9b059277e90704735e251b2e35e4da001062cc9381d4e9f013c35b5c13a952"
},
"downloads": -1,
"filename": "ctkmenubar-0.9.tar.gz",
"has_sig": false,
"md5_digest": "14393db8f5e3a9f2001f30ed43cd04d7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 14867,
"upload_time": "2025-08-09T09:07:08",
"upload_time_iso_8601": "2025-08-09T09:07:08.794898Z",
"url": "https://files.pythonhosted.org/packages/99/a8/06aa3eff34ccbc89d8522780c784b61683a4074556b14e9cc385aeaf84a7/ctkmenubar-0.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-09 09:07:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Akascape",
"github_project": "CTkMenuBar",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "ctkmenubar"
}