Skip to main content

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

GitHub repo size

Menu Types

  • CTkMenuBar

menubar

Usage

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

Usage

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

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 for providing this dropdown menu class.

Metadata

Release files for CTkMenuBar 0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for CTkMenuBar 0.9
File Size Uploaded
ctkmenubar-0.9.tar.gz 14.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for CTkMenuBar 0.9
File Interpreter ABI Platform
ctkmenubar-0.9-py3-none-any.whl Python 3 none any Details

Total release size: 31.8 kB

Release files / ctkmenubar-0.9.tar.gz

Download URL ctkmenubar-0.9.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cc9b059277e90704735e251b2e35e4da001062cc9381d4e9f013c35b5c13a952
BLAKE2b-256 checksum
How to use checksums
99a806aa3eff34ccbc89d8522780c784b61683a4074556b14e9cc385aeaf84a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.6

Release files / ctkmenubar-0.9-py3-none-any.whl

Download URL ctkmenubar-0.9-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51a379d2ec01ecdeaa00aa47f069672271f126f087d2f460cb1fb5b11067b61f
BLAKE2b-256 checksum
How to use checksums
d0ae68f78d4ef338531716274daa3e7bcb931086eda38814243446bbafd2a95e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.9 This release

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page