CTkMessagebox


NameCTkMessagebox JSON
Version 2.7 PyPI version JSON
download
home_pagehttps://github.com/Akascape/CTkMessagebox
SummaryA modern messagebox for customtkinter
upload_time2024-06-29 07:53:30
maintainerNone
docs_urlNone
authorAkash Bora
requires_python>=3.6
licenseCreative Commons Zero v1.0 Universal
keywords customtkinter customtkinter-dialog customtkinter-messagebox customtkinter-message-box tkinter-messagebox custom-messagebox messagebox-widget modern-tkinter-messagebox ctkmessagebox popup-window
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center">CTkMessagebox</h1>

<h3 align="center">A modern and fully customizable messagebox for CustomTkinter, A must-have extension pack!</h3>

<div align="center">
    
  <a href="https://creativecommons.org/publicdomain/zero/1.0/">![License](https://img.shields.io/badge/License-CC0_1.0-blue)</a>
  <a href="https://github.com/Akascape/CTkMessagebox/archive/refs/heads/main.zip">![Download](https://img.shields.io/badge/Source_Code-Download-blue)</a>
  [![PyPI](https://img.shields.io/pypi/v/CTkMessagebox?style=flat)](https://pypi.org/project/CTkMessagebox)
  [![Downloads](https://static.pepy.tech/badge/ctkmessagebox)](https://pepy.tech/project/ctkmessagebox)
  ![Platform](https://img.shields.io/powershellgallery/p/Pester?color=blue)
</div>


<div align="center">

![3d](https://github.com/Akascape/CTkMessagebox/assets/89206401/cce577fc-6426-4c09-96f9-ede88caf7784)

</div>

<br>

<h2 align="center"> Features </h2>

- Customize all elements inside the messagebox
- Add custom icons or images
- Add multiple options according to your wish
- No ugly looking header or borders
- Comes with **5 default icons**
- Spawns at center of the screen/app
- Draggable window
- Fade-in/Fade-out window effect

<br>

<h2 align="center"> Installation </h2>

<div align="center">

```
pip install CTkMessagebox
```

[<img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/Akascape/CTkMessagebox?&color=green&label=Source%20Code&logo=Python&logoColor=yellow&style=for-the-badge"  width="300">](https://github.com/Akascape/CTkMessagebox/archive/refs/heads/main.zip)


</div>

<br>

<h2 align="center"> How it looks? </h2>

<div align="center">

![Screenshot](https://user-images.githubusercontent.com/89206401/221258593-75058878-b598-40c3-828a-1d44a6cefb73.jpg)

</div>

<br>

<h2 align="center"> Example </h2>

```python
from CTkMessagebox import CTkMessagebox
import customtkinter

def show_info():
    # Default messagebox for showing some information
    CTkMessagebox(title="Info", message="This is a CTkMessagebox!")

def show_checkmark():
    # Show some positive message with the checkmark icon
    CTkMessagebox(message="CTkMessagebox is successfully installed.",
                  icon="check", option_1="Thanks")
    
def show_error():
    # Show some error message
    CTkMessagebox(title="Error", message="Something went wrong!!!", icon="cancel")
    
def show_warning():
    # Show some retry/cancel warnings
    msg = CTkMessagebox(title="Warning Message!", message="Unable to connect!",
                  icon="warning", option_1="Cancel", option_2="Retry")
    
    if msg.get()=="Retry":
        show_warning()
        
def ask_question():
    # get yes/no answers
    msg = CTkMessagebox(title="Exit?", message="Do you want to close the program?",
                        icon="question", option_1="Cancel", option_2="No", option_3="Yes")
    response = msg.get()
    
    if response=="Yes":
        app.destroy()       
    else:
        print("Click 'Yes' to exit!")
              
app = customtkinter.CTk()
app.rowconfigure((0,1,2,3,4,5), weight=1)
app.columnconfigure(0, weight=1)
app.minsize(200,250)

customtkinter.CTkLabel(app, text="CTk Messagebox Examples").grid(padx=20)
customtkinter.CTkButton(app, text="Check CTkMessagebox", command=show_checkmark).grid(padx=20, pady=10, sticky="news")
customtkinter.CTkButton(app, text="Show Info", command=show_info).grid(padx=20, pady=10, sticky="news")
customtkinter.CTkButton(app, text="Show Error", command=show_error).grid(padx=20, pady=10, sticky="news")
customtkinter.CTkButton(app, text="Show Warning", command=show_warning).grid(padx=20, pady=10, sticky="news")
customtkinter.CTkButton(app, text="Ask Question", command=ask_question).grid(padx=20, pady=(10,20), sticky="news")

app.mainloop()

```

<br>

<h2 align="center"> OPTIONS </h2>

<div align="center">

  | Parameters  | Description |
  | -------- | ----------- |
  | _master_ | set parent window (optional), the box will spawn at center of the parent window |
  | _width_ | width of the window in px (optional) |
  | _height_ | height of the window in px (optional) |
  | _fg_color_ | forground color of the messagebox [middle portion] |
  | _bg_color_  | background color of the messagebox |
  | **_title_** | title of the messagebox |
  | **_message_** | main message of the messagebox which will be shown at the center |
  | **_option_1_** | the text on the first button [Default is 'OK'] |
  | **_option_2_** | the text on the second button |
  | **_option_3_** | the text on the last button |
  | _options_ | directly pass a list containing the options in order |
  | _button_color_ | color of the buttons |
  | _text_color_ | color of the message-text |
  | _title_color_ | color of the title-text |
  | _button_text_color_ | color of the button-text |
  | _button_hover_color_ | hover color of the buttons |
  | _button_width_ | width of the buttons in px |
  | _button_height_ | height of the buttons in px |
  | _border_width_ | width of the border around the main frame [Default is 1] |
  | _border_color_ | color of the frame border |
  | _cancel_button_ | define the cancel button type: **circle, cross or None** |
  | _cancel_button_color_ | color of the **close** button, **set it to 'transparent' if you want to hide it** |
  | **_icon_** | icon that will be shown in the messagebox [Default is the 'info' icon] |
  | _icon_size_ | define the size of the icon image manually (tuple) |
  | _corner_radius_ | corner roundness of the messagebox window [**not applicable in linux**] |
  | _font_ | font of the messagebox text (tuple) |
  | _header_ | add the original header back if you don't like **overrideredirect** (bool) |
  | _topmost_ | disable the topmost window outside the app (bool) |
  | _sound_ | enable the system bell sound when the window popups (bool) |
  | _justify_ | position the buttons to center/right/left |
  | _focus_option_ | select an option by default when `Enter` key is pressed |
  | **_fade_in_duration_** | enable a fade-in and fade-out animation (int, default is 0)  |
  

</div>

<br>

<h2 align="center"> Icons </h2>

<div align="center">

**Default icons:**

![icons](https://user-images.githubusercontent.com/89206401/221258403-aafea575-856e-4f4e-b3af-f995785c9879.png)

(*These icons are created using Paint.NET, free to use!*)

**For custom images, just use `icon="image_path.png"`**

## That's all, hope it will help in UI development!

</div>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Akascape/CTkMessagebox",
    "name": "CTkMessagebox",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "customtkinter, customtkinter-dialog, customtkinter-messagebox, customtkinter-message-box, tkinter-messagebox, custom-messagebox, messagebox-widget, modern-tkinter-messagebox, ctkmessagebox, popup-window",
    "author": "Akash Bora",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/1d/c3/1e4235e586e3b846bc5c82719760041f815a26c7d8b8933402e08216e81c/ctkmessagebox-2.7.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\">CTkMessagebox</h1>\r\n\r\n<h3 align=\"center\">A modern and fully customizable messagebox for CustomTkinter, A must-have extension pack!</h3>\r\n\r\n<div align=\"center\">\r\n    \r\n  <a href=\"https://creativecommons.org/publicdomain/zero/1.0/\">![License](https://img.shields.io/badge/License-CC0_1.0-blue)</a>\r\n  <a href=\"https://github.com/Akascape/CTkMessagebox/archive/refs/heads/main.zip\">![Download](https://img.shields.io/badge/Source_Code-Download-blue)</a>\r\n  [![PyPI](https://img.shields.io/pypi/v/CTkMessagebox?style=flat)](https://pypi.org/project/CTkMessagebox)\r\n  [![Downloads](https://static.pepy.tech/badge/ctkmessagebox)](https://pepy.tech/project/ctkmessagebox)\r\n  ![Platform](https://img.shields.io/powershellgallery/p/Pester?color=blue)\r\n</div>\r\n\r\n\r\n<div align=\"center\">\r\n\r\n![3d](https://github.com/Akascape/CTkMessagebox/assets/89206401/cce577fc-6426-4c09-96f9-ede88caf7784)\r\n\r\n</div>\r\n\r\n<br>\r\n\r\n<h2 align=\"center\"> Features </h2>\r\n\r\n- Customize all elements inside the messagebox\r\n- Add custom icons or images\r\n- Add multiple options according to your wish\r\n- No ugly looking header or borders\r\n- Comes with **5 default icons**\r\n- Spawns at center of the screen/app\r\n- Draggable window\r\n- Fade-in/Fade-out window effect\r\n\r\n<br>\r\n\r\n<h2 align=\"center\"> Installation </h2>\r\n\r\n<div align=\"center\">\r\n\r\n```\r\npip install CTkMessagebox\r\n```\r\n\r\n[<img alt=\"GitHub repo size\" src=\"https://img.shields.io/github/repo-size/Akascape/CTkMessagebox?&color=green&label=Source%20Code&logo=Python&logoColor=yellow&style=for-the-badge\"  width=\"300\">](https://github.com/Akascape/CTkMessagebox/archive/refs/heads/main.zip)\r\n\r\n\r\n</div>\r\n\r\n<br>\r\n\r\n<h2 align=\"center\"> How it looks? </h2>\r\n\r\n<div align=\"center\">\r\n\r\n![Screenshot](https://user-images.githubusercontent.com/89206401/221258593-75058878-b598-40c3-828a-1d44a6cefb73.jpg)\r\n\r\n</div>\r\n\r\n<br>\r\n\r\n<h2 align=\"center\"> Example </h2>\r\n\r\n```python\r\nfrom CTkMessagebox import CTkMessagebox\r\nimport customtkinter\r\n\r\ndef show_info():\r\n    # Default messagebox for showing some information\r\n    CTkMessagebox(title=\"Info\", message=\"This is a CTkMessagebox!\")\r\n\r\ndef show_checkmark():\r\n    # Show some positive message with the checkmark icon\r\n    CTkMessagebox(message=\"CTkMessagebox is successfully installed.\",\r\n                  icon=\"check\", option_1=\"Thanks\")\r\n    \r\ndef show_error():\r\n    # Show some error message\r\n    CTkMessagebox(title=\"Error\", message=\"Something went wrong!!!\", icon=\"cancel\")\r\n    \r\ndef show_warning():\r\n    # Show some retry/cancel warnings\r\n    msg = CTkMessagebox(title=\"Warning Message!\", message=\"Unable to connect!\",\r\n                  icon=\"warning\", option_1=\"Cancel\", option_2=\"Retry\")\r\n    \r\n    if msg.get()==\"Retry\":\r\n        show_warning()\r\n        \r\ndef ask_question():\r\n    # get yes/no answers\r\n    msg = CTkMessagebox(title=\"Exit?\", message=\"Do you want to close the program?\",\r\n                        icon=\"question\", option_1=\"Cancel\", option_2=\"No\", option_3=\"Yes\")\r\n    response = msg.get()\r\n    \r\n    if response==\"Yes\":\r\n        app.destroy()       \r\n    else:\r\n        print(\"Click 'Yes' to exit!\")\r\n              \r\napp = customtkinter.CTk()\r\napp.rowconfigure((0,1,2,3,4,5), weight=1)\r\napp.columnconfigure(0, weight=1)\r\napp.minsize(200,250)\r\n\r\ncustomtkinter.CTkLabel(app, text=\"CTk Messagebox Examples\").grid(padx=20)\r\ncustomtkinter.CTkButton(app, text=\"Check CTkMessagebox\", command=show_checkmark).grid(padx=20, pady=10, sticky=\"news\")\r\ncustomtkinter.CTkButton(app, text=\"Show Info\", command=show_info).grid(padx=20, pady=10, sticky=\"news\")\r\ncustomtkinter.CTkButton(app, text=\"Show Error\", command=show_error).grid(padx=20, pady=10, sticky=\"news\")\r\ncustomtkinter.CTkButton(app, text=\"Show Warning\", command=show_warning).grid(padx=20, pady=10, sticky=\"news\")\r\ncustomtkinter.CTkButton(app, text=\"Ask Question\", command=ask_question).grid(padx=20, pady=(10,20), sticky=\"news\")\r\n\r\napp.mainloop()\r\n\r\n```\r\n\r\n<br>\r\n\r\n<h2 align=\"center\"> OPTIONS </h2>\r\n\r\n<div align=\"center\">\r\n\r\n  | Parameters  | Description |\r\n  | -------- | ----------- |\r\n  | _master_ | set parent window (optional), the box will spawn at center of the parent window |\r\n  | _width_ | width of the window in px (optional) |\r\n  | _height_ | height of the window in px (optional) |\r\n  | _fg_color_ | forground color of the messagebox [middle portion] |\r\n  | _bg_color_  | background color of the messagebox |\r\n  | **_title_** | title of the messagebox |\r\n  | **_message_** | main message of the messagebox which will be shown at the center |\r\n  | **_option_1_** | the text on the first button [Default is 'OK'] |\r\n  | **_option_2_** | the text on the second button |\r\n  | **_option_3_** | the text on the last button |\r\n  | _options_ | directly pass a list containing the options in order |\r\n  | _button_color_ | color of the buttons |\r\n  | _text_color_ | color of the message-text |\r\n  | _title_color_ | color of the title-text |\r\n  | _button_text_color_ | color of the button-text |\r\n  | _button_hover_color_ | hover color of the buttons |\r\n  | _button_width_ | width of the buttons in px |\r\n  | _button_height_ | height of the buttons in px |\r\n  | _border_width_ | width of the border around the main frame [Default is 1] |\r\n  | _border_color_ | color of the frame border |\r\n  | _cancel_button_ | define the cancel button type: **circle, cross or None** |\r\n  | _cancel_button_color_ | color of the **close** button, **set it to 'transparent' if you want to hide it** |\r\n  | **_icon_** | icon that will be shown in the messagebox [Default is the 'info' icon] |\r\n  | _icon_size_ | define the size of the icon image manually (tuple) |\r\n  | _corner_radius_ | corner roundness of the messagebox window [**not applicable in linux**] |\r\n  | _font_ | font of the messagebox text (tuple) |\r\n  | _header_ | add the original header back if you don't like **overrideredirect** (bool) |\r\n  | _topmost_ | disable the topmost window outside the app (bool) |\r\n  | _sound_ | enable the system bell sound when the window popups (bool) |\r\n  | _justify_ | position the buttons to center/right/left |\r\n  | _focus_option_ | select an option by default when `Enter` key is pressed |\r\n  | **_fade_in_duration_** | enable a fade-in and fade-out animation (int, default is 0)  |\r\n  \r\n\r\n</div>\r\n\r\n<br>\r\n\r\n<h2 align=\"center\"> Icons </h2>\r\n\r\n<div align=\"center\">\r\n\r\n**Default icons:**\r\n\r\n![icons](https://user-images.githubusercontent.com/89206401/221258403-aafea575-856e-4f4e-b3af-f995785c9879.png)\r\n\r\n(*These icons are created using Paint.NET, free to use!*)\r\n\r\n**For custom images, just use `icon=\"image_path.png\"`**\r\n\r\n## That's all, hope it will help in UI development!\r\n\r\n</div>\r\n",
    "bugtrack_url": null,
    "license": "Creative Commons Zero v1.0 Universal",
    "summary": "A modern messagebox for customtkinter",
    "version": "2.7",
    "project_urls": {
        "Homepage": "https://github.com/Akascape/CTkMessagebox"
    },
    "split_keywords": [
        "customtkinter",
        " customtkinter-dialog",
        " customtkinter-messagebox",
        " customtkinter-message-box",
        " tkinter-messagebox",
        " custom-messagebox",
        " messagebox-widget",
        " modern-tkinter-messagebox",
        " ctkmessagebox",
        " popup-window"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b9e0827193418fd1c0b2f7c64cb0fec255996e40da69e05b2454fd1375a64eff",
                "md5": "baf41a9e753aee7f990da3906360fc19",
                "sha256": "68941ccab2251f2fd3ac3338a99bdd30d9f28fee4ef0070dfdd0420be1c34a5a"
            },
            "downloads": -1,
            "filename": "CTkMessagebox-2.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "baf41a9e753aee7f990da3906360fc19",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 125878,
            "upload_time": "2024-06-29T07:53:26",
            "upload_time_iso_8601": "2024-06-29T07:53:26.470008Z",
            "url": "https://files.pythonhosted.org/packages/b9/e0/827193418fd1c0b2f7c64cb0fec255996e40da69e05b2454fd1375a64eff/CTkMessagebox-2.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1dc31e4235e586e3b846bc5c82719760041f815a26c7d8b8933402e08216e81c",
                "md5": "fd4735f8361bacafead5314bf2dfda4e",
                "sha256": "5ce7e76b797c8d5de5f29438d8c784e33c72fb6ff666c87eb8991815c46c59c5"
            },
            "downloads": -1,
            "filename": "ctkmessagebox-2.7.tar.gz",
            "has_sig": false,
            "md5_digest": "fd4735f8361bacafead5314bf2dfda4e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 126355,
            "upload_time": "2024-06-29T07:53:30",
            "upload_time_iso_8601": "2024-06-29T07:53:30.190343Z",
            "url": "https://files.pythonhosted.org/packages/1d/c3/1e4235e586e3b846bc5c82719760041f815a26c7d8b8933402e08216e81c/ctkmessagebox-2.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-29 07:53:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Akascape",
    "github_project": "CTkMessagebox",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ctkmessagebox"
}
        
Elapsed time: 0.65835s