CTkMenuBar


NameCTkMenuBar JSON
Version 0.7 PyPI version JSON
download
home_pagehttps://github.com/Akascape/CTkMenuBar
SummaryCustomtkinter Menu Widget
upload_time2024-05-07 08:08:44
maintainerNone
docs_urlNone
authorAkash Bora
requires_python>=3.6
licenseCreative Commons Zero v1.0 Universal
keywords customtkinter customtkinter-menu ctkmenubar titlemenu menubar tkinter menu-widget tkinter-gui
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

![menubar](https://github.com/Akascape/CTkMenuBar/assets/89206401/02c512b2-557f-4d59-86e0-a6eb9da3696c)

### 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!_

![titlebar](https://github.com/Akascape/CTkMenuBar/assets/89206401/da6cd858-f700-476c-a2f0-93a1c6335a4d)

### 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/f8/62/17a6e017a98ca9a25a90c506e09b3e215e45e3b5a384a9a959042edd1118/ctkmenubar-0.7.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![menubar](https://github.com/Akascape/CTkMenuBar/assets/89206401/02c512b2-557f-4d59-86e0-a6eb9da3696c)\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![titlebar](https://github.com/Akascape/CTkMenuBar/assets/89206401/da6cd858-f700-476c-a2f0-93a1c6335a4d)\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.7",
    "project_urls": {
        "Homepage": "https://github.com/Akascape/CTkMenuBar"
    },
    "split_keywords": [
        "customtkinter",
        " customtkinter-menu",
        " ctkmenubar",
        " titlemenu",
        " menubar",
        " tkinter",
        " menu-widget",
        " tkinter-gui"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2ce56d43cd107ec138be7a75efe9da2de01f4069c7a1d7b9930bbbe42decfaf3",
                "md5": "6c526b4aa290b39495498d888ab3a728",
                "sha256": "6883b035b6fd3fde0586bd92b44fd4cf2ab3d9f62e0a4027e12dd588f406a535"
            },
            "downloads": -1,
            "filename": "CTkMenuBar-0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6c526b4aa290b39495498d888ab3a728",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 11750,
            "upload_time": "2024-05-07T08:08:43",
            "upload_time_iso_8601": "2024-05-07T08:08:43.322947Z",
            "url": "https://files.pythonhosted.org/packages/2c/e5/6d43cd107ec138be7a75efe9da2de01f4069c7a1d7b9930bbbe42decfaf3/CTkMenuBar-0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f86217a6e017a98ca9a25a90c506e09b3e215e45e3b5a384a9a959042edd1118",
                "md5": "0f248a3c4b4490dbadb7c8c9566231d8",
                "sha256": "9025ab4e29a2a91860cce26f427f4e42f9f3fc42d1c31ae55a42cc9c6dc19723"
            },
            "downloads": -1,
            "filename": "ctkmenubar-0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "0f248a3c4b4490dbadb7c8c9566231d8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 10551,
            "upload_time": "2024-05-07T08:08:44",
            "upload_time_iso_8601": "2024-05-07T08:08:44.787997Z",
            "url": "https://files.pythonhosted.org/packages/f8/62/17a6e017a98ca9a25a90c506e09b3e215e45e3b5a384a9a959042edd1118/ctkmenubar-0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-07 08:08:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Akascape",
    "github_project": "CTkMenuBar",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ctkmenubar"
}
        
Elapsed time: 0.26100s