├── .github └── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ └── feature_request.yml ├── .gitignore ├── .readthedocs.yaml ├── LICENSE ├── MANIFEST.in ├── README.md ├── README_zh.md ├── beginningresult.png ├── build_instructions.txt ├── cookbook ├── animated_gif.py ├── assets │ └── spinners.gif └── validate_user_input.py ├── development ├── filedialogs │ ├── assets │ │ ├── icons8_desktop_40px.png │ │ ├── icons8_documents_folder_40px.png │ │ ├── icons8_downloads_folder_40px.png │ │ ├── icons8_file_40px.png │ │ ├── icons8_folder_40px.png │ │ ├── icons8_home_40px.png │ │ ├── icons8_movies_folder_40px.png │ │ ├── icons8_music_folder_40px.png │ │ ├── icons8_pictures_folder_40px.png │ │ └── icons8_user_folder_40px.png │ ├── devnotes.txt │ ├── examples │ │ ├── askdirectory.png │ │ ├── askopenfile.png │ │ ├── linux-current.png │ │ ├── windows-11-filedialog-2.png │ │ └── windows-11-filedialog.png │ ├── filebrowser.py │ └── filedialog_methods.py ├── scrolledframe │ └── scrolled.py └── validatedinput │ └── inputgroup.py ├── docs ├── assets │ ├── colors │ │ ├── danger.png │ │ ├── dark.png │ │ ├── info.png │ │ ├── light.png │ │ ├── primary.png │ │ ├── secondary.png │ │ ├── success.png │ │ └── warning.png │ ├── cookbook │ │ ├── animated-gif.gif │ │ ├── code-cooking.jfif │ │ └── entry-validation.gif │ ├── dialogs │ │ ├── color-dropper.png │ │ ├── date-picker-dialog.png │ │ ├── messagebox-ok-cancel.png │ │ ├── messagebox-ok.png │ │ ├── messagebox-retry-cancel.png │ │ ├── messagebox-show-error.png │ │ ├── messagebox-show-info.png │ │ ├── messagebox-show-question.png │ │ ├── messagebox-show-warning.png │ │ ├── messagebox-yes-no-cancel.png │ │ ├── messagebox-yes-no.png │ │ ├── querybox-get-color.png │ │ ├── querybox-get-date.png │ │ ├── querybox-get-float.png │ │ ├── querybox-get-font.png │ │ ├── querybox-get-integer.png │ │ ├── querybox-get-item.png │ │ └── querybox-get-string.png │ ├── gallery │ │ ├── back_me_up.png │ │ ├── calculator.png │ │ ├── collapsing_frame.png │ │ ├── equalizer.png │ │ ├── file_search_engine.png │ │ ├── long-running-determinate.gif │ │ ├── long-running-indeterminate.gif │ │ ├── magic_mouse.png │ │ ├── media_player.png │ │ ├── pc_cleaner.png │ │ ├── simple_data_entry_dark.png │ │ ├── simple_data_entry_light.png │ │ ├── text_reader.png │ │ ├── timer_widget_paused.png │ │ └── timer_widget_started.png │ ├── scrolled │ │ └── scrolledtext.gif │ ├── themes │ │ ├── cerculean.png │ │ ├── cosmo.png │ │ ├── cyborg.png │ │ ├── darkly.png │ │ ├── flatly.png │ │ ├── journal.png │ │ ├── legacy.png │ │ ├── legacy_dark.png │ │ ├── legacy_light.png │ │ ├── litera.png │ │ ├── lumen.png │ │ ├── minty.png │ │ ├── morph.png │ │ ├── pulse.png │ │ ├── sandstone.png │ │ ├── simplex.png │ │ ├── solar.png │ │ ├── superhero.png │ │ ├── themes.gif │ │ ├── united.png │ │ ├── vapor.png │ │ └── yeti.png │ ├── toast │ │ └── toast.png │ ├── tooltip │ │ └── tooltip.gif │ ├── ttkcreator │ │ └── creator.png │ ├── tutorial │ │ ├── button-colors.png │ │ ├── simple-usage.png │ │ └── solid-outline-button-styles.png │ ├── widget-styles │ │ ├── checkbuttons.gif │ │ ├── checkbuttons.png │ │ ├── combos.gif │ │ ├── date-entries.gif │ │ ├── date-picker-popup.gif │ │ ├── entries.gif │ │ ├── floodgauge.gif │ │ ├── frame.png │ │ ├── inverse-label.png │ │ ├── label.png │ │ ├── labelframe.png │ │ ├── link-buttons.gif │ │ ├── menubutton.gif │ │ ├── meter-2.gif │ │ ├── meter.gif │ │ ├── meter.png │ │ ├── notebook.png │ │ ├── outline-buttons.gif │ │ ├── outline-menubutton.gif │ │ ├── outline-radio-toolbutton.gif │ │ ├── outline-toolbuttons.gif │ │ ├── panedwindow.gif │ │ ├── radio-toolbutton.gif │ │ ├── radiobutton.gif │ │ ├── radiobuttons.png │ │ ├── round-scrollbars.gif │ │ ├── round-scrollbars.png │ │ ├── round-toggles.gif │ │ ├── scale.gif │ │ ├── separator.png │ │ ├── sizegrip.gif │ │ ├── solid-buttons.gif │ │ ├── solid-progressbar.gif │ │ ├── solid-toolbuttons.gif │ │ ├── spinbox.gif │ │ ├── square-scrollbars.gif │ │ ├── square-scrollbars.png │ │ ├── square-toggles.gif │ │ ├── striped-progressbar.gif │ │ └── treeview.gif │ ├── widgets │ │ ├── date-entry.png │ │ ├── floodgauge.gif │ │ ├── meter.gif │ │ ├── tableview-1.png │ │ ├── tableview-2.png │ │ └── tableview.gif │ └── window │ │ └── window-toplevel.png ├── en │ ├── about.md │ ├── api │ │ ├── colorutils.md │ │ ├── dialogs │ │ │ ├── colorchooser.md │ │ │ ├── colordropper.md │ │ │ ├── datepickerdialog.md │ │ │ ├── dialog.md │ │ │ ├── fontdialog.md │ │ │ ├── messagebox.md │ │ │ ├── messagedialog.md │ │ │ ├── querybox.md │ │ │ └── querydialog.md │ │ ├── icons │ │ │ ├── emoji.md │ │ │ └── icon.md │ │ ├── index.md │ │ ├── localization.md │ │ ├── scrolled │ │ │ ├── scrolledframe.md │ │ │ └── scrolledtext.md │ │ ├── style │ │ │ ├── bootstyle.md │ │ │ ├── colors.md │ │ │ ├── style.md │ │ │ ├── stylebuildertk.md │ │ │ ├── stylebuilderttk.md │ │ │ └── themedefinition.md │ │ ├── tableview │ │ │ ├── tablecolumn.md │ │ │ ├── tablerow.md │ │ │ └── tableview.md │ │ ├── toast.md │ │ ├── tooltip.md │ │ ├── utility.md │ │ ├── validation.md │ │ ├── widgets │ │ │ ├── dateentry.md │ │ │ ├── floodgauge.md │ │ │ └── meter.md │ │ └── window │ │ │ ├── toplevel.md │ │ │ └── window.md │ ├── cookbook │ │ ├── gif-animation.md │ │ ├── index.md │ │ └── validate-user-input.md │ ├── gallery │ │ ├── calculator.md │ │ ├── collapsingframe.md │ │ ├── dataentry.md │ │ ├── equalizer.md │ │ ├── filebackup.md │ │ ├── filesearchengine.md │ │ ├── index.md │ │ ├── magicmouse.md │ │ ├── mediaplayer.md │ │ ├── pccleaner.md │ │ ├── stopwatch.md │ │ └── textreader.md │ ├── gettingstarted │ │ ├── installation.md │ │ ├── legacy.md │ │ └── tutorial.md │ ├── index.md │ ├── license.md │ ├── styleguide │ │ ├── button.md │ │ ├── checkbutton.md │ │ ├── combobox.md │ │ ├── dateentry.md │ │ ├── datepickerpopup.md │ │ ├── entry.md │ │ ├── floodgauge.md │ │ ├── frame.md │ │ ├── index.md │ │ ├── label.md │ │ ├── labelframe.md │ │ ├── legacywidgets.md │ │ ├── menubutton.md │ │ ├── meter.md │ │ ├── notebook.md │ │ ├── panedwindow.md │ │ ├── progressbar.md │ │ ├── radiobutton.md │ │ ├── scale.md │ │ ├── scrollbar.md │ │ ├── separator.md │ │ ├── sizegrip.md │ │ ├── spinbox.md │ │ └── treeview.md │ └── themes │ │ ├── dark.md │ │ ├── definitions.md │ │ ├── index.md │ │ ├── light.md │ │ └── themecreator.md ├── requirements.txt └── zh │ ├── about.md │ ├── cookbook │ ├── gif-animation.md │ ├── index.md │ └── validate-user-input.md │ ├── gallery │ ├── calculator.md │ ├── collapsingframe.md │ ├── dataentry.md │ ├── equalizer.md │ ├── filebackup.md │ ├── filesearchengine.md │ ├── index.md │ ├── magicmouse.md │ ├── mediaplayer.md │ ├── pccleaner.md │ ├── stopwatch.md │ └── textreader.md │ ├── gettingstarted │ ├── installation.md │ ├── legacy.md │ └── tutorial.md │ ├── index.md │ ├── license.md │ ├── styleguide │ ├── button.md │ ├── checkbutton.md │ ├── combobox.md │ ├── dateentry.md │ ├── datepickerpopup.md │ ├── entry.md │ ├── floodgauge.md │ ├── frame.md │ ├── index.md │ ├── label.md │ ├── labelframe.md │ ├── legacywidgets.md │ ├── menubutton.md │ ├── meter.md │ ├── notebook.md │ ├── panedwindow.md │ ├── progressbar.md │ ├── radiobutton.md │ ├── scale.md │ ├── scrollbar.md │ ├── separator.md │ ├── sizegrip.md │ ├── spinbox.md │ └── treeview.md │ └── themes │ ├── dark.md │ ├── definitions.md │ ├── index.md │ ├── light.md │ └── themecreator.md ├── docs_scripts ├── tutorial │ ├── button_colors.py │ ├── simple_usage.py │ └── solid_outline_button_styles.py └── widget_styles │ ├── available_colors.py │ ├── button_style.py │ ├── checkbutton_style.py │ ├── combo_style.py │ ├── date_entry.py │ ├── entry_style.py │ ├── floodgauge_style.py │ ├── frame_style.py │ ├── label_style.py │ ├── labelframe_style.py │ ├── menubutton_style.py │ ├── meter_style.py │ ├── notebook_style.py │ ├── panedwindow_style.py │ ├── progressbar_style.py │ ├── radiobutton_style.py │ ├── scale_style.py │ ├── scrollbar_style.py │ ├── separator_style.py │ ├── sizegrip_style.py │ ├── spinbox_style.py │ └── treeview_style.py ├── gallery ├── assets │ ├── backup.png │ ├── icons8_add_book_24px.png │ ├── icons8_add_folder_24px.png │ ├── icons8_broom_32px.png │ ├── icons8_broom_64px.png │ ├── icons8_broom_64px_1.png │ ├── icons8_broom_80px.png │ ├── icons8_cancel_24px.png │ ├── icons8_cancel_24px_1.png │ ├── icons8_double_right_24px.png │ ├── icons8_double_right_24px_1.png │ ├── icons8_double_up_24px.png │ ├── icons8_double_up_24px_1.png │ ├── icons8_file_24px.png │ ├── icons8_folder_24px.png │ ├── icons8_opened_folder_24px.png │ ├── icons8_opened_folder_24px_1.png │ ├── icons8_play_24px.png │ ├── icons8_play_24px_1.png │ ├── icons8_protect_40px.png │ ├── icons8_refresh_24px.png │ ├── icons8_refresh_24px_1.png │ ├── icons8_registry_editor_32px.png │ ├── icons8_registry_editor_64px.png │ ├── icons8_settings_24px.png │ ├── icons8_settings_24px_2.png │ ├── icons8_settings_32px.png │ ├── icons8_settings_64px.png │ ├── icons8_spy_80px.png │ ├── icons8_star_24px.png │ ├── icons8_stop_24px.png │ ├── icons8_stop_24px_1.png │ ├── icons8_trash_can_80px.png │ ├── icons8_wrench_32px.png │ ├── icons8_wrench_64px.png │ ├── magic_mouse │ │ ├── icons8_ask_question_24px.png │ │ ├── icons8_bluetooth_2_16px.png │ │ ├── icons8_buy_26px_1.png │ │ ├── icons8_buy_26px_2.png │ │ ├── icons8_move_16px.png │ │ ├── icons8_question_mark_16px.png │ │ ├── icons8_reset_16px.png │ │ ├── icons8_reset_24px.png │ │ ├── icons8_submit_progress_24px.png │ │ ├── icons8_undo_24px.png │ │ └── magic_mouse.png │ └── mp_background.png ├── back_me_up.py ├── calculator.py ├── collapsing_frame.py ├── data_entry.py ├── equalizer.py ├── everything_bagel.py ├── file_search_engine.py ├── images │ ├── back_me_up.png │ ├── calculator.png │ ├── collapsing_frame.png │ ├── equalizer.png │ ├── file_search_engine.png │ ├── long_running_determinate.png │ ├── long_running_indeterminate.png │ ├── magic_mouse.png │ ├── media_player.png │ ├── pc_cleaner.png │ ├── simple_data_entry_dark.png │ ├── simple_data_entry_light.png │ ├── text_reader.png │ ├── timer_widget_paused.png │ └── timer_widget_started.png ├── long_running_determinate.py ├── long_running_indeterminate.py ├── magic_mouse.py ├── media_player.py ├── pc_cleaner.py ├── screenshot.py ├── stopwatch.py └── text_reader.py ├── mkdocs.yml ├── pyproject.toml ├── requirements.txt ├── setup_project.bat ├── src ├── ttkbootstrap │ ├── __init__.py │ ├── __main__.py │ ├── colorutils.py │ ├── constants.py │ ├── dialogs │ │ ├── __init__.py │ │ ├── colorchooser.py │ │ ├── colordropper.py │ │ └── dialogs.py │ ├── icons.py │ ├── localization │ │ ├── README.md │ │ ├── __init__.py │ │ ├── msgcat.py │ │ └── msgs.py │ ├── publisher.py │ ├── scrolled.py │ ├── style.py │ ├── tableview.py │ ├── themes │ │ ├── __init__.py │ │ ├── standard.py │ │ └── user.py │ ├── toast.py │ ├── tooltip.py │ ├── utility.py │ ├── validation.py │ ├── widgets.py │ └── window.py └── ttkcreator │ ├── __init__.py │ └── __main__.py └── tests ├── features ├── change_bootstyle_with_configure.py ├── change_bootstyle_with_setitem.py ├── change_theme_on_legacy_widgets.py ├── get_bootstyle_value_configure.py ├── get_bootstyle_value_with_getitem.py ├── legacy_widgets.py ├── start_with_style_method.py └── using_config_with_meter.py ├── localization └── test_localization.py ├── widget_styles ├── test_button.py ├── test_checkbutton.py ├── test_combobox.py ├── test_date_button.py ├── test_date_entry.py ├── test_entry.py ├── test_floodgauge.py ├── test_frame.py ├── test_label.py ├── test_labelframe.py ├── test_menu.py ├── test_menubutton.py ├── test_meter.py ├── test_notebook.py ├── test_optionmenu.py ├── test_panedwindow.py ├── test_progressbar.py ├── test_radiobutton.py ├── test_scale.py ├── test_scrollbar.py ├── test_separator.py ├── test_sizegrip.py ├── test_spinbox.py ├── test_text.py ├── test_toplevel.py └── test_treeview.py └── widgets ├── Sample1000.csv ├── colorchooser.py ├── date_entry_widget.py ├── datepicker_dialog.py ├── datepicker_dialog2.py ├── dialogs.py ├── querybox.py ├── scrolled_widgets.py ├── tableview.py └── tooltip.py /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: BUG report 2 | description: Create a report to help us improve 3 | title: "enter title of bug here" 4 | labels: ["bug"] 5 | 6 | body: 7 | - type: textarea 8 | id: desc 9 | attributes: 10 | label: "Desktop (please complete the following information):" 11 | description: | 12 | ttkbootstrap Version [e.g. 1.6.2] 13 | OS: [e.g. Linux] 14 | validations: 15 | required: true 16 | 17 | - type: textarea 18 | id: des 19 | attributes: 20 | label: Describe the bug 21 | description: | 22 | A clear and concise description of what the bug is. 23 | validations: 24 | required: true 25 | 26 | - type: textarea 27 | id: repproduce 28 | attributes: 29 | label: To Reproduce 30 | description: | 31 | Steps to reproduce the behavior: 32 | 1. Go to '...' 33 | 2. Click on '....' 34 | 3. Scroll down to '....' 35 | 4. See error 36 | validations: 37 | required: false 38 | 39 | - type: textarea 40 | id: excepted 41 | attributes: 42 | label: Expected behavior 43 | description: | 44 | A clear and concise description of what you expected to happen. 45 | validations: 46 | required: false 47 | 48 | - type: textarea 49 | id: screenshots 50 | attributes: 51 | label: Screenshots 52 | description: | 53 | If applicable, add screenshots to help explain your problem. 54 | validations: 55 | required: false 56 | 57 | - type: textarea 58 | id: extra 59 | attributes: 60 | label: Additional context 61 | description: | 62 | Add any other context about the problem here. 63 | validations: 64 | required: false 65 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Questions 4 | url: https://github.com/israel-dryer/ttkbootstrap/discussions/new 5 | about: "Ask a question in the discussion forum" 6 | - name: Documentation 7 | url: https://ttkbootstrap.readthedocs.io/en/latest/ 8 | about: "ttkbootstrap's documentation" 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Suggest an idea for this project 3 | title: "enter title of enhancement here" 4 | labels: ["enhancement"] 5 | assignees: israel-dryer 6 | 7 | body: 8 | - type: textarea 9 | id: what 10 | attributes: 11 | label: Is your feature request related to a problem? Please describe. 12 | description: | 13 | "A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]" 14 | validations: 15 | required: true 16 | 17 | - type: textarea 18 | id: extra 19 | attributes: 20 | label: "Describe the solution you'd like" 21 | description: | 22 | A clear and concise description of what you want to happen. 23 | validations: 24 | required: true 25 | 26 | - type: textarea 27 | id: want 28 | attributes: 29 | label: "Describe alternatives you've considered" 30 | description: | 31 | "A clear and concise description of any alternative solutions or features you've considered." 32 | validations: 33 | required: true 34 | 35 | - type: textarea 36 | id: add 37 | attributes: 38 | label: "Additional context" 39 | description: | 40 | "Add any other context or screenshots about the feature request here." 41 | validations: 42 | required: false 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | venv 2 | .idea 3 | build 4 | dist 5 | *.egg-info 6 | *.mp4 7 | *_build 8 | *_static 9 | .vscode 10 | __pycache__ 11 | testing_notes.txt 12 | docsenv 13 | errors 14 | development/archived 15 | development/issues 16 | testenv 17 | pyvenv 18 | identifier.sqlite 19 | tests/dialog.py 20 | tests/themes.json 21 | /tests/temp/ 22 | /tests/issues/ 23 | /.pypirc 24 | publish.bat 25 | /issues/ 26 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yaml 2 | version: 2 3 | 4 | build: 5 | os: ubuntu-20.04 6 | tools: 7 | python: "3.9" 8 | 9 | python: 10 | install: 11 | - method: pip 12 | path: . 13 | - requirements: docs/requirements.txt 14 | 15 | mkdocs: 16 | configuration: mkdocs.yml 17 | fail_on_warning: false 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Israel Dryer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.md 2 | include README_zh.md 3 | recursive-include src/ttkbootstrap/localization/msgs *.msg 4 | recursive-include src/ttkbootstrap/themes *.json 5 | recursive-include src/ttkbootstrap/assets * 6 | -------------------------------------------------------------------------------- /beginningresult.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/beginningresult.png -------------------------------------------------------------------------------- /build_instructions.txt: -------------------------------------------------------------------------------- 1 | * update version in setup.py 2 | * >> python setup.py sdist 3 | * >> twine upload dist/* (with api token) -------------------------------------------------------------------------------- /cookbook/animated_gif.py: -------------------------------------------------------------------------------- 1 | # https://dribbble.com/shots/1237618--Gif-Spinner 2 | from pathlib import Path 3 | from itertools import cycle 4 | import ttkbootstrap as ttk 5 | from ttkbootstrap.constants import * 6 | from PIL import Image, ImageTk, ImageSequence 7 | 8 | 9 | class AnimatedGif(ttk.Frame): 10 | def __init__(self, master): 11 | super().__init__(master, width=400, height=300) 12 | 13 | # open the GIF and create a cycle iterator 14 | file_path = Path(__file__).parent / "assets/spinners.gif" 15 | with Image.open(file_path) as im: 16 | # create a sequence 17 | sequence = ImageSequence.Iterator(im) 18 | images = [ImageTk.PhotoImage(s) for s in sequence] 19 | self.image_cycle = cycle(images) 20 | 21 | # length of each frame 22 | self.framerate = im.info["duration"] 23 | 24 | self.img_container = ttk.Label(self, image=next(self.image_cycle)) 25 | self.img_container.pack(fill="both", expand="yes") 26 | self.after(self.framerate, self.next_frame) 27 | 28 | def next_frame(self): 29 | """Update the image for each frame""" 30 | self.img_container.configure(image=next(self.image_cycle)) 31 | self.after(self.framerate, self.next_frame) 32 | 33 | 34 | if __name__ == "__main__": 35 | 36 | app = ttk.Window("Animated GIF", themename="superhero") 37 | 38 | gif = AnimatedGif(app) 39 | gif.pack(fill=BOTH, expand=YES) 40 | 41 | app.mainloop() 42 | -------------------------------------------------------------------------------- /cookbook/assets/spinners.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/cookbook/assets/spinners.gif -------------------------------------------------------------------------------- /cookbook/validate_user_input.py: -------------------------------------------------------------------------------- 1 | import ttkbootstrap as ttk 2 | from ttkbootstrap.constants import * 3 | 4 | def validate_number(x) -> bool: 5 | """Validates that the input is a number""" 6 | if x.isdigit(): 7 | return True 8 | elif x == "": 9 | return True 10 | else: 11 | return False 12 | 13 | def validate_alpha(x) -> bool: 14 | """Validates that the input is alpha""" 15 | if x.isdigit(): 16 | return False 17 | elif x == "": 18 | return True 19 | else: 20 | return True 21 | 22 | # create the toplevel window 23 | root = ttk.Window() 24 | frame = ttk.Frame(root, padding=10) 25 | frame.pack(fill=BOTH, expand=YES) 26 | 27 | # register the validation callback 28 | digit_func = root.register(validate_number) 29 | alpha_func = root.register(validate_alpha) 30 | 31 | # validate numeric entry 32 | ttk.Label(frame, text="Enter a number").pack() 33 | num_entry = ttk.Entry(frame, validate="focus", validatecommand=(digit_func, '%P')) 34 | num_entry.pack(padx=10, pady=10, expand=True) 35 | 36 | # validate alpha entry 37 | ttk.Label(frame, text="Enter a letter").pack() 38 | let_entry = ttk.Entry(frame, validate="focus", validatecommand=(alpha_func, '%P')) 39 | let_entry.pack(padx=10, pady=10, expand=True) 40 | 41 | root.mainloop() -------------------------------------------------------------------------------- /development/filedialogs/assets/icons8_desktop_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/development/filedialogs/assets/icons8_desktop_40px.png -------------------------------------------------------------------------------- /development/filedialogs/assets/icons8_documents_folder_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/development/filedialogs/assets/icons8_documents_folder_40px.png -------------------------------------------------------------------------------- /development/filedialogs/assets/icons8_downloads_folder_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/development/filedialogs/assets/icons8_downloads_folder_40px.png -------------------------------------------------------------------------------- /development/filedialogs/assets/icons8_file_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/development/filedialogs/assets/icons8_file_40px.png -------------------------------------------------------------------------------- /development/filedialogs/assets/icons8_folder_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/development/filedialogs/assets/icons8_folder_40px.png -------------------------------------------------------------------------------- /development/filedialogs/assets/icons8_home_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/development/filedialogs/assets/icons8_home_40px.png -------------------------------------------------------------------------------- /development/filedialogs/assets/icons8_movies_folder_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/development/filedialogs/assets/icons8_movies_folder_40px.png -------------------------------------------------------------------------------- /development/filedialogs/assets/icons8_music_folder_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/development/filedialogs/assets/icons8_music_folder_40px.png -------------------------------------------------------------------------------- /development/filedialogs/assets/icons8_pictures_folder_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/development/filedialogs/assets/icons8_pictures_folder_40px.png -------------------------------------------------------------------------------- /development/filedialogs/assets/icons8_user_folder_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/development/filedialogs/assets/icons8_user_folder_40px.png -------------------------------------------------------------------------------- /development/filedialogs/devnotes.txt: -------------------------------------------------------------------------------- 1 | Top activity bar 2 | 3 | back and forward navigation buttons 4 | - keep a record of folders navigated to and iterate through this pathlist 5 | 6 | breadcrumbs widget 7 | - each crumb is a button that takes you to that level 8 | - the crumbs match the current folder 9 | - only the top x crumbs are displayed as they fit on the screen 10 | - lower levels are cut off as they no longer fit on the screen 11 | - these buttons should be predefined to fit the screen size 12 | - the crumb button text and command will be updated when the view changes 13 | - the crumb button will be unpacked if not needed, and packed when needed 14 | - use the link-button style on the crumbs, separated by a '>' symbol 15 | - remove the style padding from the link buttons on these buttons 16 | 17 | Left folder treeview (tree) 18 | - icon + name 19 | - initial depth is 2 levels 20 | - another level is added only when drilled into 21 | - clicking on a folder in this treeview will update the right-folder treeview and the breadcrumbs 22 | 23 | Right folder treeview (headers) 24 | - icon + name 25 | - values (Date modified, Type, Size) 26 | - clicking on a folder in this view will update the breadcrumbs 27 | - add alternating stripes 28 | 29 | File name entry 30 | File type combo 31 | 32 | button box (Open, Cancel) 33 | 34 | Other design options 35 | - Use a paned window between the left treeview and right treeview. 36 | - Use a vertical scrollbar in the left treeview. 37 | - Use a vertical and horizontal scrollbar in the right treeview. 38 | - Set the window as a standard size. 39 | - Add a sizegrip to the button right of the window so that it is resizable 40 | 41 | Other options 42 | - save as dialog 43 | - open dialog 44 | - show only folders (directories) -------------------------------------------------------------------------------- /development/filedialogs/examples/askdirectory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/development/filedialogs/examples/askdirectory.png -------------------------------------------------------------------------------- /development/filedialogs/examples/askopenfile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/development/filedialogs/examples/askopenfile.png -------------------------------------------------------------------------------- /development/filedialogs/examples/linux-current.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/development/filedialogs/examples/linux-current.png -------------------------------------------------------------------------------- /development/filedialogs/examples/windows-11-filedialog-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/development/filedialogs/examples/windows-11-filedialog-2.png -------------------------------------------------------------------------------- /development/filedialogs/examples/windows-11-filedialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/development/filedialogs/examples/windows-11-filedialog.png -------------------------------------------------------------------------------- /development/filedialogs/filebrowser.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | class FileBrowser: 4 | 5 | def __init__(self, parent, initialdir="", initialfile="", mode="openfile", 6 | multipleselection=False, message="", title="Open File", 7 | filetypes=[], okbuttontext="Ok", cancelbuttontext="Cancel", 8 | createfolders=True 9 | ): 10 | ... 11 | 12 | 13 | class Stats: 14 | 15 | ... 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/assets/colors/danger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/colors/danger.png -------------------------------------------------------------------------------- /docs/assets/colors/dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/colors/dark.png -------------------------------------------------------------------------------- /docs/assets/colors/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/colors/info.png -------------------------------------------------------------------------------- /docs/assets/colors/light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/colors/light.png -------------------------------------------------------------------------------- /docs/assets/colors/primary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/colors/primary.png -------------------------------------------------------------------------------- /docs/assets/colors/secondary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/colors/secondary.png -------------------------------------------------------------------------------- /docs/assets/colors/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/colors/success.png -------------------------------------------------------------------------------- /docs/assets/colors/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/colors/warning.png -------------------------------------------------------------------------------- /docs/assets/cookbook/animated-gif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/cookbook/animated-gif.gif -------------------------------------------------------------------------------- /docs/assets/cookbook/code-cooking.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/cookbook/code-cooking.jfif -------------------------------------------------------------------------------- /docs/assets/cookbook/entry-validation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/cookbook/entry-validation.gif -------------------------------------------------------------------------------- /docs/assets/dialogs/color-dropper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/dialogs/color-dropper.png -------------------------------------------------------------------------------- /docs/assets/dialogs/date-picker-dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/dialogs/date-picker-dialog.png -------------------------------------------------------------------------------- /docs/assets/dialogs/messagebox-ok-cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/dialogs/messagebox-ok-cancel.png -------------------------------------------------------------------------------- /docs/assets/dialogs/messagebox-ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/dialogs/messagebox-ok.png -------------------------------------------------------------------------------- /docs/assets/dialogs/messagebox-retry-cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/dialogs/messagebox-retry-cancel.png -------------------------------------------------------------------------------- /docs/assets/dialogs/messagebox-show-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/dialogs/messagebox-show-error.png -------------------------------------------------------------------------------- /docs/assets/dialogs/messagebox-show-info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/dialogs/messagebox-show-info.png -------------------------------------------------------------------------------- /docs/assets/dialogs/messagebox-show-question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/dialogs/messagebox-show-question.png -------------------------------------------------------------------------------- /docs/assets/dialogs/messagebox-show-warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/dialogs/messagebox-show-warning.png -------------------------------------------------------------------------------- /docs/assets/dialogs/messagebox-yes-no-cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/dialogs/messagebox-yes-no-cancel.png -------------------------------------------------------------------------------- /docs/assets/dialogs/messagebox-yes-no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/dialogs/messagebox-yes-no.png -------------------------------------------------------------------------------- /docs/assets/dialogs/querybox-get-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/dialogs/querybox-get-color.png -------------------------------------------------------------------------------- /docs/assets/dialogs/querybox-get-date.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/dialogs/querybox-get-date.png -------------------------------------------------------------------------------- /docs/assets/dialogs/querybox-get-float.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/dialogs/querybox-get-float.png -------------------------------------------------------------------------------- /docs/assets/dialogs/querybox-get-font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/dialogs/querybox-get-font.png -------------------------------------------------------------------------------- /docs/assets/dialogs/querybox-get-integer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/dialogs/querybox-get-integer.png -------------------------------------------------------------------------------- /docs/assets/dialogs/querybox-get-item.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/dialogs/querybox-get-item.png -------------------------------------------------------------------------------- /docs/assets/dialogs/querybox-get-string.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/dialogs/querybox-get-string.png -------------------------------------------------------------------------------- /docs/assets/gallery/back_me_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/gallery/back_me_up.png -------------------------------------------------------------------------------- /docs/assets/gallery/calculator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/gallery/calculator.png -------------------------------------------------------------------------------- /docs/assets/gallery/collapsing_frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/gallery/collapsing_frame.png -------------------------------------------------------------------------------- /docs/assets/gallery/equalizer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/gallery/equalizer.png -------------------------------------------------------------------------------- /docs/assets/gallery/file_search_engine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/gallery/file_search_engine.png -------------------------------------------------------------------------------- /docs/assets/gallery/long-running-determinate.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/gallery/long-running-determinate.gif -------------------------------------------------------------------------------- /docs/assets/gallery/long-running-indeterminate.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/gallery/long-running-indeterminate.gif -------------------------------------------------------------------------------- /docs/assets/gallery/magic_mouse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/gallery/magic_mouse.png -------------------------------------------------------------------------------- /docs/assets/gallery/media_player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/gallery/media_player.png -------------------------------------------------------------------------------- /docs/assets/gallery/pc_cleaner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/gallery/pc_cleaner.png -------------------------------------------------------------------------------- /docs/assets/gallery/simple_data_entry_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/gallery/simple_data_entry_dark.png -------------------------------------------------------------------------------- /docs/assets/gallery/simple_data_entry_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/gallery/simple_data_entry_light.png -------------------------------------------------------------------------------- /docs/assets/gallery/text_reader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/gallery/text_reader.png -------------------------------------------------------------------------------- /docs/assets/gallery/timer_widget_paused.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/gallery/timer_widget_paused.png -------------------------------------------------------------------------------- /docs/assets/gallery/timer_widget_started.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/gallery/timer_widget_started.png -------------------------------------------------------------------------------- /docs/assets/scrolled/scrolledtext.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/scrolled/scrolledtext.gif -------------------------------------------------------------------------------- /docs/assets/themes/cerculean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/cerculean.png -------------------------------------------------------------------------------- /docs/assets/themes/cosmo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/cosmo.png -------------------------------------------------------------------------------- /docs/assets/themes/cyborg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/cyborg.png -------------------------------------------------------------------------------- /docs/assets/themes/darkly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/darkly.png -------------------------------------------------------------------------------- /docs/assets/themes/flatly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/flatly.png -------------------------------------------------------------------------------- /docs/assets/themes/journal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/journal.png -------------------------------------------------------------------------------- /docs/assets/themes/legacy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/legacy.png -------------------------------------------------------------------------------- /docs/assets/themes/legacy_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/legacy_dark.png -------------------------------------------------------------------------------- /docs/assets/themes/legacy_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/legacy_light.png -------------------------------------------------------------------------------- /docs/assets/themes/litera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/litera.png -------------------------------------------------------------------------------- /docs/assets/themes/lumen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/lumen.png -------------------------------------------------------------------------------- /docs/assets/themes/minty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/minty.png -------------------------------------------------------------------------------- /docs/assets/themes/morph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/morph.png -------------------------------------------------------------------------------- /docs/assets/themes/pulse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/pulse.png -------------------------------------------------------------------------------- /docs/assets/themes/sandstone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/sandstone.png -------------------------------------------------------------------------------- /docs/assets/themes/simplex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/simplex.png -------------------------------------------------------------------------------- /docs/assets/themes/solar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/solar.png -------------------------------------------------------------------------------- /docs/assets/themes/superhero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/superhero.png -------------------------------------------------------------------------------- /docs/assets/themes/themes.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/themes.gif -------------------------------------------------------------------------------- /docs/assets/themes/united.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/united.png -------------------------------------------------------------------------------- /docs/assets/themes/vapor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/vapor.png -------------------------------------------------------------------------------- /docs/assets/themes/yeti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/themes/yeti.png -------------------------------------------------------------------------------- /docs/assets/toast/toast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/toast/toast.png -------------------------------------------------------------------------------- /docs/assets/tooltip/tooltip.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/tooltip/tooltip.gif -------------------------------------------------------------------------------- /docs/assets/ttkcreator/creator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/ttkcreator/creator.png -------------------------------------------------------------------------------- /docs/assets/tutorial/button-colors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/tutorial/button-colors.png -------------------------------------------------------------------------------- /docs/assets/tutorial/simple-usage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/tutorial/simple-usage.png -------------------------------------------------------------------------------- /docs/assets/tutorial/solid-outline-button-styles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/tutorial/solid-outline-button-styles.png -------------------------------------------------------------------------------- /docs/assets/widget-styles/checkbuttons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/checkbuttons.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/checkbuttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/checkbuttons.png -------------------------------------------------------------------------------- /docs/assets/widget-styles/combos.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/combos.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/date-entries.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/date-entries.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/date-picker-popup.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/date-picker-popup.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/entries.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/entries.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/floodgauge.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/floodgauge.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/frame.png -------------------------------------------------------------------------------- /docs/assets/widget-styles/inverse-label.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/inverse-label.png -------------------------------------------------------------------------------- /docs/assets/widget-styles/label.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/label.png -------------------------------------------------------------------------------- /docs/assets/widget-styles/labelframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/labelframe.png -------------------------------------------------------------------------------- /docs/assets/widget-styles/link-buttons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/link-buttons.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/menubutton.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/menubutton.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/meter-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/meter-2.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/meter.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/meter.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/meter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/meter.png -------------------------------------------------------------------------------- /docs/assets/widget-styles/notebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/notebook.png -------------------------------------------------------------------------------- /docs/assets/widget-styles/outline-buttons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/outline-buttons.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/outline-menubutton.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/outline-menubutton.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/outline-radio-toolbutton.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/outline-radio-toolbutton.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/outline-toolbuttons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/outline-toolbuttons.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/panedwindow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/panedwindow.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/radio-toolbutton.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/radio-toolbutton.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/radiobutton.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/radiobutton.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/radiobuttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/radiobuttons.png -------------------------------------------------------------------------------- /docs/assets/widget-styles/round-scrollbars.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/round-scrollbars.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/round-scrollbars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/round-scrollbars.png -------------------------------------------------------------------------------- /docs/assets/widget-styles/round-toggles.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/round-toggles.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/scale.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/scale.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/separator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/separator.png -------------------------------------------------------------------------------- /docs/assets/widget-styles/sizegrip.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/sizegrip.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/solid-buttons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/solid-buttons.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/solid-progressbar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/solid-progressbar.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/solid-toolbuttons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/solid-toolbuttons.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/spinbox.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/spinbox.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/square-scrollbars.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/square-scrollbars.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/square-scrollbars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/square-scrollbars.png -------------------------------------------------------------------------------- /docs/assets/widget-styles/square-toggles.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/square-toggles.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/striped-progressbar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/striped-progressbar.gif -------------------------------------------------------------------------------- /docs/assets/widget-styles/treeview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widget-styles/treeview.gif -------------------------------------------------------------------------------- /docs/assets/widgets/date-entry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widgets/date-entry.png -------------------------------------------------------------------------------- /docs/assets/widgets/floodgauge.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widgets/floodgauge.gif -------------------------------------------------------------------------------- /docs/assets/widgets/meter.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widgets/meter.gif -------------------------------------------------------------------------------- /docs/assets/widgets/tableview-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widgets/tableview-1.png -------------------------------------------------------------------------------- /docs/assets/widgets/tableview-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widgets/tableview-2.png -------------------------------------------------------------------------------- /docs/assets/widgets/tableview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/widgets/tableview.gif -------------------------------------------------------------------------------- /docs/assets/window/window-toplevel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/assets/window/window-toplevel.png -------------------------------------------------------------------------------- /docs/en/api/colorutils.md: -------------------------------------------------------------------------------- 1 | # colorutils module 2 | 3 | ::: ttkbootstrap.colorutils 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | -------------------------------------------------------------------------------- /docs/en/api/dialogs/colorchooser.md: -------------------------------------------------------------------------------- 1 | # ColorChooserDialog 2 | 3 | ::: ttkbootstrap.dialogs.colorchooser.ColorChooserDialog 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | -------------------------------------------------------------------------------- /docs/en/api/dialogs/colordropper.md: -------------------------------------------------------------------------------- 1 | # ColorDropperDialog 2 | 3 | ::: ttkbootstrap.dialogs.colordropper.ColorDropperDialog 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | -------------------------------------------------------------------------------- /docs/en/api/dialogs/datepickerdialog.md: -------------------------------------------------------------------------------- 1 | # DatePickerDialog 2 | 3 | ::: ttkbootstrap.dialogs.DatePickerDialog 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | -------------------------------------------------------------------------------- /docs/en/api/dialogs/dialog.md: -------------------------------------------------------------------------------- 1 | # Dialog 2 | 3 | ::: ttkbootstrap.dialogs.Dialog 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true -------------------------------------------------------------------------------- /docs/en/api/dialogs/fontdialog.md: -------------------------------------------------------------------------------- 1 | ## FontDialog 2 | 3 | ::: ttkbootstrap.dialogs.FontDialog 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | -------------------------------------------------------------------------------- /docs/en/api/dialogs/messagebox.md: -------------------------------------------------------------------------------- 1 | # Messagebox 2 | 3 | ::: ttkbootstrap.dialogs.Messagebox 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true -------------------------------------------------------------------------------- /docs/en/api/dialogs/messagedialog.md: -------------------------------------------------------------------------------- 1 | # MessageDialog 2 | 3 | ::: ttkbootstrap.dialogs.MessageDialog 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true -------------------------------------------------------------------------------- /docs/en/api/dialogs/querybox.md: -------------------------------------------------------------------------------- 1 | # Querybox 2 | 3 | ::: ttkbootstrap.dialogs.Querybox 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true -------------------------------------------------------------------------------- /docs/en/api/dialogs/querydialog.md: -------------------------------------------------------------------------------- 1 | # QueryDialog 2 | 3 | ::: ttkbootstrap.dialogs.QueryDialog 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true -------------------------------------------------------------------------------- /docs/en/api/icons/emoji.md: -------------------------------------------------------------------------------- 1 | # Emoji 2 | 3 | ::: ttkbootstrap.icons.Emoji 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | 10 | -------------------------------------------------------------------------------- /docs/en/api/icons/icon.md: -------------------------------------------------------------------------------- 1 | # Icon 2 | 3 | ::: ttkbootstrap.icons.Icon 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | 10 | -------------------------------------------------------------------------------- /docs/en/api/localization.md: -------------------------------------------------------------------------------- 1 | # localization module 2 | 3 | ::: ttkbootstrap.localization 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | -------------------------------------------------------------------------------- /docs/en/api/scrolled/scrolledframe.md: -------------------------------------------------------------------------------- 1 | # ScrolledFrame 2 | 3 | ::: ttkbootstrap.scrolled.ScrolledFrame 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | 10 | -------------------------------------------------------------------------------- /docs/en/api/scrolled/scrolledtext.md: -------------------------------------------------------------------------------- 1 | # ScrolledText 2 | 3 | ::: ttkbootstrap.scrolled.ScrolledText 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | -------------------------------------------------------------------------------- /docs/en/api/style/bootstyle.md: -------------------------------------------------------------------------------- 1 | # Bootstyle 2 | 3 | ::: ttkbootstrap.style.Bootstyle 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | -------------------------------------------------------------------------------- /docs/en/api/style/colors.md: -------------------------------------------------------------------------------- 1 | # Colors 2 | 3 | ::: ttkbootstrap.style.Colors 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | -------------------------------------------------------------------------------- /docs/en/api/style/style.md: -------------------------------------------------------------------------------- 1 | # Style 2 | 3 | ::: ttkbootstrap.style.Style 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | -------------------------------------------------------------------------------- /docs/en/api/style/stylebuildertk.md: -------------------------------------------------------------------------------- 1 | # StyleBuilderTK 2 | 3 | ::: ttkbootstrap.style.StyleBuilderTK 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | -------------------------------------------------------------------------------- /docs/en/api/style/stylebuilderttk.md: -------------------------------------------------------------------------------- 1 | # StyleBuilderTTK 2 | 3 | ::: ttkbootstrap.style.StyleBuilderTTK 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | -------------------------------------------------------------------------------- /docs/en/api/style/themedefinition.md: -------------------------------------------------------------------------------- 1 | # ThemeDefinition 2 | 3 | ::: ttkbootstrap.style.ThemeDefinition 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | -------------------------------------------------------------------------------- /docs/en/api/tableview/tablecolumn.md: -------------------------------------------------------------------------------- 1 | # TableColumn 2 | 3 | ::: ttkbootstrap.tableview.TableColumn 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | -------------------------------------------------------------------------------- /docs/en/api/tableview/tablerow.md: -------------------------------------------------------------------------------- 1 | # TableRow 2 | 3 | ::: ttkbootstrap.tableview.TableRow 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | 10 | -------------------------------------------------------------------------------- /docs/en/api/tableview/tableview.md: -------------------------------------------------------------------------------- 1 | # Tableview 2 | 3 | ::: ttkbootstrap.tableview.Tableview 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true -------------------------------------------------------------------------------- /docs/en/api/toast.md: -------------------------------------------------------------------------------- 1 | # toast module 2 | 3 | ::: ttkbootstrap.toast 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | -------------------------------------------------------------------------------- /docs/en/api/tooltip.md: -------------------------------------------------------------------------------- 1 | # tooltip module 2 | 3 | ::: ttkbootstrap.tooltip 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | -------------------------------------------------------------------------------- /docs/en/api/utility.md: -------------------------------------------------------------------------------- 1 | # utility module 2 | 3 | ::: ttkbootstrap.utility 4 | -------------------------------------------------------------------------------- /docs/en/api/validation.md: -------------------------------------------------------------------------------- 1 | # validation module 2 | 3 | ::: ttkbootstrap.validation 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | -------------------------------------------------------------------------------- /docs/en/api/widgets/dateentry.md: -------------------------------------------------------------------------------- 1 | # DateEntry 2 | 3 | ::: ttkbootstrap.widgets.DateEntry 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | 10 | -------------------------------------------------------------------------------- /docs/en/api/widgets/floodgauge.md: -------------------------------------------------------------------------------- 1 | # Floodgauge 2 | 3 | ::: ttkbootstrap.widgets.Floodgauge 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | -------------------------------------------------------------------------------- /docs/en/api/widgets/meter.md: -------------------------------------------------------------------------------- 1 | # Meter 2 | 3 | ::: ttkbootstrap.widgets.Meter 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | -------------------------------------------------------------------------------- /docs/en/api/window/toplevel.md: -------------------------------------------------------------------------------- 1 | # Toplevel 2 | 3 | ::: ttkbootstrap.window.Toplevel 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | -------------------------------------------------------------------------------- /docs/en/api/window/window.md: -------------------------------------------------------------------------------- 1 | # Window 2 | 3 | ::: ttkbootstrap.window.Window 4 | selection: 5 | filters: ["!^_", "^__init__"] 6 | rendering: 7 | heading_level: 2 8 | show_root_heading: true 9 | -------------------------------------------------------------------------------- /docs/en/cookbook/gif-animation.md: -------------------------------------------------------------------------------- 1 | # Gif Animation 2 | 3 | This example demonstrates how to animate a gif in the window while 4 | keeping the window responsive to user input by scheduling updates 5 | to the label image from a list of images. 6 | 7 | ![gif animation](../assets/cookbook/animated-gif.gif) 8 | 9 | ```python 10 | # https://dribbble.com/shots/1237618--Gif-Spinner 11 | from pathlib import Path 12 | from itertools import cycle 13 | import ttkbootstrap as ttk 14 | from ttkbootstrap.constants import * 15 | from PIL import Image, ImageTk, ImageSequence 16 | 17 | 18 | class AnimatedGif(ttk.Frame): 19 | def __init__(self, master): 20 | super().__init__(master, width=400, height=300) 21 | 22 | # open the GIF and create a cycle iterator 23 | file_path = Path(__file__).parent / "assets/spinners.gif" 24 | with Image.open(file_path) as im: 25 | # create a sequence 26 | sequence = ImageSequence.Iterator(im) 27 | images = [ImageTk.PhotoImage(s) for s in sequence] 28 | self.image_cycle = cycle(images) 29 | 30 | # length of each frame 31 | self.framerate = im.info["duration"] 32 | 33 | self.img_container = ttk.Label(self, image=next(self.image_cycle)) 34 | self.img_container.pack(fill="both", expand="yes") 35 | self.after(self.framerate, self.next_frame) 36 | 37 | def next_frame(self): 38 | """Update the image for each frame""" 39 | self.img_container.configure(image=next(self.image_cycle)) 40 | self.after(self.framerate, self.next_frame) 41 | 42 | 43 | if __name__ == "__main__": 44 | 45 | app = ttk.Window("Animated GIF", themename="superhero") 46 | 47 | gif = AnimatedGif(app) 48 | gif.pack(fill=BOTH, expand=YES) 49 | 50 | app.mainloop() 51 | ``` -------------------------------------------------------------------------------- /docs/en/cookbook/index.md: -------------------------------------------------------------------------------- 1 | # Cookbook 2 | 3 | A growing collection of recipes that demonstrate how to do particular things in ttkbootstrap. 4 |

5 | 6 | ![recipes](../assets/cookbook/code-cooking.jfif) -------------------------------------------------------------------------------- /docs/en/gallery/index.md: -------------------------------------------------------------------------------- 1 | # Gallery 2 | 3 | In this section you will find a growing list of ttkbootstrap projects meant to 4 | provide inspiration or direction when creating your own applications. These are 5 | meant to demonstrate design and are not necessarily fully functional applications. 6 | 7 | ![file search image example](../assets/gallery/back_me_up.png) -------------------------------------------------------------------------------- /docs/en/gettingstarted/installation.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | Easy peezy. 4 | 5 | !!! note "PyPI Installation" 6 | ```bash 7 | python -m pip install ttkbootstrap 8 | ``` 9 | 10 | Lemon squeezy. 11 | 12 | !!! note "Github Installation" 13 | ```bash 14 | python -m pip install git+https://github.com/israel-dryer/ttkbootstrap 15 | ``` 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/en/gettingstarted/legacy.md: -------------------------------------------------------------------------------- 1 | # Legacy support 2 | 3 | While `tkinter` widgets are not the focus of the library, I applied some default 4 | styling for each theme to legacy widgets so that they didn't stick out. A large 5 | reason for this is that several `ttk` widgets use `tkinter` widget components 6 | under the hood. So it was necessary to style these as well so that, for example, 7 | the popdown list in the **Combobox**, or the **Menu** in the menubutton are 8 | styled appropriate. 9 | 10 | Below are examples of a light and dark themes using legacy `tkinter` widgets. 11 | 12 | ![legacy light theme](../assets/themes/legacy_light.png) 13 | 14 | ![legacy dark theme](../assets/themes/legacy_dark.png) -------------------------------------------------------------------------------- /docs/en/license.md: -------------------------------------------------------------------------------- 1 | # License 2 | 3 | **MIT License** 4 | 5 | Copyright © 2021-2025 Israel Dryer 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /docs/en/styleguide/combobox.md: -------------------------------------------------------------------------------- 1 | # Combobox 2 | 3 | This widget style features a input box with a styled border and arrow. The 4 | border color is muted by default and changes to **primary** or the 5 | [selected color](index.md#colors) on _hover_. The border increases in thickness on 6 | _focus_. The arrow color changes to the default or [selected color](index.md#colors) 7 | on _hover_ or on _focus_. 8 | 9 | This widget also supports special styles for [disabled state](#disabled-combobox), 10 | [readonly state](#readonly-combobox), and [invalid state](#invalid-combobox). 11 | 12 | ![combobox](../assets/widget-styles/combos.gif) 13 | 14 | ```python 15 | # default combobox style 16 | Combobox() 17 | 18 | # danger colored combobox style 19 | Combobox(bootstyle="danger") 20 | ``` 21 | 22 | ## Other combobox styles 23 | 24 | #### Disabled combobox 25 | 26 | This style _cannot be applied via keywords_; it is configured through widget 27 | settings. 28 | 29 | ```python 30 | # create the combobox in a disabled state 31 | Combobox(state="disabled") 32 | 33 | # disable a combobox after creation 34 | cb = Combobox() 35 | cb.configure(state="disabled") 36 | ``` 37 | 38 | #### Readonly combobox 39 | 40 | This style _cannot be applied via keywords_; it is configured through widget 41 | settings. 42 | 43 | 44 | ```python 45 | # create the combobox in a readonly state 46 | Combobox(state="readonly") 47 | 48 | # set the combobox readonly state after creation 49 | cb = Combobox() 50 | cb.configure(state="readonly") 51 | ``` 52 | 53 | #### Invalid combobox 54 | 55 | This style _cannot be applied via keywords_, but rather is the result of a 56 | validation process implemented on the widget. In the **Cookbook** you will find 57 | an example of [how to apply validation](../cookbook/validate-user-input.md) to an 58 | `Entry` based widget. 59 | -------------------------------------------------------------------------------- /docs/en/styleguide/dateentry.md: -------------------------------------------------------------------------------- 1 | # DateEntry 2 | 3 | This widget is composed of two widgets, the **Entry** widget and the **Button** 4 | widget. The **Entry** component behaves identically to the 5 | [default entry widget](entry.md), and the calendar button behaves as the 6 | [default solid button](button.md). 7 | 8 | The [DatePickerPopup](datepickerpopup.md) is invoked when the calendar 9 | button is pressed. The default color applied to the popup is **primary**. 10 | 11 | This widget also supports special styles for [disabled state](#disabled-date-entry), 12 | [readonly state](#readonly-date-entry), and [invalid state](#invalid-date-entry). 13 | 14 | ![date entries](../assets/widget-styles/date-entries.gif) 15 | 16 | ```python 17 | # default date entry 18 | DateEntry() 19 | 20 | # success colored date entry 21 | DateEntry(bootstyle="success") 22 | ``` 23 | 24 | ## Other date entry styles 25 | 26 | #### Disabled date entry 27 | 28 | This style _cannot be applied via keywords_; it is configured through widget 29 | settings. 30 | 31 | ```python 32 | # create the date entry in a disabled state 33 | DateEntry(state="disabled") 34 | 35 | # disable a date entry after creation 36 | d = DateEntry() 37 | d.configure(state="disabled") 38 | ``` 39 | 40 | #### Readonly date entry 41 | 42 | This style _cannot be applied via keywords_; it is configured through widget 43 | settings. 44 | 45 | ```python 46 | # create the date entry in a readonly state 47 | DateEntry(state="readonly") 48 | 49 | # set the date entry readonly state after creation 50 | d = DateEntry() 51 | d.configure(state="readonly") 52 | ``` 53 | 54 | #### Invalid date entry 55 | 56 | This style _cannot be applied via keywords_, but rather is the result of a 57 | validation process implemented on the widget. In the **Cookbook** you will find 58 | an example of [how to apply validation](../cookbook/validate-user-input.md) to an 59 | `Entry` based widget. -------------------------------------------------------------------------------- /docs/en/styleguide/datepickerpopup.md: -------------------------------------------------------------------------------- 1 | # DatePickerDialog 2 | 3 | This widget style encompasses a collection of button and label widgets. The 4 | _header_ and _active date_ are **primary** colored (default) or the 5 | [selected color](index.md#colors). The _weekdays header_ and _current date_ use the 6 | `secondary` color. 7 | 8 | Check out the [api documentation](../api/dialogs/datepickerdialog.md) for 9 | more information on how to use this widget. 10 | 11 | ![date picker](../assets/widget-styles/date-picker-popup.gif) 12 | 13 | ```python 14 | # default popup 15 | DatePickerDialog() 16 | 17 | # warning colored popup 18 | DatePickerDialog(bootstyle="warning") 19 | ``` 20 | -------------------------------------------------------------------------------- /docs/en/styleguide/entry.md: -------------------------------------------------------------------------------- 1 | # Entry 2 | 3 | This widget style features a input box with a styled border. The border color 4 | is muted by default and changes to **primary** or the 5 | [selected color](index.md#colors) on _hover_. The border increases in thickness 6 | on _focus_. 7 | 8 | This widget also supports special styles for [disabled state](#disabled-entry), 9 | [readonly state](#readonly-entry), and [invalid state](#invalid-entry). 10 | 11 | ![entry](../assets/widget-styles/entries.gif) 12 | 13 | ```python 14 | # default entry style 15 | Entry() 16 | 17 | # danger colored entry style 18 | Entry(bootstyle="danger") 19 | ``` 20 | 21 | ## Other entry styles 22 | 23 | #### Disabled entry 24 | 25 | This style _cannot be applied via keywords_; it is configured through widget 26 | settings. 27 | 28 | ```python 29 | # create the widget in a disabled state 30 | Entry(state="disabled") 31 | 32 | # disable the widget after creation 33 | e = Entry() 34 | e.configure(state="disabled") 35 | ``` 36 | 37 | #### Readonly entry 38 | 39 | This style _cannot be applied via keywords_; it is configured through widget 40 | settings. 41 | 42 | ```python 43 | # create the widget in a readonly state 44 | Entry(state="readonly") 45 | 46 | # set the widget readonly state after creation 47 | e = Entry() 48 | e.configure(state="readonly") 49 | ``` 50 | 51 | #### Invalid entry 52 | 53 | This style _cannot be applied via keywords_, but rather is the result of a 54 | validation process implemented on the widget. In the **Cookbook** you will find 55 | an example of [how to apply validation](../cookbook/validate-user-input.md) to an 56 | `Entry` based widget. 57 | -------------------------------------------------------------------------------- /docs/en/styleguide/floodgauge.md: -------------------------------------------------------------------------------- 1 | # Floodgauge 2 | 3 | A progressbar with an optional display text. 4 | 5 | This widget style features an indicator that is **primary** colored (default) 6 | or the [selected color](index.md#colors). The trough color is a desaturated 7 | variation of the indicator color. 8 | 9 | ![floodguage](../assets/widget-styles/floodgauge.gif) 10 | 11 | ```python 12 | # default floodgauge style 13 | Floodgauge() 14 | 15 | # success colored floodguage style 16 | Floodgauge(bootstyle="success") 17 | ``` -------------------------------------------------------------------------------- /docs/en/styleguide/frame.md: -------------------------------------------------------------------------------- 1 | # Frame 2 | 3 | This widget style features a default background color that matches the theme 4 | background by default, or the [selected color](index.md#colors). 5 | 6 | ![frame](../assets/widget-styles/frame.png) 7 | 8 | ```python 9 | # default frame style 10 | Frame() 11 | 12 | # info colored frame style 13 | Frame(bootstyle="info") 14 | ``` -------------------------------------------------------------------------------- /docs/en/styleguide/label.md: -------------------------------------------------------------------------------- 1 | # Label 2 | 3 | This widget features two style types that can both be customized using any of 4 | the [available colors](index.md#colors). 5 | 6 | ## Default label 7 | 8 | The default style features a default theme defined foreground and background 9 | color. The foreground can be changed using a [selected color](index.md#colors). 10 | 11 | ![normal label](../assets/widget-styles/label.png) 12 | 13 | ```python 14 | # default label style 15 | Label() 16 | 17 | # danger colored label style 18 | Label(bootstyle="danger") 19 | ``` 20 | 21 | ## Inverse label 22 | 23 | This style features a label with colors that are inverted versions of the default 24 | colors. The [selected color](index.md#colors) changes the background color instead of the 25 | foreground color. 26 | 27 | This is especially useful when you are adding labels to a styled `Frame`, or you 28 | want to add a [label heading](../gallery/mediaplayer.md) that does not have a default 29 | background color. 30 | 31 | ![inverse label](../assets/widget-styles/inverse-label.png) 32 | 33 | ```python 34 | # default inverse label style 35 | Label(bootstyle="inverse") 36 | 37 | # danger colored inverse label style 38 | Label(bootstyle="inverse-danger") 39 | ``` 40 | -------------------------------------------------------------------------------- /docs/en/styleguide/labelframe.md: -------------------------------------------------------------------------------- 1 | # Labelframe 2 | 3 | This widget style features a styled border and label. By default, the border 4 | and label use theme defined defaults for border and foreground colors. When a 5 | [selected color](index.md#colors) is used, both the label text and the border use this 6 | color. 7 | 8 | ![labelframe](../assets/widget-styles/labelframe.png) 9 | 10 | ```python 11 | # default labelframe style 12 | Labelframe() 13 | 14 | # info colored labelframe style 15 | Labelframe(bootstyle="info") 16 | ``` 17 | -------------------------------------------------------------------------------- /docs/en/styleguide/legacywidgets.md: -------------------------------------------------------------------------------- 1 | # Legacy widgets 2 | 3 | ttkbootstrap applies a default style to legacy tkinter widgets so that they do 4 | not look out-of-place when used with themed ttk widgets. The `Text` and `Canvas` 5 | widgets are commonly used with themed `ttk` widgets for example. 6 | 7 | ## Themed legacy widgets 8 | 9 | To ensure the styles are updated when the theme is changed, each legacy widget 10 | is registered with the `Publisher` which sends an update message to each legacy 11 | widget when the theme is changed in order to initiate a theme configuration on 12 | the widget. 13 | 14 | ## Customizing legacy widgets 15 | While the theming functionality is appropriate in most cases, it also prevents 16 | the user from making custom changes to the widget. However, in version 1.2 an 17 | `autostyle` parameter was added to all legacy widgets. By default, `autostyle` 18 | is implicitly **True**. This means, that ttkbootstrap will handle all of the 19 | styling on legacy widgets. However, if you set the `autostyle` parameter to 20 | **False**, the widget styling will be delegated to the user. This will enable 21 | you to make custom changes to legacy widgets. 22 | 23 | !!! warning "Turning off autostyle should be used with caution" 24 | If you turn off autostyle on a widget, it will no longer receive theme 25 | change updates; no styling will be applied by default, including fonts, 26 | relief, etc... 27 | -------------------------------------------------------------------------------- /docs/en/styleguide/menubutton.md: -------------------------------------------------------------------------------- 1 | # Menubutton 2 | 3 | This widget features a styled button with an arrow that can be styled using 4 | any of the [available colors](index.md#colors). 5 | 6 | This widget supports a special style for [disabled state](#disabled-menubutton). 7 | 8 | ## Solid (default) 9 | 10 | This widget style features a solid background color that lightens on _hover_ 11 | and darkens when _pressed_. 12 | 13 | ![solid menubutton](../assets/widget-styles/menubutton.gif) 14 | 15 | ```python 16 | # default solid menubutton style 17 | Menubutton() 18 | 19 | # success colored solid menubutton style 20 | Menubutton(bootstyle="success") 21 | ``` 22 | 23 | ## Outline 24 | 25 | This style features a thin styled outline. When _pressed_ or on _hover_, the 26 | button changes to a solid color similar to the default menubutton style. 27 | 28 | ![outline menubutton](../assets/widget-styles/outline-menubutton.gif) 29 | 30 | ```python 31 | # default outline menubutton style 32 | Menubutton(bootstyle="outline") 33 | 34 | # info colored outline menubutton style 35 | Menubutton(bootstyle="info-outline") 36 | ``` 37 | 38 | ## Other menubutton styles 39 | 40 | #### Disabled menubutton 41 | This style _cannot be applied via keywords_; it is configured through widget 42 | settings. 43 | 44 | ```python 45 | # create the menubutton in a disabled state 46 | Menubutton(state="disabled") 47 | 48 | # disable a menubutton after creation 49 | b = Menubutton() 50 | b.configure(state="disabled") 51 | ``` 52 | -------------------------------------------------------------------------------- /docs/en/styleguide/meter.md: -------------------------------------------------------------------------------- 1 | # Meter 2 | 3 | This widget style encompasses a collection of components. The indicator and 4 | main label are **primary** by default, or the [selected color](index.md#colors). 5 | If provided, the subtext is **secondary** for light themes and **light** for 6 | dark themes. However, all of these elements can be configured using the 7 | [available colors](index.md#colors). 8 | 9 | ![meter colors](../assets/widget-styles/meter.gif) 10 | 11 | The meter widget is highly configurable, and can produce a diversity of 12 | interesting meters by mixing colors and other widget specific settings. 13 | 14 | ![meter](../assets/widget-styles/meter.png) 15 | 16 | ```python 17 | # default meter style 18 | Meter() 19 | 20 | # info colored meter 21 | Meter(bootstyle="info") 22 | 23 | # danger color subtext 24 | Meter(subtextstyle="danger") 25 | 26 | # success colored meter with warning colored subtext 27 | Meter(bootstyle="success", subtextstyle="warning") 28 | ``` -------------------------------------------------------------------------------- /docs/en/styleguide/notebook.md: -------------------------------------------------------------------------------- 1 | # Notebook 2 | 3 | This widget style features minimal styling by default. However, you can add some 4 | flair to the _inactive_ tab by using any of the [available colors](index.md#colors) as 5 | demonstrated in the exhibit below. 6 | 7 | ![notebook](../assets/widget-styles/notebook.png) 8 | 9 | ```python 10 | # default notebook style 11 | Notebook() 12 | 13 | # info colored notebook style - inactive tab color 14 | Notebook(bootstyle="info") 15 | ``` 16 | -------------------------------------------------------------------------------- /docs/en/styleguide/panedwindow.md: -------------------------------------------------------------------------------- 1 | # Panedwindow 2 | 3 | This widget style features containers with the themed defined background color 4 | separated by a styled sash that is grayish by default or of the 5 | [selected color](index.md#colors). 6 | 7 | ![paned widow](../assets/widget-styles/panedwindow.gif) 8 | 9 | ```python 10 | # default panedwindow style 11 | Panedwindow() 12 | 13 | # info colored panedwindow style 14 | Panedwindow(bootstyle="info") 15 | ``` -------------------------------------------------------------------------------- /docs/en/styleguide/progressbar.md: -------------------------------------------------------------------------------- 1 | # Progressbar 2 | 3 | This widget features a few style types that have **primary** colored indicator 4 | bars by default, but can by styled using any of the 5 | [available colors](index.md#colors). 6 | 7 | ## Solid (default) 8 | 9 | The default widget style features a solid color indicator bar. 10 | 11 | ![solid progressbar](../assets/widget-styles/solid-progressbar.gif) 12 | 13 | ```python 14 | # default solid progressbar style 15 | Progressbar() 16 | 17 | # success colored solid progressbar style 18 | Progressbar(bootstyle="success") 19 | ``` 20 | 21 | 22 | ## Striped 23 | 24 | This widget style features a striped indicator bar that uses the default or 25 | [selected color](index.md#colors) for the main color, and a desaturated version 26 | of this color for the alternating stripe. 27 | 28 | ![striped progressbar](../assets/widget-styles/striped-progressbar.gif) 29 | 30 | ```python 31 | # default striped progressbar style 32 | Progressbar(bootstyle="striped") 33 | 34 | # danger colored striped progressbar style 35 | Progressbar(bootstyle="danger-striped") 36 | ``` -------------------------------------------------------------------------------- /docs/en/styleguide/scale.md: -------------------------------------------------------------------------------- 1 | # Scale 2 | 3 | This widget style features a thin gray trough with a round slider handle that is 4 | **primary** color by default or the [selected color](index.md#colors). The 5 | slider handle lightens on _hover_ and darkens when _pressed_. 6 | 7 | This widget supports a special style for 8 | [disabled state](#other-scale-styles). 9 | 10 | ![scale](../assets/widget-styles/scale.gif) 11 | 12 | ```python 13 | # default Scale style 14 | Scale() 15 | 16 | # info colored label style 17 | Scale(bootstyle="info") 18 | ``` 19 | 20 | ## Other scale styles 21 | 22 | #### Disabled scale 23 | This style _cannot be applied via keywords_; it is configured through widget 24 | settings. 25 | 26 | ```python 27 | # create the scale in a disabled state 28 | Scale(state="disabled") 29 | 30 | # disable a scale after creation 31 | scale = Scale() 32 | scale.configure(state="disabled") 33 | ``` -------------------------------------------------------------------------------- /docs/en/styleguide/scrollbar.md: -------------------------------------------------------------------------------- 1 | # Scrollbar 2 | 3 | This widget style features a light gray trough with a styled thumb and arrow 4 | buttons. The thumb and arrows lighten on _hover_ and darken on _press_. The 5 | thumb and arrows can be styled with any of the [available colors](index.md#colors). 6 | 7 | ## Square (default) 8 | 9 | The default style features a thumb with squared edges. 10 | 11 | ![scrollbar](../assets/widget-styles/square-scrollbars.png) 12 | 13 | ```python 14 | # default scrollbar style 15 | Scrollbar() 16 | 17 | # success colored default scrollbar style 18 | Scrollbar(bootstyle="success") 19 | ``` 20 | 21 | ## Round 22 | 23 | The **round** style features a thumb with rounded edges. 24 | 25 | ![round scrollbar](../assets/widget-styles/round-scrollbars.png) 26 | 27 | ```python 28 | # default round scrollbar style 29 | Scrollbar(bootstyle="round") 30 | 31 | # danger colored round scrollbar style 32 | Scrollbar(bootstyle="danger-round") 33 | ``` -------------------------------------------------------------------------------- /docs/en/styleguide/separator.md: -------------------------------------------------------------------------------- 1 | # Separator 2 | 3 | This widget style features a thin horizontal _or_ vertical line drawn in the 4 | default color (typically gray) or the [selected color](index.md#colors). 5 | 6 | ![separator](../assets/widget-styles/separator.png) 7 | 8 | ```python 9 | # default separator style 10 | Separator() 11 | 12 | # info colored separator style - handle color 13 | Separator(bootstyle="info") 14 | ``` 15 | -------------------------------------------------------------------------------- /docs/en/styleguide/sizegrip.md: -------------------------------------------------------------------------------- 1 | # Sizegrip 2 | 3 | This widget style features a pattern of squares in a default muted color 4 | by default, or the [selected color](index.md#colors). 5 | 6 | ![sizegrip](../assets/widget-styles/sizegrip.gif) 7 | 8 | ```python 9 | # default sizegrip style 10 | Sizegrip() 11 | 12 | # info colored sizegrip style - handle color 13 | Sizegrip(bootstyle="info") 14 | ``` 15 | -------------------------------------------------------------------------------- /docs/en/styleguide/treeview.md: -------------------------------------------------------------------------------- 1 | ## Treeview 2 | 3 | This widget style features a solid background header that is the default theme 4 | background by default or the [selected color](index.md#colors). 5 | 6 | The border color is muted by default and changes to **primary** or the 7 | [selected color](index.md#colors) on _hover_. The border increases in thickness on 8 | _focus_. 9 | 10 | ![treeview](../assets/widget-styles/treeview.gif) 11 | 12 | ```python 13 | # default Treeview style 14 | Treeview() 15 | 16 | # info colored treeview style 17 | Treeview(bootstyle='info') 18 | ``` 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/en/themes/dark.md: -------------------------------------------------------------------------------- 1 | # Dark themes 2 | 3 | The following dark themes are largly inspired by [https://bootswatch.com/](https://bootswatch.com/) 4 | 5 | ![solar theme](../assets/themes/solar.png) 6 | Source of [inspiration](https://bootswatch.com/solar/) 7 | 8 | ![superhero theme](../assets/themes/superhero.png) 9 | Source of [inspiration](https://bootswatch.com/superhero/) 10 | 11 | ![darkly theme](../assets/themes/darkly.png) 12 | Source of [inspiration](https://bootswatch.com/darkly/) 13 | 14 | ![cyborg theme](../assets/themes/cyborg.png) 15 | Source of [inspiration](https://bootswatch.com/cyborg/) 16 | 17 | ![vapor theme](../assets/themes/vapor.png) 18 | Source of [inspiration](https://bootswatch.com/vapor/) 19 | 20 | -------------------------------------------------------------------------------- /docs/en/themes/index.md: -------------------------------------------------------------------------------- 1 | # Themes 2 | 3 | ttkbootstrap comes packaged with a LOT of beautifully styled light and 4 | dark themes, which you can view in a demo by typing this command into 5 | your terminal _after installing ttkbootstrap_. 6 | 7 | ```shell 8 | >>> python -m ttkbootstrap 9 | ``` 10 | 11 | You will see a demo screen that looks like the image below. Change the 12 | theme selection in the **Select a theme** combobox and the demo screen 13 | will update to the new theme. 14 | 15 | You may also check out the screenshots for the [light themes](light.md) and 16 | [dark themes](dark.md). 17 | 18 | ![litera theme](../assets/themes/litera.png) 19 | 20 | -------------------------------------------------------------------------------- /docs/en/themes/light.md: -------------------------------------------------------------------------------- 1 | # Light themes 2 | 3 | The following light themes are largly inspired by [https://bootswatch.com/](https://bootswatch.com/) 4 | 5 | ![cosmo theme](../assets/themes/cosmo.png) 6 | Source of [inspiration](https://bootswatch.com/cosmo/) 7 | 8 | ![flatly theme](../assets/themes/flatly.png) 9 | Source of [inspiration](https://bootswatch.com/flatly/) 10 | 11 | ![journal theme](../assets/themes/journal.png) 12 | Source of [inspiration](https://bootswatch.com/journal/) 13 | 14 | ![litera theme](../assets/themes/litera.png) 15 | Source of [inspiration](https://bootswatch.com/litera/) 16 | 17 | ![lumen theme](../assets/themes/lumen.png) 18 | Source of [inspiration](https://bootswatch.com/lumen/) 19 | 20 | ![minty theme](../assets/themes/minty.png) 21 | Source of [inspiration](https://bootswatch.com/minty/) 22 | 23 | ![pulse theme](../assets/themes/pulse.png) 24 | Source of [inspiration](https://bootswatch.com/pulse/) 25 | 26 | ![sandstone theme](../assets/themes/sandstone.png) 27 | Source of [inspiration](https://bootswatch.com/sandstone/) 28 | 29 | ![united theme](../assets/themes/united.png) 30 | Source of [inspiration](https://bootswatch.com/united/) 31 | 32 | ![yeti theme](../assets/themes/yeti.png) 33 | Source of [inspiration](https://bootswatch.com/yeti/) 34 | 35 | ![morph theme](../assets/themes/morph.png) 36 | Source of [inspiration](https://bootswatch.com/morph/) 37 | 38 | ![simplex theme](../assets/themes/simplex.png) 39 | Source of [inspiration](https://bootswatch.com/simplex/) 40 | 41 | ![cerculean theme](../assets/themes/cerculean.png) 42 | Source of [inspiration](https://bootswatch.com/cerulean/) -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/docs/requirements.txt -------------------------------------------------------------------------------- /docs/zh/about.md: -------------------------------------------------------------------------------- 1 | # 关于本项目 2 | 3 | 在创建和更新此项目时,我为自己设定了以下目标;特别是对于1.0版本。这是一项正在进行的工作,但希望我已经实现了大部分或全部目标。 4 | 5 | ## 创建一组设计精美且易于使用的样式 6 | 7 | 如您所知,创建 ttk 样式可能 _非常耗时_ 。此库消除了创建新式外观的痛苦,因此您可以专注于 _设计应用程序_ ,而不是在提交按钮上调整 25 个样式设置。 8 | 9 | ## 使用关键字设置小部件样式 10 | 11 | 保持简单。使用关键字设置样式。而不是使用 ttk 样式类,如**success.Horizontal.TProgressbar**,使用**success**,这是一个关键字,可以指示 _所有_ 小部件的相同语义含义。 12 | 13 | 许多人都熟悉用于Web开发的引导,它预先打包了内置的css样式类,这些类为快速开发提供了专业且一致的API。我对这个项目采取了类似的方法,为几乎所有ttk小部件预定义样式,并使用 _简单的关键字_ 启用样式自定义。 14 | 15 | ## 仅创建实际使用的主题和样式 16 | 17 | 如果不使用它,则它不应占用应用程序中的内存。没有什么比一堆您可能使用或可能不会使用的样板资源更能使您的应用程序陷入困境了。 18 | 19 | 为了解决这个问题,我为ttk设计了一个样式引擎,可以 _按需_ 构建ttk样式和主题。如果未使用样式,则不会创建该样式。这为主题和样式设计增加了极大的灵活性,因为我不再受到 _预加载的基于图像的小部件样式_ 的内存限制的限制。 20 | 21 | 从这个角度来看……在0.5版本中,如果我的应用程序中有一个scale小部件,我需要加载288张图像来考虑所有潜在的主题和颜色组合!!这就是传统上在 ttk 中处理样式的方式。在1.0版本中,我只需要为这个例子加载3或4个图像来考虑悬停效果等。仅构建实际使用的样式。 -------------------------------------------------------------------------------- /docs/zh/cookbook/gif-animation.md: -------------------------------------------------------------------------------- 1 | # Gif 动画 2 | 3 | 此示例演示如何在窗口中设置 gif 动画,同时通过安排从图像列表中对标签图像的更新来保持窗口对用户输入的响应。 4 | 5 | ![gif 动画](../assets/cookbook/animated-gif.gif) 6 | 7 | ```python 8 | # https://dribbble.com/shots/1237618--Gif-Spinner 9 | from pathlib import Path 10 | from itertools import cycle 11 | import ttkbootstrap as ttk 12 | from ttkbootstrap.constants import * 13 | from PIL import Image, ImageTk, ImageSequence 14 | 15 | 16 | class AnimatedGif(ttk.Frame): 17 | def __init__(self, master): 18 | super().__init__(master, width=400, height=300) 19 | 20 | # open the GIF and create a cycle iterator 21 | file_path = Path(__file__).parent / "assets/spinners.gif" 22 | with Image.open(file_path) as im: 23 | # create a sequence 24 | sequence = ImageSequence.Iterator(im) 25 | images = [ImageTk.PhotoImage(s) for s in sequence] 26 | self.image_cycle = cycle(images) 27 | 28 | # length of each frame 29 | self.framerate = im.info["duration"] 30 | 31 | self.img_container = ttk.Label(self, image=next(self.image_cycle)) 32 | self.img_container.pack(fill="both", expand="yes") 33 | self.after(self.framerate, self.next_frame) 34 | 35 | def next_frame(self): 36 | """Update the image for each frame""" 37 | self.img_container.configure(image=next(self.image_cycle)) 38 | self.after(self.framerate, self.next_frame) 39 | 40 | 41 | if __name__ == "__main__": 42 | 43 | app = ttk.Window("Animated GIF", themename="superhero") 44 | 45 | gif = AnimatedGif(app) 46 | gif.pack(fill=BOTH, expand=YES) 47 | 48 | app.mainloop() 49 | ``` -------------------------------------------------------------------------------- /docs/zh/cookbook/index.md: -------------------------------------------------------------------------------- 1 | # 食谱 2 | 3 | 越来越多的食谱展示了如何在 ttkbootstrap 中做特定的事情。 4 |

5 | 6 | ![食谱](../assets/cookbook/code-cooking.jfif) -------------------------------------------------------------------------------- /docs/zh/cookbook/validate-user-input.md: -------------------------------------------------------------------------------- 1 | # 验证用户输入 2 | 3 | 任何基于 `Entry` 的小部件都可以验证用户输入。 当小部件处于 **invalid** 状态时,边框颜色将变为 **danger** 颜色。 4 | 5 | ![无效条目](../assets/cookbook/entry-validation.gif) 6 | 7 | 在此示例中,验证类型为`focus`,这意味着每次小部件接收或失去焦点时都会运行验证函数。 还有几种其他类型的验证,以及许多配置验证的方法。 未来的教程将对此进行更详细的讨论,但与此同时,您可以查阅 [tcl/tk 文档](https://tcl.tk/man/tcl8.6/TkCmd/ttk_entry.htm) 了解更多关于什么可用于验证的信息。 8 | 9 | ```python 10 | import ttkbootstrap as ttk 11 | from ttkbootstrap.constants import * 12 | 13 | def validate_number(x) -> bool: 14 | """Validates that the input is a number""" 15 | if x.isdigit(): 16 | return True 17 | elif x == "": 18 | return True 19 | else: 20 | return False 21 | 22 | def validate_alpha(x) -> bool: 23 | """Validates that the input is alpha""" 24 | if x.isdigit(): 25 | return False 26 | elif x == "": 27 | return True 28 | else: 29 | return True 30 | 31 | # create the toplevel window 32 | root = ttk.Window() 33 | frame = ttk.Frame(root, padding=10) 34 | frame.pack(fill=BOTH, expand=YES) 35 | 36 | # register the validation callback 37 | digit_func = root.register(validate_number) 38 | alpha_func = root.register(validate_alpha) 39 | 40 | # validate numeric entry 41 | ttk.Label(frame, text="Enter a number").pack() 42 | num_entry = ttk.Entry(frame, validate="focus", validatecommand=(digit_func, '%P')) 43 | num_entry.pack(padx=10, pady=10, expand=True) 44 | 45 | # validate alpha entry 46 | ttk.Label(frame, text="Enter a letter").pack() 47 | let_entry = ttk.Entry(frame, validate="focus", validatecommand=(alpha_func, '%P')) 48 | let_entry.pack(padx=10, pady=10, expand=True) 49 | 50 | root.mainloop() 51 | ``` -------------------------------------------------------------------------------- /docs/zh/gallery/index.md: -------------------------------------------------------------------------------- 1 | # 图库 2 | 3 | 在本节中,您会发现越来越多的 ttkbootstrap 项目旨在创建自己的应用程序时提供灵感或方向。 这些旨在展示设计,不一定是功能齐全的应用程序。 4 | 5 | ![文件搜索图像示例](../assets/gallery/back_me_up.png) -------------------------------------------------------------------------------- /docs/zh/gettingstarted/installation.md: -------------------------------------------------------------------------------- 1 | # 安装 2 | 3 | 这是很容易的。 4 | 5 | !!! note "通过PyPI安装" 6 | ```bash 7 | python -m pip install ttkbootstrap 8 | ``` 9 | 10 | !!! note "通过PyPI清华镜像源安装-译者注" 11 | ```bash 12 | python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple ttkbootstrap 13 | ``` 14 | 15 | 未经过测试的版本(可能会出错)(注:译者可能翻译有误) 16 | 17 | !!! note "通过Github安装" 18 | ```bash 19 | python -m pip install git+https://github.com/israel-dryer/ttkbootstrap 20 | ``` 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/zh/gettingstarted/legacy.md: -------------------------------------------------------------------------------- 1 | # 传统支持 2 | 3 | 虽然`tkinter`小部件不是库的重点,但我为每个主题应用了一些默认样式到旧小部件,以便它们不会突出。造成这种情况的一个重要原因是,一些`ttk`小部件在引擎下使用`tkinter`小部件组件。因此,还必须设置这些样式,以应**组合框**中的弹出列表或**菜单**按钮中的"菜单"具有适当的样式之类的情况。 4 | 5 | 以下是使用传统`tkinter`小部件的浅色和深色主题的示例。 6 | 7 | ![传统亮色主题](../assets/themes/legacy_light.png) 8 | 9 | ![传统深色主题](../assets/themes/legacy_dark.png) -------------------------------------------------------------------------------- /docs/zh/index.md: -------------------------------------------------------------------------------- 1 | # ttkbootstrap 2 | ![](https://img.shields.io/github/release/israel-dryer/ttkbootstrap.svg) 3 | [![Downloads](https://pepy.tech/badge/ttkbootstrap)](https://pepy.tech/project/ttkbootstrap) 4 | [![Downloads](https://pepy.tech/badge/ttkbootstrap/month)](https://pepy.tech/project/ttkbootstrap) 5 | ![](https://img.shields.io/github/issues/israel-dryer/ttkbootstrap.svg) 6 | ![](https://img.shields.io/github/issues-closed/israel-dryer/ttkbootstrap.svg) 7 | ![](https://img.shields.io/github/license/israel-dryer/ttkbootstrap.svg) 8 | ![](https://img.shields.io/github/stars/israel-dryer/ttkbootstrap.svg) 9 | ![](https://img.shields.io/github/forks/israel-dryer/ttkbootstrap.svg) 10 | 11 | tkinter的超强主题扩展,可实现受[Bootstrap](https://getbootstrap.com/)启发的按需现代平面风格主题。 12 | 13 | ## 📦 特点 14 | 15 | ✔️ [**内置主题**](themes/index.zh.md) 16 | 十几个精心策划的[深色](themes/dark.md)和[浅色](themes/light.zh.md)主题 17 | 18 | ✔️ [**预定义样式:**](styleguide/index.zh.md) 19 | 大量漂亮的[预定义构件样式](styleguide/index.zh.md),如**轮廓**和**圆形切换**按钮。 20 | 21 | ✔️ [**简单的关键字 API:**](gettingstarted/tutorial.zh.md) 22 | 使用[简单的关键字](gettingstarted/tutorial.zh.md)(如**primary**和**striped**)应用颜色和类型,而不是使用主要的旧方法**Striped.Horizontal.TProgressbar**。如果您已经使用Bootstrap进行Web开发,那么您已经熟悉了使用css类的这种方法。 23 | 24 | ✔️ [**许多新的小部件:**](api/widgets/dateentry.zh.md) 25 | ttkbootstrap附带了几个设计精美的新小部件,如[Meter](api/widgets/meter.zh.md),[DateEntry](api/widgets/dateentry.zh.md)和[Floodgauge](api/widgets/floodgauge.zh.md)。 此外,[对话框](api/dialogs/dialog.zh.md)现在具有主题和完全可自定义性。 26 | 27 | ✔️ [**内置主题创建器:**](themes/themecreator.zh.md) 28 | 想要创建自己的主题?容易!ttkbootstrap附带一个内置的[主题创建器](themes/themecreator.zh.md),使您能够轻松构建,加载,浏览和应用自己的自定义主题。 29 | 30 | 31 | ## 🎨 示例主题 32 | 33 | ![主题](./assets/themes/themes.gif) 34 | -------------------------------------------------------------------------------- /docs/zh/license.md: -------------------------------------------------------------------------------- 1 | # 授权许可 2 | 3 | **MIT 许可** 4 | 5 | Copyright © 2021-2025 Israel Dryer 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /docs/zh/styleguide/button.md: -------------------------------------------------------------------------------- 1 | # 按钮 2 | 3 | 此小部件具有多种按钮样式类型,它们使用**primary**作为默认颜色,或[选定的颜色](index.zh.md#颜色)。 4 | 5 | 此小部件支持[禁用状态](#other-button-styles)的特殊样式。 6 | 7 | ## 实心按钮(默认) 8 | 9 | 默认样式具有纯色背景,在 _鼠标悬浮_ 和 _按下_ 时变暗。当小部件被聚焦时,按钮内会出现一个虚线环。 10 | 11 | ![实心按钮](../assets/widget-styles/solid-buttons.gif) 12 | 13 | ```python 14 | # 默认样式 15 | Button() 16 | 17 | # success样式 18 | Button(bootstyle="success") 19 | ``` 20 | 21 | ## 外框按钮 22 | 23 | 这种风格的特点是具有纤细的轮廓。当 _鼠标悬浮_ 或 _按下_ 时, 24 | 按钮变为类似于默认按钮样式的纯色。当小部件被聚焦时,按钮内会出现一个虚线环。 25 | 26 | ![外框按钮](../assets/widget-styles/outline-buttons.gif) 27 | 28 | ```python 29 | # default outline style 30 | Button(bootstyle="outline") 31 | 32 | # success outline style 33 | Button(bootstyle="success-outline") 34 | ``` 35 | 36 | ## 链接按钮 37 | 38 | 此样式具有带有标签外观的按钮。当 _鼠标悬浮_ 或 _按下_ 时,文字颜色改变为**info**以模拟您期望的HTML 超链接效果。按下按钮时会有轻微的虚线框效果。当小部件被聚焦时,它会展现被激活的外观。 39 | 40 | ![链接按钮](../assets/widget-styles/link-buttons.gif) 41 | 42 | ```python 43 | # default link style 44 | Button(bootstyle="link") 45 | 46 | # success link style 47 | Button(bootstyle="success-link") 48 | ``` 49 | 50 | ## 其他按钮样式 51 | 52 | #### 禁用按钮 53 | 这种风格 _不能通过关键字应用_;它是通过小部件配置的设置。 54 | 55 | ```python 56 | # create the button in a disabled state 57 | Button(state="disabled") 58 | 59 | # disable a button after creation 60 | b = Button() 61 | b.configure(state="disabled") 62 | ``` -------------------------------------------------------------------------------- /docs/zh/styleguide/combobox.md: -------------------------------------------------------------------------------- 1 | # 下拉框 2 | 3 | 此小部件样式具有一个带有样式边框和箭头的输入框。边框颜色默认为未激活的颜色并在 _鼠标悬浮_ 时更改为 **primary** 或 [选定颜色](index.zh.md#颜色)。边框厚度在 _得到焦点_ 时增加。箭头颜色在 _鼠标悬浮_ 或 _获得焦点_ 时更改为默认或[选定颜色](index.zh.md#颜色)。 4 | 5 | 此小部件还支持 [禁用状态](#disabled-combobox)、[只读状态](#readonly-combobox)和[无效状态](#invalid-combobox)的特殊样式。 6 | 7 | 8 | ![下拉框](../assets/widget-styles/combos.gif) 9 | 10 | ```python 11 | # 默认下拉框样式 12 | Combobox() 13 | 14 | # 危险的彩色下拉框样式 15 | Combobox(bootstyle="danger") 16 | ``` 17 | 18 | ## 其他下拉框样式 19 | 20 | #### 禁用的下拉框 21 | 22 | 这种风格 _不能通过关键字应用_ ;它是通过小部件配置的设置。 23 | 24 | ```python 25 | # 创建一个被禁用的下拉框 26 | Combobox(state="disabled") 27 | 28 | # 创建后禁用下拉框 29 | cb = Combobox() 30 | cb.configure(state="disabled") 31 | ``` 32 | 33 | #### 只读下拉框 34 | 35 | 这种风格 _不能通过关键字应用_ ;它是通过小部件配置的设置。 36 | 37 | 38 | ```python 39 | # 创建一个只读的下拉框 40 | Combobox(state="readonly") 41 | 42 | # 创建后设置下拉框只读状态 43 | cb = Combobox() 44 | cb.configure(state="readonly") 45 | ``` 46 | 47 | #### 无效的下拉框 48 | 49 | 这种风格 _不能通过关键字应用_ ,而是在小部件上实现的验证过程。在**食谱**中,您会发现[如何应用验证](../cookbook/validate-user-input.zh.md) 基于`文本框`的小部件的示例。 50 | -------------------------------------------------------------------------------- /docs/zh/styleguide/dateentry.md: -------------------------------------------------------------------------------- 1 | # DateEntry 2 | 3 | This widget is composed of two widgets, the **Entry** widget and the **Button** 4 | widget. The **Entry** component behaves identically to the 5 | [default entry widget](entry.zh.md), and the calendar button behaves as the 6 | [default solid button](button.zh.md). 7 | 8 | The [DatePickerPopup](datepickerpopup.md) is invoked when the calendar 9 | button is pressed. The default color applied to the popup is **primary**. 10 | 11 | This widget also supports special styles for [disabled state](#disabled-date-entry), 12 | [readonly state](#readonly-date-entry), and [invalid state](#invalid-date-entry). 13 | 14 | ![date entries](../assets/widget-styles/date-entries.gif) 15 | 16 | ```python 17 | # default date entry 18 | DateEntry() 19 | 20 | # success colored date entry 21 | DateEntry(bootstyle="success") 22 | ``` 23 | 24 | ## Other date entry styles 25 | 26 | #### Disabled date entry 27 | 28 | This style _cannot be applied via keywords_; it is configured through widget 29 | settings. 30 | 31 | ```python 32 | # create the date entry in a disabled state 33 | DateEntry(state="disabled") 34 | 35 | # disable a date entry after creation 36 | d = DateEntry() 37 | d.configure(state="disabled") 38 | ``` 39 | 40 | #### Readonly date entry 41 | 42 | This style _cannot be applied via keywords_; it is configured through widget 43 | settings. 44 | 45 | ```python 46 | # create the date entry in a readonly state 47 | DateEntry(state="readonly") 48 | 49 | # set the date entry readonly state after creation 50 | d = DateEntry() 51 | d.configure(state="readonly") 52 | ``` 53 | 54 | #### Invalid date entry 55 | 56 | This style _cannot be applied via keywords_, but rather is the result of a 57 | validation process implemented on the widget. In the **Cookbook** you will find 58 | an example of [how to apply validation](../cookbook/validate-user-input.zh.md) to an 59 | `Entry` based widget. -------------------------------------------------------------------------------- /docs/zh/styleguide/datepickerpopup.md: -------------------------------------------------------------------------------- 1 | # DatePickerDialog 2 | 3 | This widget style encomposses a collection of button and label widgets. The 4 | _header_ and _active date_ are **primary** colored (default) or the 5 | [selected color](index.zh.md#颜色). The _weekdays header_ and _current date_ use the 6 | `secondary` color. 7 | 8 | Check out the [api documentation](../api/dialogs/datepickerdialog.zh.md) for 9 | more information on how to use this widget. 10 | 11 | ![date picker](../assets/widget-styles/date-picker-popup.gif) 12 | 13 | ```python 14 | # default popup 15 | DatePickerDialog() 16 | 17 | # warning colored popup 18 | DatePickerDialog(bootstyle="warning") 19 | ``` 20 | -------------------------------------------------------------------------------- /docs/zh/styleguide/entry.md: -------------------------------------------------------------------------------- 1 | # 文本框 2 | 3 | 此小部件带有可选各种颜色的文本框。 4 | 边框颜色在失去焦点时默认为 __淡色__ , _得到焦点后_ 颜色会被更改为 **主要颜色** 或 [选定颜色](index.zh.md#颜色)。 5 | _获得焦点时_ 边框厚度将会被增加。 6 | 7 | 此小部件还支持 [禁用状态](#disabled-entry), 8 | [只读状态](#readonly-entry)和[无效状态](#invalid-entry)的特殊样式。 9 | 10 | ![entry](../assets/widget-styles/entries.gif) 11 | 12 | ```python 13 | # 默认的文本框(样式) 14 | Entry() 15 | 16 | # 应用了"danger"样式的文本框 17 | Entry(bootstyle="danger") 18 | ``` 19 | 20 | ## 其他文本框样式 21 | 22 | #### 被禁用的文本框 23 | 24 | 此样式 _不能通过关键字来创建_;它是通过小部件设置进行配置的。 25 | 26 | ```python 27 | # 创建一个被禁用的文本框 28 | Entry(state="disabled") 29 | 30 | # 创建之后再设置文本框为禁用 31 | e = Entry() 32 | e.configure(state="disabled") 33 | ``` 34 | 35 | #### 只读输入框 36 | 37 | 此样式 _不能通过关键字来创建_;它是通过小部件设置进行配置的。 38 | 39 | ```python 40 | # 创建一个只读的文本框 41 | Entry(state="readonly") 42 | 43 | # 创建之后再设置文本框为只读 44 | e = Entry() 45 | e.configure(state="readonly") 46 | ``` 47 | 48 | #### 验证无效输入 49 | 50 | 此样式 _不能通过关键字来创建_;你需要在输入框上实施验证。 51 | 在**Cookbook**中,你将会找到一个名为[如何验证无效输入并且应用到到文本框](../cookbook/validate-user-input.zh.md)的事例。 52 | -------------------------------------------------------------------------------- /docs/zh/styleguide/floodgauge.md: -------------------------------------------------------------------------------- 1 | # Floodgauge 2 | 3 | A progressbar with an optional display text. 4 | 5 | This widget style features an indicator that is **primary** colored (default) 6 | or the [selected color](index.zh.md#颜色). The trough color is a desaturated 7 | variation of the indicator color. 8 | 9 | ![floodguage](../assets/widget-styles/floodgauge.gif) 10 | 11 | ```python 12 | # default floodgauge style 13 | Floodgauge() 14 | 15 | # success colored floodguage style 16 | Floodgauge(bootstyle="success") 17 | ``` -------------------------------------------------------------------------------- /docs/zh/styleguide/frame.md: -------------------------------------------------------------------------------- 1 | # Frame 2 | 3 | This widget style features a default background color that matches the theme 4 | background by default, or the [selected color](index.zh.md#颜色). 5 | 6 | ![frame](../assets/widget-styles/frame.png) 7 | 8 | ```python 9 | # default frame style 10 | Frame() 11 | 12 | # info colored frame style 13 | Frame(bootstyle="info") 14 | ``` -------------------------------------------------------------------------------- /docs/zh/styleguide/index.md: -------------------------------------------------------------------------------- 1 | # 样式指南 2 | 3 | 这是应用 ttkbootstrap 样式的样式指南。所有 ttkbootstrap 样式 4 | 使用已注入的 **bootstyle** 参数应用 5 | **ttk** 小部件构造函数。 6 | 7 | ℹ️ [了解更多关于样式化遗留小部件的信息](legacywidgets.zh.md)。 8 | 9 | ## 颜色 10 | 11 | 以下颜色选项可用于 _所有_ 小部件,除非说明,并且可以与小部件特定的已被描述的样式关键字一起使用。默认样式不需要关键字。 12 | 13 | 下面关键字的实际颜色值为 14 | [在每个特定主题中定义](../themes/definitions.zh.md),但是 15 | 下面的描述是您通常可以从每个颜色关键字中获得的内容。 16 | 17 | |关键字 |说明 |示例 | 18 | | --- | --- | --- | 19 | |主要 |大多数小部件的默认颜色 | ![主要](../assets/colors/primary.png) | 20 | |次要 |通常是 _灰色_ | ![次要](../assets/colors/secondary.png) | 21 | |成功|通常是 _绿色_ | ![成功](../assets/colors/success.png) | 22 | |信息 |通常是 _蓝色_| ![信息](../assets/colors/info.png) | 23 | |警告 |通常是 _橙色_ | ![警告](../assets/colors/warning.png) | 24 | |危险 |通常是 _红色_ | ![危险](../assets/colors/danger.png) | 25 | |亮色 |通常是 _浅灰色_ | ![亮色](../assets/colors/light.png) | 26 | |深色 |通常是 _深灰色_ | ![深色](../assets/colors/dark.png) | 27 | 28 | 29 | ```python 30 | # 信息彩色按钮样式 31 | Button(bootstyle="info") 32 | 33 | # 警告彩色刻度样式 34 | Scale(bootstyle="warning") 35 | 36 | # 成功彩色进度条 37 | Progressbar(bootstyle="success") 38 | ``` -------------------------------------------------------------------------------- /docs/zh/styleguide/label.md: -------------------------------------------------------------------------------- 1 | # Label 2 | 3 | This widget features two style types that can both be customized using any of 4 | the [available colors](index.zh.md#颜色). 5 | 6 | ## Default label 7 | 8 | The default style features a default theme defined foreground and background 9 | color. The foreground can be changed using a [selected color](index.zh.md#颜色). 10 | 11 | ![normal label](../assets/widget-styles/label.png) 12 | 13 | ```python 14 | # default label style 15 | Label() 16 | 17 | # danger colored label style 18 | Label(bootstyle="danger") 19 | ``` 20 | 21 | ## Inverse label 22 | 23 | This style features a label with colors that are inverted versions of the default 24 | colors. The [selected color](index.zh.md#颜色) changes the background color instead of the 25 | foreground color. 26 | 27 | This is especially useful when you are adding labels to a styled `Frame`, or you 28 | want to add a [label heading](../gallery/mediaplayer.zh.md) that does not have a default 29 | background color. 30 | 31 | ![inverse label](../assets/widget-styles/inverse-label.png) 32 | 33 | ```python 34 | # default inverse label style 35 | Label(bootstyle="inverse") 36 | 37 | # danger colored inverse label style 38 | Label(bootstyle="inverse-danger") 39 | ``` 40 | -------------------------------------------------------------------------------- /docs/zh/styleguide/labelframe.md: -------------------------------------------------------------------------------- 1 | # Labelframe 2 | 3 | This widget style features a styled border and label. By default, the border 4 | and label use theme defined defaults for border and foreground colors. When a 5 | [selected color](index.zh.md#颜色) is used, both the label text and the border use this 6 | color. 7 | 8 | ![labelframe](../assets/widget-styles/labelframe.png) 9 | 10 | ```python 11 | # default labelframe style 12 | Labelframe() 13 | 14 | # info colored labelframe style 15 | Labelframe(bootstyle="info") 16 | ``` 17 | -------------------------------------------------------------------------------- /docs/zh/styleguide/legacywidgets.md: -------------------------------------------------------------------------------- 1 | # 旧版小部件 2 | 3 | ttkbootstrap 将默认样式应用于旧版 tkinter 小部件,以便它们与主题化的 ttk 小部件一起使用时不会显得格格不入。 4 | 例如,`Text` 和 `Canvas`小部件通常与主题化的`ttk`小部件一起使用。 5 | 6 | ## 主题化旧版小部件 7 | 8 | 为了确保在主题更改时更新样式,每个旧版小部件都向“发布者”注册,当主题更改时,发布者会向每个旧版小部件发送更新消息,以便在小部件上启动主题配置的修改。 9 | 10 | ## 自定义旧版小部件 11 | 虽然主题功能在大多数情况下是合适的,但它也会阻止用户对小部件进行自定义更改。但是,在 1.2 版中,所有旧版小部件都添加了一个 `autostyle` 参数。默认情况下,`autostyle` 是隐含的 **True**。这意味着,ttkbootstrap 将处理遗留小部件上的所有样式。但是,如果您将 `autostyle` 参数设置为 **False**,则小部件样式将委托给用户。这将使您能够对旧版小部件进行自定义更改。 12 | 13 | !!! warning "应谨慎使用关闭自动样式" 14 | 如果您在小部件上关闭自动样式,它将不再接收主题更改更新;默认情况下不会应用任何样式,包括字体,浮雕之类的…… -------------------------------------------------------------------------------- /docs/zh/styleguide/menubutton.md: -------------------------------------------------------------------------------- 1 | # Menubutton 2 | 3 | This widget features a styled button with an arrow that can be styled using 4 | any of the [available colors](index.zh.md#颜色). 5 | 6 | This widget supports a special style for [disabled state](#disabled-menubutton). 7 | 8 | ## Solid (default) 9 | 10 | This widget style features a solid background color that lightens on _hover_ 11 | and darkens when _pressed_. 12 | 13 | ![solid menubutton](../assets/widget-styles/menubutton.gif) 14 | 15 | ```python 16 | # default solid menubutton style 17 | Menubutton() 18 | 19 | # success colored solid menubutton style 20 | Menubutton(bootstyle="success") 21 | ``` 22 | 23 | ## Outline 24 | 25 | This style features a thin styled outline. When _pressed_ or on _hover_, the 26 | button changes to a solid color similar to the default menubutton style. 27 | 28 | ![outline menubutton](../assets/widget-styles/outline-menubutton.gif) 29 | 30 | ```python 31 | # default outline menubutton style 32 | Menubutton(bootstyle="outline") 33 | 34 | # info colored outline menubutton style 35 | Menubutton(bootstyle="info-outline") 36 | ``` 37 | 38 | ## Other menubutton styles 39 | 40 | #### Disabled menubutton 41 | This style _cannot be applied via keywords_; it is configured through widget 42 | settings. 43 | 44 | ```python 45 | # create the menubutton in a disabled state 46 | Menubutton(state="disabled") 47 | 48 | # disable a menubutton after creation 49 | b = Menubutton() 50 | b.configure(state="disabled") 51 | ``` 52 | -------------------------------------------------------------------------------- /docs/zh/styleguide/meter.md: -------------------------------------------------------------------------------- 1 | # Meter 2 | 3 | This widget style encompasses a collection of components. The indicator and 4 | main label are **primary** by default, or the [selected color](index.zh.md#颜色). 5 | If provided, the subtext is **secondary** for light themes and **light** for 6 | dark themes. However, all of these elements can be configured using the 7 | [available colors](index.zh.md#颜色). 8 | 9 | ![meter colors](../assets/widget-styles/meter.gif) 10 | 11 | The meter widget is highly configurable, and can produce a diversity of 12 | interesting meters by mixing colors and other widget specific settings. 13 | 14 | ![meter](../assets/widget-styles/meter.png) 15 | 16 | ```python 17 | # default meter style 18 | Meter() 19 | 20 | # info colored meter 21 | Meter(bootstyle="info") 22 | 23 | # danger color subtext 24 | Meter(subtextstyle="danger") 25 | 26 | # success colored meter with warning colored subtext 27 | Meter(bootstyle="success", subtextstyle="warning") 28 | ``` -------------------------------------------------------------------------------- /docs/zh/styleguide/notebook.md: -------------------------------------------------------------------------------- 1 | # Notebook 2 | 3 | This widget style features minimal styling by default. However, you can add some 4 | flair to the _inactive_ tab by using any of the [available colors](index.zh.md#颜色) as 5 | demonstrated in the exhibit below. 6 | 7 | ![notebook](../assets/widget-styles/notebook.png) 8 | 9 | ```python 10 | # default notebook style 11 | Notebook() 12 | 13 | # info colored notebook style - inactive tab color 14 | Notebook(bootstyle="info") 15 | ``` 16 | -------------------------------------------------------------------------------- /docs/zh/styleguide/panedwindow.md: -------------------------------------------------------------------------------- 1 | # Panedwindow 2 | 3 | This widget style features containers with the themed defined background color 4 | separated by a styled sash that is grayish by default or of the 5 | [selected color](index.zh.md#颜色). 6 | 7 | ![paned widow](../assets/widget-styles/panedwindow.gif) 8 | 9 | ```python 10 | # default panedwindow style 11 | Panedwindow() 12 | 13 | # info colored panedwindow style 14 | Panedwindow(bootstyle="info") 15 | ``` -------------------------------------------------------------------------------- /docs/zh/styleguide/progressbar.md: -------------------------------------------------------------------------------- 1 | # Progressbar 2 | 3 | This widget features a few style types that have **primary** colored indicator 4 | bars by default, but can by styled using any of the 5 | [available colors](index.zh.md#颜色). 6 | 7 | ## Solid (default) 8 | 9 | The default widget style features a solid color indicator bar. 10 | 11 | ![solid progressbar](../assets/widget-styles/solid-progressbar.gif) 12 | 13 | ```python 14 | # default solid progressbar style 15 | Progressbar() 16 | 17 | # success colored solid progressbar style 18 | Progressbar(bootstyle="success") 19 | ``` 20 | 21 | 22 | ## Striped 23 | 24 | This widget style features a striped indicator bar that uses the default or 25 | [selected color](index.zh.md#颜色) for the main color, and a desaturated version 26 | of this color for the alternating stripe. 27 | 28 | ![striped progressbar](../assets/widget-styles/striped-progressbar.gif) 29 | 30 | ```python 31 | # default striped progressbar style 32 | Progressbar(bootstyle="striped") 33 | 34 | # danger colored striped progressbar style 35 | Progressbar(bootstyle="danger-striped") 36 | ``` -------------------------------------------------------------------------------- /docs/zh/styleguide/scale.md: -------------------------------------------------------------------------------- 1 | # Scale 2 | 3 | This widget style features a thin gray trough with a round slider handle that is 4 | **primary** color by default or the [selected color](index.zh.md#颜色). The 5 | slider handle lightens on _hover_ and darkens when _pressed_. 6 | 7 | This widget supports a special style for 8 | [disabled state](#other-scale-styles). 9 | 10 | ![scale](../assets/widget-styles/scale.gif) 11 | 12 | ```python 13 | # default Scale style 14 | Scale() 15 | 16 | # info colored label style 17 | Scale(bootstyle="info") 18 | ``` 19 | 20 | ## Other scale styles 21 | 22 | #### Disabled scale 23 | This style _cannot be applied via keywords_; it is configured through widget 24 | settings. 25 | 26 | ```python 27 | # create the scale in a disabled state 28 | Scale(state="disabled") 29 | 30 | # disable a scale after creation 31 | scale = Scale() 32 | scale.configure(state="disabled") 33 | ``` -------------------------------------------------------------------------------- /docs/zh/styleguide/scrollbar.md: -------------------------------------------------------------------------------- 1 | # Scrollbar 2 | 3 | This widget style features a light gray trough with a styled thumb and arrow 4 | buttons. The thumb and arrows lighten on _hover_ and darken on _press_. The 5 | thumb and arrows can be styled with any of the [available colors](index.zh.md#颜色). 6 | 7 | ## Square (default) 8 | 9 | The default style features a thumb with squared edges. 10 | 11 | ![scrollbar](../assets/widget-styles/square-scrollbars.png) 12 | 13 | ```python 14 | # default scrollbar style 15 | Scrollbar() 16 | 17 | # success colored default scrollbar style 18 | Scrollbar(bootstyle="success") 19 | ``` 20 | 21 | ## Round 22 | 23 | The **round** style features a thumb with rounded edges. 24 | 25 | ![round scrollbar](../assets/widget-styles/round-scrollbars.png) 26 | 27 | ```python 28 | # default round scrollbar style 29 | Scrollbar(bootstyle="round") 30 | 31 | # danger colored round scrollbar style 32 | Scrollbar(bootstyle="danger-round") 33 | ``` -------------------------------------------------------------------------------- /docs/zh/styleguide/separator.md: -------------------------------------------------------------------------------- 1 | # 分隔线 2 | 3 | 此小部件样式可以用默认颜色(通常为灰色)或[选定颜色](index.zh.md#颜色)来绘制细直线或垂线。 4 | 5 | ![separator](../assets/widget-styles/separator.png) 6 | 7 | ```python 8 | # 默认分隔线样式 9 | Separator() 10 | 11 | # 彩色分隔符样式 'info' 12 | Separator(bootstyle="info") 13 | ``` 14 | -------------------------------------------------------------------------------- /docs/zh/styleguide/sizegrip.md: -------------------------------------------------------------------------------- 1 | # 大小调整手柄 2 | 3 | 此小部件样式在默认情况下显示为具有柔和颜色或[选定颜色](index.zh.md#颜色)的正方形图案。 4 | 5 | ![sizegrip](../assets/widget-styles/sizegrip.gif) 6 | 7 | ```python 8 | # 默认大小调整手柄样式 9 | Sizegrip() 10 | 11 | # 应用了'info'彩色样式的大小调整手柄 12 | Sizegrip(bootstyle="info") 13 | ``` -------------------------------------------------------------------------------- /docs/zh/styleguide/treeview.md: -------------------------------------------------------------------------------- 1 | ## 树形菜单 2 | 3 | 树形菜单可以应用默认主题的纯色背景或[选定的颜色](index.zh.md#颜色)。 4 | 5 | 此小部件带有可选各种颜色的文本框。 6 | 边框颜色在失去焦点时默认为 __淡色__ , _得到焦点后_ 颜色会被更改为 **主要颜色** 或 [选定颜色](index.zh.md#颜色)。 7 | _获得焦点时_ 边框厚度将会被增加。 8 | 9 | ![treeview](../assets/widget-styles/treeview.gif) 10 | 11 | ```python 12 | # 默认的树形图样式 13 | Treeview() 14 | 15 | # 应用了'info'彩色样式的树形菜单 16 | Treeview(bootstyle='info') 17 | ``` 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/zh/themes/dark.md: -------------------------------------------------------------------------------- 1 | # 深色主题 2 | 3 | 以下深色主题很大程度上受到 [https://bootswatch.com/](https://bootswatch.com/) 的启发 4 | 5 | ![solar 主题](../assets/themes/solar.png) 6 | [灵感来源](https://bootswatch.com/solar/) 7 | 8 | ![superhero 主题](../assets/themes/superhero.png) 9 | [灵感来源](https://bootswatch.com/superhero/) 10 | 11 | ![darkly 主题](../assets/themes/darkly.png) 12 | [灵感来源](https://bootswatch.com/darkly/) 13 | 14 | ![cyborg 主题](../assets/themes/cyborg.png) 15 | [灵感来源](https://bootswatch.com/cyborg/) 16 | 17 | ![vapor 主题](../assets/themes/vapor.png) 18 | [灵感来源](https://bootswatch.com/vapor/) -------------------------------------------------------------------------------- /docs/zh/themes/index.md: -------------------------------------------------------------------------------- 1 | # 主题 2 | 3 | ttkbootstrap 附带了许多风格精美的浅色和深色主题,您可以在 _安装 ttkbootstrap 后_ 在终端中键入此命令,在演示中查看这些主题。 4 | 5 | ```shell 6 | >>> python -m ttkbootstrap 7 | ``` 8 | 9 | 您将看到如下图所示的演示屏幕。 在 **Select a theme** 下拉框中更改主题选择,演示屏幕将更新为新主题。 10 | 11 | 您还可以查看 [浅色主题](light.md) 和 [深色主题](dark.md) 的屏幕截图。 12 | 13 | ![litera 主题](../assets/themes/litera.png) -------------------------------------------------------------------------------- /docs/zh/themes/light.md: -------------------------------------------------------------------------------- 1 | # 浅色主题 2 | 3 | 以下浅色主题很大程度上受到 [https://bootswatch.com/](https://bootswatch.com/) 的启发 4 | 5 | ![cosmo 主题](../assets/themes/cosmo.png) 6 | [灵感来源](https://bootswatch.com/cosmo/) 7 | 8 | ![flatly 主题](../assets/themes/flatly.png) 9 | [灵感来源](https://bootswatch.com/flatly/) 10 | 11 | ![journal 主题](../assets/themes/journal.png) 12 | [灵感来源](https://bootswatch.com/journal/) 13 | 14 | ![litera 主题](../assets/themes/litera.png) 15 | [灵感来源](https://bootswatch.com/litera/) 16 | 17 | ![lumen 主题](../assets/themes/lumen.png) 18 | [灵感来源](https://bootswatch.com/lumen/) 19 | 20 | ![minty 主题](../assets/themes/minty.png) 21 | [灵感来源](https://bootswatch.com/minty/) 22 | 23 | ![pulse 主题](../assets/themes/pulse.png) 24 | [灵感来源](https://bootswatch.com/pulse/) 25 | 26 | ![sandstone 主题](../assets/themes/sandstone.png) 27 | [灵感来源](https://bootswatch.com/sandstone/) 28 | 29 | ![united 主题](../assets/themes/united.png) 30 | [灵感来源](https://bootswatch.com/united/) 31 | 32 | ![yeti 主题](../assets/themes/yeti.png) 33 | [灵感来源](https://bootswatch.com/yeti/) 34 | 35 | ![morph 主题](../assets/themes/morph.png) 36 | [灵感来源](https://bootswatch.com/morph/) 37 | 38 | ![simplex 主题](../assets/themes/simplex.png) 39 | [灵感来源](https://bootswatch.com/simplex/) 40 | 41 | ![cerculean 主题](../assets/themes/cerculean.png) 42 | [灵感来源](https://bootswatch.com/cerulean/) -------------------------------------------------------------------------------- /docs/zh/themes/themecreator.md: -------------------------------------------------------------------------------- 1 | # TTK创建器 2 | 3 | TTK创建器 与 ttkbootstrap 打包,以便您可以修改、保存、导出和导入您创建的主题。 4 | 5 | 要运行该程序,请 _在您安装**ttkbootstrap**后_ 在控制台中键入以下命令: 6 | 7 | ```shell 8 | python -m ttkcreator 9 | ``` 10 | 11 | ![TTK创建器](../assets/ttkcreator/creator.png) 12 | 13 | ## 创建一个新主题 14 | 15 | 所有用于更改主题的控件都在左侧控制框架上。 16 | 17 | 1. 使用 **name** 条目命名您的主题 18 | 19 | 2. 选择一个**基础主题**;这将设置 _初始_ 颜色 20 | 21 | 3. 使用两个选项之一为每个颜色 _关键字_ 选择一种颜色 22 | 23 | * 单击🎨按钮从颜色对话框中选择一种颜色 24 | * 或者,输入 _十六进制_ 或有效颜色 _名称_ 25 | 26 | 4. 点击**保存**按钮 27 | 28 | 您的主题现在保存在文件“ttkbootstrap.themes.user.py”中 29 | 30 | !!! tip "重置主题" 31 | 如果要重置颜色选择,可以单击 32 | **重置**选项从顶部菜单重置所有颜色 33 | 到**基本主题**颜色。 34 | 35 | ## 导入用户主题 36 | 37 | 如果您有以下指定格式的用户主题文件,您可以 38 | 将该文件导入 ttkbootstrap。 39 | 40 | 1.单击顶部菜单上的**导入**按钮 41 | 42 | 2.选择你要导入的主题文件,然后点击**确定**导入 43 | 44 | !!! warning 45 | 导入用户主题文件将覆盖现有的用户定义 46 | ttkbootstrap 中的主题;所以确保先**导出**现有的 47 | 你想要保留的主题 48 | 49 | `user.py` 文件包含用户定义主题的字典。 50 | 您导入的那个文件必须符合下图所示的模式。 51 | 52 | ```python 53 | USER_THEMES = { 54 | "supercosmo": { 55 | "type": "light", 56 | "colors": { 57 | "primary": "#2780e3", 58 | "secondary": "#7E8081", 59 | "success": "#3fb618", 60 | "info": "#9954bb", 61 | "warning": "#ff7518", 62 | "danger": "#ff0039", 63 | "light":"#F8F9FA", 64 | "dark": "#373A3C", 65 | "bg": "#ffffff", 66 | "fg": "#373a3c", 67 | "selectbg": "#7e8081", 68 | "selectfg": "#ffffff", 69 | "border": "#ced4da", 70 | "inputfg": "#373a3c", 71 | "inputbg": "#fdfdfe" 72 | } 73 | } 74 | } 75 | ``` 76 | 77 | ## 导出用户主题 78 | 79 | 用户定义的主题可以导出为上面指定的格式 80 | 81 | 1.单击顶部菜单中的**导出**按钮 82 | 83 | 2.导航到您要导出的位置 84 | 85 | 3.选择一个有效的文件名;默认情况下,扩展名是`.py` 86 | 87 | 4.点击**确定**保存导出的设置 88 | -------------------------------------------------------------------------------- /docs_scripts/tutorial/button_colors.py: -------------------------------------------------------------------------------- 1 | import ttkbootstrap as ttk 2 | from ttkbootstrap.constants import * 3 | 4 | app = ttk.Window() 5 | 6 | frame = ttk.Frame(padding=10) 7 | frame.pack(padx=10, pady=10) 8 | 9 | for color in app.style.colors: 10 | b = ttk.Button(frame, text=color, bootstyle=color) 11 | b.pack(side=LEFT, padx=5, pady=5) 12 | 13 | app.mainloop() -------------------------------------------------------------------------------- /docs_scripts/tutorial/simple_usage.py: -------------------------------------------------------------------------------- 1 | import ttkbootstrap as ttk 2 | from ttkbootstrap.constants import * 3 | 4 | app = ttk.Window() 5 | 6 | frame = ttk.Frame(padding=5) 7 | frame.pack(padx=10, pady=10) 8 | 9 | b1 = ttk.Button(frame, text="Button 1", bootstyle="success") 10 | b1.pack(side=LEFT, padx=5, pady=10) 11 | 12 | b2 = ttk.Button(frame, text="Button 2", bootstyle="info-outline") 13 | b2.pack(side=LEFT, padx=5, pady=10) 14 | 15 | app.mainloop() -------------------------------------------------------------------------------- /docs_scripts/tutorial/solid_outline_button_styles.py: -------------------------------------------------------------------------------- 1 | import ttkbootstrap as ttk 2 | from ttkbootstrap.constants import * 3 | 4 | root = ttk.Window() 5 | 6 | frame = ttk.Frame(padding=5) 7 | frame.pack(padx=10, pady=10) 8 | 9 | b1 = ttk.Button(frame, text="Solid Button", bootstyle="success") 10 | b1.pack(side=LEFT, padx=5, pady=10) 11 | 12 | b2 = ttk.Button(frame, text="Outline Button", bootstyle="success-outline") 13 | b2.pack(side=LEFT, padx=5, pady=10) 14 | 15 | root.mainloop() -------------------------------------------------------------------------------- /docs_scripts/widget_styles/available_colors.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | frame = ttk.Frame(root, padding=10) 10 | frame.pack(fill=tk.BOTH, expand=tk.YES) 11 | row_one = ttk.Frame(frame) 12 | row_two = ttk.Frame(frame) 13 | 14 | for i, color in enumerate(style.colors): 15 | if i < 4: 16 | lbl = ttk.Button(row_one, text=color, bootstyle=color, width=12) 17 | else: 18 | lbl = ttk.Button(row_two, text=color, bootstyle=color, width=12) 19 | 20 | lbl.pack(side=tk.LEFT, expand=tk.YES, fill=tk.BOTH) 21 | 22 | row_one.pack(fill=tk.BOTH, expand=tk.YES, pady=(5, 0), padx=5) 23 | row_two.pack(fill=tk.BOTH, expand=tk.YES, pady=(0, 5), padx=5) 24 | 25 | root.mainloop() 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs_scripts/widget_styles/button_style.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | frame = ttk.Frame(padding=5) 10 | frame.pack(padx=5, pady=5, fill=tk.X) 11 | 12 | top_frame = ttk.Frame(frame) 13 | bot_frame = ttk.Frame(frame) 14 | top_frame.pack(fill=tk.X) 15 | bot_frame.pack(fill=tk.X) 16 | 17 | # --- Testing below --- 18 | 19 | # solid button 20 | for i, color in enumerate(['default', *style.colors]): 21 | if i < 5: 22 | a = ttk.Button(top_frame, text=color, bootstyle=color, width=12) 23 | else: 24 | a = ttk.Button(bot_frame, text=color, bootstyle=color, width=12) 25 | a.pack(side=tk.LEFT, padx=3, pady=10) 26 | a = ttk.Button(bot_frame, text='disabled', width=12, state=tk.DISABLED) 27 | a.pack(side=tk.LEFT, padx=3, pady=10) 28 | 29 | # outline button 30 | for i, color in enumerate(['default', *style.colors]): 31 | if i < 5: 32 | a = ttk.Button(top_frame, text=color, bootstyle=color + "outline", width=12) 33 | else: 34 | a = ttk.Button(bot_frame, text=color, bootstyle=color + "outline", width=12) 35 | a.pack(side=tk.LEFT, padx=3, pady=10) 36 | a = ttk.Button(bot_frame, text='disabled', width=12, bootstyle="outline", state=tk.DISABLED) 37 | a.pack(side=tk.LEFT, padx=3, pady=10) 38 | 39 | # link button 40 | for i, color in enumerate(['default', *style.colors]): 41 | if i < 5: 42 | a = ttk.Button(top_frame, text=color, bootstyle=color + "link", width=12) 43 | else: 44 | a = ttk.Button(bot_frame, text=color, bootstyle=color + "link", width=12) 45 | 46 | a.pack(side=tk.LEFT, padx=3, pady=10) 47 | a = ttk.Button(bot_frame, text='disabled', width=12, bootstyle="link", state=tk.DISABLED) 48 | a.pack(side=tk.LEFT, padx=3, pady=10) 49 | 50 | 51 | root.mainloop() -------------------------------------------------------------------------------- /docs_scripts/widget_styles/combo_style.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | frame = ttk.Frame(padding=5) 10 | frame.pack(padx=5, pady=5, fill=tk.X) 11 | 12 | frame1 = ttk.Frame(frame) 13 | frame2 = ttk.Frame(frame) 14 | frame3 = ttk.Frame(frame) 15 | frame1.pack(fill=tk.X) 16 | frame2.pack(fill=tk.X) 17 | frame3.pack(fill=tk.X) 18 | 19 | for i, color in enumerate(['default', *style.colors]): 20 | if i < 5: 21 | a = ttk.Combobox(frame1, bootstyle=color, width=12) 22 | else: 23 | a = ttk.Combobox(frame2, bootstyle=color, width=12) 24 | a.insert('end', color) 25 | a.pack(side=tk.LEFT, padx=3, pady=10) 26 | 27 | # disabled 28 | a = ttk.Combobox(frame3, width=12) 29 | a.insert(tk.END, 'disabled') 30 | a.pack(side=tk.LEFT, padx=3, pady=10) 31 | a.configure(state=tk.DISABLED) 32 | 33 | # readonly 34 | a = ttk.Combobox(frame3, width=12) 35 | a.insert(tk.END, 'readonly') 36 | a.pack(side=tk.LEFT, padx=3, pady=10) 37 | a.configure(state='readonly') 38 | 39 | 40 | root.mainloop() 41 | -------------------------------------------------------------------------------- /docs_scripts/widget_styles/date_entry.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | frame = ttk.Frame(padding=5) 10 | frame.pack(padx=5, pady=5, fill=tk.X) 11 | 12 | frame1 = ttk.Frame(frame) 13 | frame2 = ttk.Frame(frame) 14 | frame3 = ttk.Frame(frame) 15 | frame1.pack(fill=tk.X) 16 | frame2.pack(fill=tk.X) 17 | frame3.pack(fill=tk.X) 18 | 19 | for i, color in enumerate(['default', *style.colors]): 20 | if i < 5: 21 | f = ttk.Frame(frame1) 22 | ttk.Label(f, text=color, anchor=tk.CENTER).pack(fill=tk.X) 23 | else: 24 | f = ttk.Frame(frame2) 25 | ttk.Label(f, text=color, anchor=tk.CENTER).pack(fill=tk.X) 26 | 27 | a = ttk.DateEntry(f, bootstyle=color, width=12) 28 | a.pack(fill=tk.X) 29 | f.pack(side=tk.LEFT, padx=3, pady=10) 30 | 31 | # disabled 32 | f = ttk.Frame(frame3) 33 | ttk.Label(f, text='disabled', anchor=tk.CENTER).pack(fill=tk.X) 34 | a = ttk.DateEntry(f, width=12) 35 | a.pack(fill=tk.X) 36 | f.pack(side=tk.LEFT, padx=3, pady=10) 37 | a.configure(state=tk.DISABLED) 38 | 39 | # readonly 40 | f = ttk.Frame(frame3) 41 | ttk.Label(f, text='readonly', anchor=tk.CENTER).pack(fill=tk.X) 42 | a = ttk.DateEntry(f, width=12) 43 | a.pack(fill=tk.X) 44 | f.pack(side=tk.LEFT, padx=3, pady=10) 45 | a.configure(state='readonly') 46 | 47 | 48 | root.mainloop() 49 | -------------------------------------------------------------------------------- /docs_scripts/widget_styles/entry_style.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | frame = ttk.Frame(padding=5) 10 | frame.pack(padx=5, pady=5, fill=tk.X) 11 | 12 | frame1 = ttk.Frame(frame) 13 | frame2 = ttk.Frame(frame) 14 | frame3 = ttk.Frame(frame) 15 | frame1.pack(fill=tk.X) 16 | frame2.pack(fill=tk.X) 17 | frame3.pack(fill=tk.X) 18 | 19 | for i, color in enumerate(['default', *style.colors]): 20 | if i < 5: 21 | a = ttk.Entry(frame1, bootstyle=color, width=12) 22 | else: 23 | a = ttk.Entry(frame2, bootstyle=color, width=12) 24 | a.insert('end', color) 25 | a.pack(side=tk.LEFT, padx=3, pady=10) 26 | 27 | # disabled 28 | a = ttk.Entry(frame3, width=12) 29 | a.insert(tk.END, 'disabled') 30 | a.pack(side=tk.LEFT, padx=3, pady=10) 31 | a.configure(state=tk.DISABLED) 32 | 33 | # readonly 34 | a = ttk.Entry(frame3, width=12) 35 | a.insert(tk.END, 'readonly') 36 | a.pack(side=tk.LEFT, padx=3, pady=10) 37 | a.configure(state='readonly') 38 | 39 | 40 | root.mainloop() 41 | -------------------------------------------------------------------------------- /docs_scripts/widget_styles/floodgauge_style.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | 10 | frame = ttk.Frame(padding=10) 11 | frame.pack(padx=10, pady=10, expand=tk.YES, fill=tk.BOTH) 12 | 13 | top_frame = ttk.Frame(frame) 14 | top_frame.pack(fill=tk.BOTH, expand=tk.YES) 15 | 16 | bot_frame = ttk.Frame(frame) 17 | bot_frame.pack(fill=tk.BOTH, expand=tk.YES) 18 | 19 | for i, color in enumerate(['default', *style.colors]): 20 | if i < 5: 21 | p = ttk.Floodgauge( 22 | master=top_frame, 23 | bootstyle=color, 24 | text=color, 25 | value=65, 26 | ) 27 | else: 28 | p = ttk.Floodgauge( 29 | master=bot_frame, 30 | bootstyle=color, 31 | text=color, 32 | value=65, 33 | ) 34 | p.pack(padx=5, pady=5, fill=tk.BOTH, side=tk.LEFT) 35 | p.start() 36 | 37 | root.mainloop() 38 | -------------------------------------------------------------------------------- /docs_scripts/widget_styles/frame_style.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | frame = ttk.Frame(padding=10) 10 | frame.pack(padx=10, pady=10) 11 | 12 | top_frame = ttk.Frame(frame) 13 | top_frame.pack(fill=tk.BOTH) 14 | 15 | bot_frame = ttk.Frame(frame) 16 | bot_frame.pack(fill=tk.BOTH) 17 | 18 | for i, color in enumerate(['default', *style.colors]): 19 | if color == 'default': 20 | text_style = 'default' 21 | else: 22 | text_style = color + 'inverse' 23 | 24 | if i < 5: 25 | f = ttk.Frame(top_frame, bootstyle=color) 26 | else: 27 | f = ttk.Frame(bot_frame, bootstyle=color) 28 | 29 | f.pack(padx=5, pady=5, side=tk.LEFT) 30 | ttk.Label(f, text=color, anchor=tk.CENTER, bootstyle=text_style, 31 | width=10).pack(fill=tk.Y, expand=tk.YES, padx=15, pady=10) 32 | 33 | 34 | root.mainloop() -------------------------------------------------------------------------------- /docs_scripts/widget_styles/label_style.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | # normal label 10 | frame = ttk.Frame(padding=5) 11 | frame.pack(padx=5, pady=5, fill=tk.X) 12 | 13 | top_frame = ttk.Frame(frame) 14 | bot_frame = ttk.Frame(frame) 15 | top_frame.pack(fill=tk.X) 16 | bot_frame.pack(fill=tk.X) 17 | 18 | for i, color in enumerate(['default', *style.colors]): 19 | if i < 5: 20 | a = ttk.Label(top_frame, text=color, bootstyle=color, width=12) 21 | else: 22 | a = ttk.Label(bot_frame, text=color, bootstyle=color, width=12) 23 | 24 | a.pack(side=tk.LEFT, padx=3, pady=10) 25 | 26 | 27 | # # inverse label 28 | # frame = ttk.Frame(padding=5) 29 | # frame.pack(padx=5, pady=5, fill=tk.X) 30 | 31 | # top_frame = ttk.Frame(frame) 32 | # bot_frame = ttk.Frame(frame) 33 | # top_frame.pack(fill=tk.X) 34 | # bot_frame.pack(fill=tk.X) 35 | 36 | # for i, color in enumerate(['default', *style.colors]): 37 | # if i < 5: 38 | # a = ttk.Label(top_frame, text=color, bootstyle=color + "inverse", width=12) 39 | # else: 40 | # a = ttk.Label(bot_frame, text=color, bootstyle=color + "inverse", width=12) 41 | 42 | # a.pack(side=tk.LEFT, padx=3, pady=10) 43 | 44 | root.mainloop() -------------------------------------------------------------------------------- /docs_scripts/widget_styles/labelframe_style.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | frame = ttk.Frame(padding=10) 10 | frame.pack(padx=10, pady=10) 11 | 12 | top_frame = ttk.Frame(frame) 13 | top_frame.pack(fill=tk.BOTH) 14 | 15 | bot_frame = ttk.Frame(frame) 16 | bot_frame.pack(fill=tk.BOTH) 17 | 18 | for i, color in enumerate(['default', *style.colors]): 19 | 20 | if i < 5: 21 | f = ttk.Labelframe(top_frame, text=color, bootstyle=color, width=125, height=60) 22 | else: 23 | f = ttk.Labelframe(bot_frame, text=color, bootstyle=color, width=125, height=60) 24 | 25 | f.pack(padx=5, pady=5, side=tk.LEFT) 26 | 27 | root.mainloop() -------------------------------------------------------------------------------- /docs_scripts/widget_styles/menubutton_style.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | # menubutton 10 | frame = ttk.Frame(padding=5) 11 | frame.pack(padx=5, pady=5, fill=tk.X) 12 | 13 | top_frame = ttk.Frame(frame) 14 | bot_frame = ttk.Frame(frame) 15 | top_frame.pack(fill=tk.X) 16 | bot_frame.pack(fill=tk.X) 17 | 18 | for i, color in enumerate(['default', *style.colors]): 19 | if i < 5: 20 | a = ttk.Menubutton(top_frame, text=color, bootstyle=color, width=12) 21 | else: 22 | a = ttk.Menubutton(bot_frame, text=color, bootstyle=color, width=12) 23 | 24 | a.pack(side=tk.LEFT, padx=3, pady=10) 25 | a = ttk.Menubutton(bot_frame, text='disabled', width=12, state=tk.DISABLED) 26 | a.pack(side=tk.LEFT, padx=3, pady=10) 27 | 28 | 29 | # outline menubutton 30 | frame = ttk.Frame(padding=5) 31 | frame.pack(padx=5, pady=5, fill=tk.X) 32 | 33 | top_frame = ttk.Frame(frame) 34 | bot_frame = ttk.Frame(frame) 35 | top_frame.pack(fill=tk.X) 36 | bot_frame.pack(fill=tk.X) 37 | 38 | for i, color in enumerate(['default', *style.colors]): 39 | if i < 5: 40 | a = ttk.Menubutton(top_frame, text=color, bootstyle=color + "outline", width=12) 41 | else: 42 | a = ttk.Menubutton(bot_frame, text=color, bootstyle=color + "outline", width=12) 43 | 44 | a.pack(side=tk.LEFT, padx=3, pady=10) 45 | a = ttk.Menubutton(bot_frame, text='disabled', width=12, bootstyle='outline', state=tk.DISABLED) 46 | a.pack(side=tk.LEFT, padx=3, pady=10) 47 | 48 | root.mainloop() -------------------------------------------------------------------------------- /docs_scripts/widget_styles/meter_style.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | frame = ttk.Frame(root, padding=10) 10 | frame.pack(padx=10, pady=10) 11 | 12 | top_frame = ttk.Frame(frame) 13 | bot_frame = ttk.Frame(frame) 14 | top_frame.pack(fill=tk.X) 15 | bot_frame.pack() 16 | 17 | for i, color in enumerate(['default', *style.colors]): 18 | if i < 5: 19 | m = ttk.Meter( 20 | master=top_frame, 21 | metersize=150, 22 | amountused=100, 23 | subtext=color, 24 | bootstyle=color, 25 | interactive=True 26 | ) 27 | 28 | else: 29 | m = ttk.Meter( 30 | master=bot_frame, 31 | metersize=150, 32 | padding=5, 33 | amountused=100, 34 | subtext=color, 35 | bootstyle=color, 36 | interactive=True 37 | ) 38 | 39 | m.pack(side=tk.LEFT, padx=3) 40 | 41 | 42 | root.mainloop() -------------------------------------------------------------------------------- /docs_scripts/widget_styles/notebook_style.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | frame = ttk.Frame(padding=10) 10 | frame.pack(padx=10, pady=10) 11 | 12 | top_frame = ttk.Frame(frame) 13 | top_frame.pack(fill=tk.BOTH) 14 | 15 | bot_frame = ttk.Frame(frame) 16 | bot_frame.pack(fill=tk.BOTH) 17 | 18 | width = 200 19 | 20 | for i, color in enumerate(['default', *style.colors]): 21 | 22 | if i < 5: 23 | nb = ttk.Notebook(top_frame, bootstyle=color) 24 | nb.add(ttk.Frame(nb, width=width, height=40), text=color) 25 | nb.add(ttk.Frame(nb, width=width, height=40), text=color) 26 | else: 27 | nb = ttk.Notebook(bot_frame, bootstyle=color) 28 | nb.add(ttk.Frame(nb, width=width, height=40), text=color) 29 | nb.add(ttk.Frame(nb, width=width, height=40), text=color) 30 | 31 | nb.pack(padx=5, pady=5, side=tk.LEFT) 32 | 33 | root.mainloop() -------------------------------------------------------------------------------- /docs_scripts/widget_styles/panedwindow_style.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | frame = ttk.Frame(padding=5) 10 | frame.pack(padx=5, pady=5, fill=tk.X) 11 | 12 | top_frame = ttk.Frame(frame) 13 | bot_frame = ttk.Frame(frame) 14 | 15 | top_frame.pack(fill=tk.X) 16 | bot_frame.pack(fill=tk.X) 17 | 18 | for i, color in enumerate(['default', *style.colors]): 19 | if i < 5: 20 | pw = ttk.Panedwindow(top_frame, bootstyle=color) 21 | else: 22 | pw = ttk.Panedwindow(bot_frame, bootstyle=color) 23 | 24 | f = ttk.Frame(pw) 25 | f.pack(fill=tk.BOTH, expand=tk.YES) 26 | ttk.Label(f, text=color).pack(side=tk.TOP) 27 | pw.add(f) 28 | pw.add(ttk.Frame(width=120, height=30)) 29 | pw.pack(side=tk.LEFT, padx=3, pady=10, fill=tk.X) 30 | 31 | root.mainloop() 32 | -------------------------------------------------------------------------------- /docs_scripts/widget_styles/progressbar_style.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | frame = ttk.Frame(padding=5) 10 | frame.pack(padx=5, pady=5, fill=tk.X) 11 | 12 | top_frame = ttk.Frame(frame) 13 | bot_frame = ttk.Frame(frame) 14 | 15 | top_frame.pack(fill=tk.X) 16 | bot_frame.pack(fill=tk.X) 17 | 18 | for i, color in enumerate(['default', *style.colors]): 19 | if i < 5: 20 | f = ttk.Frame(top_frame) 21 | else: 22 | f = ttk.Frame(bot_frame) 23 | 24 | ttk.Label(f, text=color, width=20).pack(side=tk.TOP) 25 | a = ttk.Progressbar(f, bootstyle=color, orient=tk.HORIZONTAL) 26 | a.pack(fill=tk.X) 27 | a.start() 28 | f.pack(side=tk.LEFT, padx=3, pady=10, fill=tk.X) 29 | 30 | # for i, color in enumerate(['default', *style.colors]): 31 | # if i < 5: 32 | # f = ttk.Frame(top_frame) 33 | # else: 34 | # f = ttk.Frame(bot_frame) 35 | 36 | # ttk.Label(f, text=color, width=20).pack(side=tk.TOP) 37 | # a = ttk.Progressbar(f, bootstyle=color+'striped', orient=tk.HORIZONTAL) 38 | # a.pack(fill=tk.X) 39 | # a.start() 40 | # f.pack(side=tk.LEFT, padx=3, pady=10, fill=tk.X) 41 | 42 | root.mainloop() 43 | -------------------------------------------------------------------------------- /docs_scripts/widget_styles/scale_style.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | frame = ttk.Frame(padding=5) 10 | frame.pack(padx=5, pady=5, fill=tk.X) 11 | 12 | top_frame = ttk.Frame(frame) 13 | bot_frame = ttk.Frame(frame) 14 | 15 | top_frame.pack(fill=tk.X) 16 | bot_frame.pack(fill=tk.X) 17 | 18 | for i, color in enumerate(['default', *style.colors]): 19 | if i < 5: 20 | f = ttk.Frame(top_frame) 21 | else: 22 | f = ttk.Frame(bot_frame) 23 | 24 | ttk.Label(f, text=color, width=20).pack(side=tk.TOP) 25 | a = ttk.Scale(f, bootstyle=color, value=0.25) 26 | a.pack(fill=tk.X) 27 | f.pack(side=tk.LEFT, padx=3, pady=10, fill=tk.X) 28 | 29 | # disabled 30 | f = ttk.Frame(bot_frame) 31 | ttk.Label(f, text='disabled', width=20).pack(side=tk.TOP) 32 | a = ttk.Scale(f, state=tk.DISABLED, value=0.25) 33 | a.pack(fill=tk.X) 34 | f.pack(side=tk.LEFT, padx=3, pady=10, fill=tk.X) 35 | 36 | root.mainloop() 37 | -------------------------------------------------------------------------------- /docs_scripts/widget_styles/scrollbar_style.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | frame = ttk.Frame(padding=5) 10 | frame.pack(padx=5, pady=5, fill=tk.X) 11 | 12 | top_frame = ttk.Frame(frame) 13 | bot_frame = ttk.Frame(frame) 14 | 15 | top_frame.pack(fill=tk.X) 16 | bot_frame.pack(fill=tk.X) 17 | 18 | # for i, color in enumerate(['default', *style.colors]): 19 | # if i < 5: 20 | # f = ttk.Frame(top_frame) 21 | # else: 22 | # f = ttk.Frame(bot_frame) 23 | 24 | # ttk.Label(f, text=color, width=20).pack(side=tk.TOP) 25 | # a = ttk.Scrollbar(f, bootstyle=color, orient=tk.HORIZONTAL) 26 | # a.set(0, 1.0) 27 | # a.pack(fill=tk.X) 28 | # f.pack(side=tk.LEFT, padx=3, pady=10, fill=tk.X) 29 | 30 | for i, color in enumerate(['default', *style.colors]): 31 | if i < 5: 32 | f = ttk.Frame(top_frame) 33 | else: 34 | f = ttk.Frame(bot_frame) 35 | 36 | ttk.Label(f, text=color, width=20).pack(side=tk.TOP) 37 | a = ttk.Scrollbar(f, bootstyle=color+'round', orient=tk.HORIZONTAL) 38 | a.set(0, 1.0) 39 | a.pack(fill=tk.X) 40 | f.pack(side=tk.LEFT, padx=3, pady=10, fill=tk.X) 41 | 42 | root.mainloop() 43 | -------------------------------------------------------------------------------- /docs_scripts/widget_styles/separator_style.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | frame = ttk.Frame(padding=5) 10 | frame.pack(padx=5, pady=5, fill=tk.X) 11 | 12 | top_frame = ttk.Frame(frame) 13 | bot_frame = ttk.Frame(frame) 14 | 15 | top_frame.pack(fill=tk.X) 16 | bot_frame.pack(fill=tk.X) 17 | 18 | for i, color in enumerate(['default', *style.colors]): 19 | if i < 5: 20 | f = ttk.Frame(top_frame) 21 | else: 22 | f = ttk.Frame(bot_frame) 23 | 24 | ttk.Label(f, text=color, width=20).pack(side=tk.TOP) 25 | a = ttk.Separator(f, bootstyle=color) 26 | a.pack(fill=tk.X) 27 | f.pack(side=tk.LEFT, padx=3, pady=10, fill=tk.X) 28 | 29 | root.mainloop() 30 | -------------------------------------------------------------------------------- /docs_scripts/widget_styles/sizegrip_style.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | frame = ttk.Frame(padding=5) 10 | frame.pack(padx=5, pady=5, fill=tk.X) 11 | 12 | top_frame = ttk.Frame(frame) 13 | bot_frame = ttk.Frame(frame) 14 | 15 | top_frame.pack(fill=tk.X) 16 | bot_frame.pack(fill=tk.X) 17 | 18 | for i, color in enumerate(['default', *style.colors]): 19 | if i < 5: 20 | f = ttk.Frame(top_frame) 21 | else: 22 | f = ttk.Frame(bot_frame) 23 | 24 | ttk.Label(f, text=color, width=12, anchor=tk.CENTER).pack(padx=15) 25 | sg = ttk.Sizegrip(f, bootstyle=color) 26 | sg.pack(fill=tk.BOTH, expand=tk.YES) 27 | f.pack(side=tk.LEFT, padx=3, pady=10, fill=tk.X) 28 | 29 | root.mainloop() 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /docs_scripts/widget_styles/spinbox_style.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | frame = ttk.Frame(padding=5) 10 | frame.pack(padx=5, pady=5, fill=tk.X) 11 | frame1 = ttk.Frame(frame) 12 | frame2 = ttk.Frame(frame) 13 | frame3 = ttk.Frame(frame) 14 | frame1.pack(fill=tk.X) 15 | frame2.pack(fill=tk.X) 16 | frame3.pack(fill=tk.X) 17 | 18 | for i, color in enumerate(['default', *style.colors]): 19 | if i < 5: 20 | a = ttk.Spinbox(frame1, bootstyle=color, width=12) 21 | else: 22 | a = ttk.Spinbox(frame2, bootstyle=color, width=12) 23 | a.insert('end', color) 24 | a.pack(side=tk.LEFT, padx=3, pady=10) 25 | 26 | # disabled 27 | a = ttk.Spinbox(frame3, width=12) 28 | a.insert(tk.END, 'disabled') 29 | a.pack(side=tk.LEFT, padx=3, pady=10) 30 | a.configure(state=tk.DISABLED) 31 | 32 | # readonly 33 | a = ttk.Spinbox(frame3, width=12) 34 | a.insert(tk.END, 'readonly') 35 | a.pack(side=tk.LEFT, padx=3, pady=10) 36 | a.configure(state='readonly') 37 | 38 | 39 | root.mainloop() 40 | -------------------------------------------------------------------------------- /docs_scripts/widget_styles/treeview_style.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | root = tk.Tk() 7 | style = ttk.Style() 8 | 9 | frame = ttk.Frame(padding=10) 10 | frame.pack(padx=10, pady=10) 11 | 12 | top_frame = ttk.Frame(frame) 13 | top_frame.pack(fill=tk.BOTH, expand=tk.YES) 14 | 15 | bot_frame = ttk.Frame(frame) 16 | bot_frame.pack(fill=tk.BOTH, expand=tk.YES) 17 | 18 | for i, color in enumerate(['default', *style.colors]): 19 | if color == 'default': 20 | text_style = 'default' 21 | else: 22 | text_style = color + 'inverse' 23 | 24 | if i < 5: 25 | tv = ttk.Treeview( 26 | master=top_frame, 27 | bootstyle=color, 28 | height=5, 29 | ) 30 | else: 31 | tv = ttk.Treeview( 32 | master=bot_frame, 33 | bootstyle=color, 34 | height=5, 35 | ) 36 | 37 | tv.column('#0') 38 | tv.heading('#0', text=color, anchor=tk.W) 39 | 40 | iid = tv.insert('', tk.END, text='parent 1') 41 | tv.insert(iid, tk.END, text='child 1') 42 | tv.insert(iid, tk.END, text='child 2') 43 | tv.insert(iid, tk.END, text='child 2') 44 | tv.insert('', tk.END, text='parent 2') 45 | tv.pack(padx=5, pady=5) 46 | tv.selection_add(iid) 47 | 48 | tv.pack(padx=5, pady=5, side=tk.LEFT) 49 | 50 | root.mainloop() -------------------------------------------------------------------------------- /gallery/assets/backup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/backup.png -------------------------------------------------------------------------------- /gallery/assets/icons8_add_book_24px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_add_book_24px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_add_folder_24px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_add_folder_24px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_broom_32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_broom_32px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_broom_64px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_broom_64px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_broom_64px_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_broom_64px_1.png -------------------------------------------------------------------------------- /gallery/assets/icons8_broom_80px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_broom_80px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_cancel_24px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_cancel_24px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_cancel_24px_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_cancel_24px_1.png -------------------------------------------------------------------------------- /gallery/assets/icons8_double_right_24px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_double_right_24px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_double_right_24px_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_double_right_24px_1.png -------------------------------------------------------------------------------- /gallery/assets/icons8_double_up_24px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_double_up_24px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_double_up_24px_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_double_up_24px_1.png -------------------------------------------------------------------------------- /gallery/assets/icons8_file_24px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_file_24px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_folder_24px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_folder_24px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_opened_folder_24px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_opened_folder_24px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_opened_folder_24px_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_opened_folder_24px_1.png -------------------------------------------------------------------------------- /gallery/assets/icons8_play_24px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_play_24px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_play_24px_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_play_24px_1.png -------------------------------------------------------------------------------- /gallery/assets/icons8_protect_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_protect_40px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_refresh_24px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_refresh_24px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_refresh_24px_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_refresh_24px_1.png -------------------------------------------------------------------------------- /gallery/assets/icons8_registry_editor_32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_registry_editor_32px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_registry_editor_64px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_registry_editor_64px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_settings_24px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_settings_24px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_settings_24px_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_settings_24px_2.png -------------------------------------------------------------------------------- /gallery/assets/icons8_settings_32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_settings_32px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_settings_64px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_settings_64px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_spy_80px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_spy_80px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_star_24px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_star_24px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_stop_24px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_stop_24px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_stop_24px_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_stop_24px_1.png -------------------------------------------------------------------------------- /gallery/assets/icons8_trash_can_80px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_trash_can_80px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_wrench_32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_wrench_32px.png -------------------------------------------------------------------------------- /gallery/assets/icons8_wrench_64px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/icons8_wrench_64px.png -------------------------------------------------------------------------------- /gallery/assets/magic_mouse/icons8_ask_question_24px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/magic_mouse/icons8_ask_question_24px.png -------------------------------------------------------------------------------- /gallery/assets/magic_mouse/icons8_bluetooth_2_16px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/magic_mouse/icons8_bluetooth_2_16px.png -------------------------------------------------------------------------------- /gallery/assets/magic_mouse/icons8_buy_26px_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/magic_mouse/icons8_buy_26px_1.png -------------------------------------------------------------------------------- /gallery/assets/magic_mouse/icons8_buy_26px_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/magic_mouse/icons8_buy_26px_2.png -------------------------------------------------------------------------------- /gallery/assets/magic_mouse/icons8_move_16px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/magic_mouse/icons8_move_16px.png -------------------------------------------------------------------------------- /gallery/assets/magic_mouse/icons8_question_mark_16px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/magic_mouse/icons8_question_mark_16px.png -------------------------------------------------------------------------------- /gallery/assets/magic_mouse/icons8_reset_16px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/magic_mouse/icons8_reset_16px.png -------------------------------------------------------------------------------- /gallery/assets/magic_mouse/icons8_reset_24px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/magic_mouse/icons8_reset_24px.png -------------------------------------------------------------------------------- /gallery/assets/magic_mouse/icons8_submit_progress_24px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/magic_mouse/icons8_submit_progress_24px.png -------------------------------------------------------------------------------- /gallery/assets/magic_mouse/icons8_undo_24px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/magic_mouse/icons8_undo_24px.png -------------------------------------------------------------------------------- /gallery/assets/magic_mouse/magic_mouse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/magic_mouse/magic_mouse.png -------------------------------------------------------------------------------- /gallery/assets/mp_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/assets/mp_background.png -------------------------------------------------------------------------------- /gallery/equalizer.py: -------------------------------------------------------------------------------- 1 | """ 2 | Author: Israel Dryer 3 | Modified: 2021-12-10 4 | """ 5 | import ttkbootstrap as ttk 6 | from ttkbootstrap.constants import * 7 | from random import randint 8 | 9 | 10 | class Equalizer(ttk.Frame): 11 | 12 | def __init__(self, master): 13 | super().__init__(master, padding=20) 14 | self.pack(fill=BOTH, expand=YES) 15 | 16 | controls = ["VOL", "31.25", "62.5", "125", "250", 17 | "500", "1K", "2K", "4K", "8K", "16K", "GAIN"] 18 | 19 | for control in controls: 20 | self.create_band(self, control) 21 | 22 | def create_band(self, master, text): 23 | """Create and pack an equalizer band""" 24 | value = randint(1, 99) 25 | self.setvar(text, value) 26 | 27 | container = ttk.Frame(master) 28 | container.pack(side=LEFT, fill=Y, padx=10) 29 | 30 | # header label 31 | hdr = ttk.Label(container, text=text, anchor=CENTER) 32 | hdr.pack(side=TOP, fill=X, pady=10) 33 | 34 | # volume scale 35 | if text in ["VOL", "GAIN"]: 36 | bootstyle = SUCCESS 37 | else: 38 | bootstyle = INFO 39 | 40 | scale = ttk.Scale( 41 | master=container, 42 | orient=VERTICAL, 43 | from_=99, 44 | to=1, 45 | value=value, 46 | command=lambda x=value, y=text: self.update_value(x, y), 47 | bootstyle=bootstyle, 48 | ) 49 | scale.pack(fill=Y) 50 | 51 | # value label 52 | val = ttk.Label(master=container, textvariable=text) 53 | val.pack(pady=10) 54 | 55 | def update_value(self, value, name): 56 | self.setvar(name, f"{float(value):.0f}") 57 | 58 | 59 | if __name__ == "__main__": 60 | 61 | app = ttk.Window("Equalizer", "litera", resizable=(False, False)) 62 | Equalizer(app) 63 | app.mainloop() 64 | -------------------------------------------------------------------------------- /gallery/images/back_me_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/images/back_me_up.png -------------------------------------------------------------------------------- /gallery/images/calculator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/images/calculator.png -------------------------------------------------------------------------------- /gallery/images/collapsing_frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/images/collapsing_frame.png -------------------------------------------------------------------------------- /gallery/images/equalizer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/images/equalizer.png -------------------------------------------------------------------------------- /gallery/images/file_search_engine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/images/file_search_engine.png -------------------------------------------------------------------------------- /gallery/images/long_running_determinate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/images/long_running_determinate.png -------------------------------------------------------------------------------- /gallery/images/long_running_indeterminate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/images/long_running_indeterminate.png -------------------------------------------------------------------------------- /gallery/images/magic_mouse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/images/magic_mouse.png -------------------------------------------------------------------------------- /gallery/images/media_player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/images/media_player.png -------------------------------------------------------------------------------- /gallery/images/pc_cleaner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/images/pc_cleaner.png -------------------------------------------------------------------------------- /gallery/images/simple_data_entry_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/images/simple_data_entry_dark.png -------------------------------------------------------------------------------- /gallery/images/simple_data_entry_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/images/simple_data_entry_light.png -------------------------------------------------------------------------------- /gallery/images/text_reader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/images/text_reader.png -------------------------------------------------------------------------------- /gallery/images/timer_widget_paused.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/images/timer_widget_paused.png -------------------------------------------------------------------------------- /gallery/images/timer_widget_started.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/gallery/images/timer_widget_started.png -------------------------------------------------------------------------------- /gallery/screenshot.py: -------------------------------------------------------------------------------- 1 | import pathlib 2 | 3 | from PIL import ImageGrab 4 | 5 | 6 | class Screenshot: 7 | 8 | def __init__(self, parent, filename): 9 | self.parent = parent 10 | self.parent.bind("", self.get_bounding_box) 11 | self.filename = filename 12 | 13 | def get_bounding_box(self, event): 14 | """ 15 | Take a screenshot of the current demo window and save to images 16 | """ 17 | # bounding box 18 | titlebar = 31 19 | x1 = self.parent.winfo_rootx() - 1 20 | y1 = self.parent.winfo_rooty() - titlebar 21 | x2 = x1 + self.parent.winfo_width() + 2 22 | y2 = y1 + self.parent.winfo_height() + titlebar + 1 23 | self.parent.after_idle(self.save_screenshot, [x1, y1, x2, y2]) 24 | 25 | def save_screenshot(self, bbox): 26 | # screenshot 27 | img = ImageGrab.grab(bbox=bbox) 28 | 29 | # image name 30 | img.save(self.filename, 'png') 31 | print(self.filename) 32 | -------------------------------------------------------------------------------- /gallery/text_reader.py: -------------------------------------------------------------------------------- 1 | """ 2 | Author: Israel Dryer 3 | Modified: 2021-12-12 4 | """ 5 | import ttkbootstrap as ttk 6 | from ttkbootstrap.constants import * 7 | from ttkbootstrap.scrolled import ScrolledText 8 | from tkinter.filedialog import askopenfilename 9 | 10 | 11 | class TextReader(ttk.Frame): 12 | 13 | def __init__(self, master): 14 | super().__init__(master, padding=15) 15 | self.filename = ttk.StringVar() 16 | self.pack(fill=BOTH, expand=YES) 17 | self.create_widget_elements() 18 | 19 | def create_widget_elements(self): 20 | """Create and add the widget elements""" 21 | style = ttk.Style() 22 | self.textbox = ScrolledText( 23 | master=self, 24 | highlightcolor=style.colors.primary, 25 | highlightbackground=style.colors.border, 26 | highlightthickness=1, 27 | autohide=True 28 | ) 29 | self.textbox.pack(fill=BOTH) 30 | default_txt = "Click the browse button to open a new text file." 31 | self.textbox.insert(END, default_txt) 32 | 33 | file_entry = ttk.Entry(self, textvariable=self.filename) 34 | file_entry.pack(side=LEFT, fill=X, expand=YES, padx=(0, 5), pady=10) 35 | 36 | browse_btn = ttk.Button(self, text="Browse", command=self.open_file) 37 | browse_btn.pack(side=RIGHT, fill=X, padx=(5, 0), pady=10) 38 | 39 | def open_file(self): 40 | path = askopenfilename() 41 | if not path: 42 | return 43 | 44 | with open(path, encoding='utf-8') as f: 45 | self.textbox.delete('1.0', END) 46 | self.textbox.insert(END, f.read()) 47 | self.filename.set(path) 48 | 49 | 50 | if __name__ == '__main__': 51 | 52 | app = ttk.Window("Text Reader", "sandstone") 53 | TextReader(app) 54 | app.mainloop() 55 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=61", "wheel"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "ttkbootstrap" 7 | version = "1.13.10" 8 | description = "A supercharged theme extension for tkinter that enables on-demand modern flat style themes inspired by Bootstrap." 9 | readme = "README.md" 10 | requires-python = ">=3.8" 11 | license = { text = "MIT" } 12 | authors = [ 13 | { name="Israel Dryer", email="israel.dryer@gmail.com" } 14 | ] 15 | keywords = [ 16 | "tkinter", 17 | "theme", 18 | "ttk", 19 | "bootstrap", 20 | "gui", 21 | "desktop", 22 | "python3", 23 | "ui", 24 | "widgets", 25 | "theming", 26 | "cross-platform", 27 | "modern", 28 | "responsive", 29 | "python-gui" 30 | ] 31 | classifiers = [ 32 | "Development Status :: 5 - Production/Stable", 33 | "Environment :: Win32 (MS Windows)", 34 | "Environment :: X11 Applications :: GTK", 35 | "Intended Audience :: Developers", 36 | "License :: OSI Approved :: MIT License", 37 | "Programming Language :: Python :: 3", 38 | "Programming Language :: Python :: 3.8", 39 | "Programming Language :: Python :: 3.9", 40 | "Programming Language :: Python :: 3.10", 41 | "Programming Language :: Python :: 3.11", 42 | "Programming Language :: Python :: 3.12", 43 | "Programming Language :: Python :: 3.13", 44 | "Topic :: Software Development :: User Interfaces", 45 | "Operating System :: OS Independent", 46 | ] 47 | 48 | dependencies = [ 49 | "pillow>=10,<11", 50 | ] 51 | 52 | [project.urls] 53 | Homepage = "https://github.com/israel-dryer/ttkbootstrap" 54 | Documentation = "https://ttkbootstrap.readthedocs.io/en/latest/" 55 | 56 | [tool.setuptools.packages.find] 57 | where = ["src"] 58 | 59 | [tool.setuptools.package-data] 60 | "ttkbootstrap" = ["localization/msgs/*.msg", "themes/*.json", "assets/*"] 61 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | mkdocs>=1.5,<2.0 2 | mkdocs-material==9.6.14 3 | mkdocs-static-i18n==1.3.0 4 | mkdocs-autorefs>=1.0 5 | mkdocstrings[python]>=0.24 6 | pymdown-extensions>=10.0 7 | Pillow>=10.3.0,<11 8 | -------------------------------------------------------------------------------- /setup_project.bat: -------------------------------------------------------------------------------- 1 | ECHO OFF 2 | ECHO setting up virtual python environment 3 | python -m venv venv 4 | ECHO installing requirements.txt 5 | venv\scripts\python.exe -m pip install -r requirements.txt 6 | ECHO installing ttkbootstrap 7 | venv\scripts\python.exe -m pip install -e . 8 | ECHO ttkbootstrap environment setup is complete -------------------------------------------------------------------------------- /src/ttkbootstrap/__init__.py: -------------------------------------------------------------------------------- 1 | from ttkbootstrap.style import Style 2 | from ttkbootstrap.style import Bootstyle 3 | from ttkbootstrap.widgets import * 4 | from ttkbootstrap.window import Window, Toplevel 5 | 6 | from tkinter.scrolledtext import ScrolledText 7 | from tkinter import Variable, StringVar, IntVar, BooleanVar, DoubleVar 8 | from tkinter import Canvas, Menu, Text 9 | from tkinter import PhotoImage 10 | 11 | Bootstyle.setup_ttkbootstrap_api() 12 | -------------------------------------------------------------------------------- /src/ttkbootstrap/constants.py: -------------------------------------------------------------------------------- 1 | from tkinter.constants import * 2 | 3 | DEFAULT = 'default' 4 | DEFAULT_THEME = 'litera' 5 | TTK_CLAM = 'clam' 6 | TTK_ALT = 'alt' 7 | TTK_DEFAULT = 'default' 8 | 9 | # meter constants 10 | FULL = 'full' 11 | SEMI = 'semi' 12 | 13 | # progressbar constant 14 | DETERMINATE = 'determinate' 15 | INDETERMINATE = 'indeterminate' 16 | 17 | # bootstyle colors 18 | PRIMARY = 'primary' 19 | SECONDARY = 'secondary' 20 | SUCCESS = 'success' 21 | DANGER = 'danger' 22 | WARNING = 'warning' 23 | INFO = 'info' 24 | LIGHT = 'light' 25 | DARK = 'dark' 26 | 27 | # bootstyle types 28 | OUTLINE = 'outline' 29 | LINK = 'link' 30 | TOGGLE = 'toggle' 31 | INVERSE = 'inverse' 32 | STRIPED = 'striped' 33 | TOOLBUTTON = 'toolbutton' 34 | ROUND = 'round' 35 | SQUARE = 'square' 36 | 37 | # treeview constants 38 | TREE = 'tree' 39 | HEADINGS = 'headings' 40 | TREEHEADINGS = 'tree headings' 41 | 42 | # state constants 43 | READONLY = 'readonly' 44 | -------------------------------------------------------------------------------- /src/ttkbootstrap/dialogs/__init__.py: -------------------------------------------------------------------------------- 1 | from ttkbootstrap.dialogs.dialogs import * -------------------------------------------------------------------------------- /src/ttkbootstrap/localization/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | A partial wrapper on the tcl/tk msgcat (Tcl message catalog) 3 | 4 | The MessageCatalog provides a set of functions that can be used to 5 | manage multi-lingual user interfaces. Text strings are defined in a 6 | “message catalog” which is independent from the application, and 7 | which can be edited or localized without modifying the application 8 | source code. New languages or locales may be provided by adding a 9 | new file to the message catalog. 10 | 11 | https://www.tcl.tk/man/tcl/TclCmd/msgcat.html 12 | """ 13 | from ttkbootstrap.localization.msgs import initialize_localities 14 | from ttkbootstrap.localization.msgcat import MessageCatalog 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/ttkbootstrap/themes/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/src/ttkbootstrap/themes/__init__.py -------------------------------------------------------------------------------- /src/ttkbootstrap/themes/user.py: -------------------------------------------------------------------------------- 1 | USER_THEMES={} -------------------------------------------------------------------------------- /src/ttkcreator/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/israel-dryer/ttkbootstrap/b63b949e509924468424b65cb771e00fe08595ed/src/ttkcreator/__init__.py -------------------------------------------------------------------------------- /tests/features/change_bootstyle_with_configure.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | 4 | """ 5 | Test that the `Widget.configure` method is able to change the widget 6 | style via the `bootstyle` parameter. 7 | """ 8 | 9 | root = tk.Tk() 10 | style = ttk.Style() 11 | colors = style.theme.colors 12 | 13 | btn = ttk.Button(root, text="Push Button", bootstyle='outline-danger') 14 | btn.pack(padx=10, pady=10) 15 | 16 | # initial style 17 | ttkstyle = btn.cget('style') 18 | assert ttkstyle == 'danger.Outline.TButton' 19 | 20 | # intial bordercolor 21 | bordercolor = style.lookup(ttkstyle, 'bordercolor') 22 | assert bordercolor == colors.danger 23 | 24 | # change the style with `configure` 25 | btn.configure(bootstyle='link-success') 26 | 27 | # new style 28 | ttkstyle = btn.cget('style') 29 | assert ttkstyle == 'success.Link.TButton' 30 | 31 | # foreground color 32 | foreground = style.lookup(ttkstyle, 'foreground') 33 | assert foreground == colors.success 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /tests/features/change_bootstyle_with_setitem.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | 4 | """ 5 | Test that Widget['bootstyle'] = value is able to change the widget 6 | """ 7 | 8 | root = tk.Tk() 9 | style = ttk.Style() 10 | colors = style.theme.colors 11 | 12 | btn = ttk.Button(root, text="Push Button", bootstyle='outline-danger') 13 | btn.pack(padx=10, pady=10) 14 | 15 | # initial style 16 | ttkstyle = btn.cget('style') 17 | assert ttkstyle == 'danger.Outline.TButton' 18 | 19 | # intial bordercolor 20 | bordercolor = style.lookup(ttkstyle, 'bordercolor') 21 | assert bordercolor == colors.danger 22 | 23 | # change the style with `configure` 24 | btn['bootstyle'] = 'link-success' 25 | 26 | # new style 27 | ttkstyle = btn.cget('style') 28 | assert ttkstyle == 'success.Link.TButton' 29 | 30 | # foreground color 31 | foreground = style.lookup(ttkstyle, 'foreground') 32 | assert foreground == colors.success 33 | -------------------------------------------------------------------------------- /tests/features/get_bootstyle_value_configure.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | 4 | """ 5 | Test that the `Widget.configure` method is able to change the widget 6 | style via the `bootstyle` parameter. 7 | """ 8 | 9 | root = tk.Tk() 10 | style = ttk.Style() 11 | colors = style.theme.colors 12 | 13 | btn = ttk.Button(root, text="Push Button", bootstyle='outline-danger') 14 | btn.pack(padx=10, pady=10) 15 | 16 | ttkstyle = btn.configure('style') 17 | assert ttkstyle == 'danger.Outline.TButton' 18 | 19 | -------------------------------------------------------------------------------- /tests/features/get_bootstyle_value_with_getitem.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | 4 | """ 5 | Test that the `Widget.configure` method is able to change the widget 6 | style via the `bootstyle` parameter. 7 | """ 8 | 9 | root = tk.Tk() 10 | style = ttk.Style() 11 | colors = style.theme.colors 12 | 13 | btn = ttk.Button(root, text="Push Button", bootstyle='outline-danger') 14 | btn.pack(padx=10, pady=10) 15 | 16 | ttkstyle = btn['style'] 17 | assert ttkstyle == 'danger.Outline.TButton' 18 | -------------------------------------------------------------------------------- /tests/features/start_with_style_method.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from random import choice 4 | 5 | """ 6 | Expected Results 7 | - background is dark 8 | - only one instance of `BootStyle` or `Tk` 9 | """ 10 | 11 | style = ttk.Style(theme="darkly") 12 | 13 | root = style.master 14 | 15 | root.mainloop() -------------------------------------------------------------------------------- /tests/widget_styles/test_button.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from random import choice 4 | from ttkbootstrap import utility 5 | utility.enable_high_dpi_awareness() 6 | 7 | DARK = 'superhero' 8 | LIGHT = 'flatly' 9 | 10 | 11 | def button_style_frame(bootstyle, style, widget_name): 12 | frame = ttk.Frame(root, padding=5) 13 | 14 | title = ttk.Label( 15 | master=frame, 16 | text=widget_name, 17 | anchor=tk.CENTER 18 | ) 19 | title.pack(padx=5, pady=2, fill=tk.BOTH) 20 | 21 | ttk.Separator(frame).pack(padx=5, pady=5, fill=tk.X) 22 | 23 | ttk.Button( 24 | master=frame, 25 | text='default', 26 | bootstyle=bootstyle 27 | ).pack(padx=5, pady=5, fill=tk.BOTH) 28 | 29 | for color in style.colors: 30 | ttk.Button( 31 | master=frame, 32 | text=color, 33 | bootstyle=f'{color}-{bootstyle}' 34 | ).pack(padx=5, pady=5, fill=tk.BOTH) 35 | 36 | ttk.Button( 37 | master=frame, 38 | text='disabled', 39 | state=tk.DISABLED, 40 | bootstyle=bootstyle 41 | ).pack(padx=5, pady=5, fill=tk.BOTH) 42 | 43 | return frame 44 | 45 | def change_style(): 46 | theme = choice(style.theme_names()) 47 | style.theme_use(theme) 48 | print(theme) 49 | 50 | 51 | 52 | if __name__ == '__main__': 53 | # create visual widget style tests 54 | root = tk.Tk() 55 | style = ttk.Style(theme='minty') 56 | 57 | button_style_frame('outline', style, 'Outline Button').pack(side=tk.LEFT) 58 | button_style_frame('', style, 'Solid Button').pack(side=tk.LEFT) 59 | button_style_frame('link', style, 'Link Button').pack(side=tk.LEFT) 60 | ttk.Button(text="Change Theme", command=change_style).pack(padx=10, pady=10) 61 | 62 | root.mainloop() 63 | -------------------------------------------------------------------------------- /tests/widget_styles/test_combobox.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from random import choice 4 | from ttkbootstrap import utility 5 | utility.enable_high_dpi_awareness() 6 | 7 | DARK = 'superhero' 8 | LIGHT = 'flatly' 9 | 10 | def create_combobox_test(bootstyle, style, test_name): 11 | frame = ttk.Frame(padding=10) 12 | 13 | # title 14 | title = ttk.Label( 15 | master=frame, 16 | text=test_name, 17 | anchor=tk.CENTER 18 | ) 19 | title.pack(padx=5, pady=2, fill=tk.BOTH) 20 | ttk.Separator(frame).pack(padx=5, pady=5, fill=tk.X) 21 | 22 | # default 23 | cbo = ttk.Combobox( 24 | master=frame, 25 | values=['default', 'other'], 26 | bootstyle=bootstyle 27 | ) 28 | cbo.pack(padx=5, pady=5, fill=tk.BOTH) 29 | cbo.current(0) 30 | 31 | # color 32 | for color in style.theme.colors: 33 | cbo = ttk.Combobox( 34 | master=frame, 35 | values=[color, 'other'], 36 | bootstyle=(color, bootstyle) 37 | ) 38 | cbo.pack(padx=5, pady=5, fill=tk.BOTH) 39 | cbo.current(0) 40 | 41 | # disabled 42 | cbo = ttk.Combobox( 43 | master=frame, 44 | values=[bootstyle,'other'], 45 | bootstyle=bootstyle, 46 | state=tk.DISABLED 47 | ) 48 | cbo.pack(padx=5, pady=5, fill=tk.BOTH) 49 | cbo.current(0) 50 | 51 | return frame 52 | 53 | def change_style(): 54 | theme = choice(style.theme_names()) 55 | style.theme_use(theme) 56 | 57 | 58 | if __name__ == '__main__': 59 | # create visual widget style tests 60 | root = tk.Tk() 61 | style = ttk.Style() 62 | 63 | ttk.Button(text="Change Theme", command=change_style).pack(padx=10, pady=10) 64 | 65 | test1 = create_combobox_test('TCombobox', style, 'Combobox') 66 | test1.pack(side=tk.LEFT, fill=tk.BOTH) 67 | 68 | root.mainloop() -------------------------------------------------------------------------------- /tests/widget_styles/test_date_button.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from random import choice 4 | from ttkbootstrap import utility 5 | utility.enable_high_dpi_awareness() 6 | 7 | DARK = 'superhero' 8 | LIGHT = 'flatly' 9 | 10 | 11 | def button_style_frame(bootstyle, style, widget_name): 12 | frame = ttk.Frame(root, padding=5) 13 | 14 | title = ttk.Label( 15 | master=frame, 16 | text=widget_name, 17 | anchor=tk.CENTER 18 | ) 19 | title.pack(padx=5, pady=2, fill=tk.BOTH) 20 | 21 | ttk.Separator(frame).pack(padx=5, pady=5, fill=tk.X) 22 | 23 | ttk.Button( 24 | master=frame, 25 | text='default', 26 | bootstyle=bootstyle 27 | ).pack(padx=5, pady=5) 28 | 29 | for color in style.colors: 30 | ttk.Button( 31 | master=frame, 32 | text=color, 33 | bootstyle=f'{color}-{bootstyle}' 34 | ).pack(padx=5, pady=5) 35 | 36 | ttk.Button( 37 | master=frame, 38 | text='disabled', 39 | state=tk.DISABLED, 40 | bootstyle=bootstyle 41 | ).pack(padx=5, pady=5) 42 | 43 | return frame 44 | 45 | def change_style(): 46 | theme = choice(style.theme_names()) 47 | style.theme_use(theme) 48 | 49 | 50 | 51 | if __name__ == '__main__': 52 | # create visual widget style tests 53 | root = tk.Tk() 54 | style = ttk.Style(theme='minty') 55 | 56 | button_style_frame('date', style, 'Outline Button').pack(side=tk.LEFT) 57 | 58 | ttk.Button(text="Change Theme", command=change_style).pack(padx=10, pady=10) 59 | 60 | root.mainloop() 61 | -------------------------------------------------------------------------------- /tests/widget_styles/test_date_entry.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from random import choice 4 | from ttkbootstrap import utility 5 | utility.enable_high_dpi_awareness() 6 | 7 | DARK = 'superhero' 8 | LIGHT = 'flatly' 9 | 10 | 11 | def create_entry_test(style): 12 | frame = ttk.Frame(padding=10) 13 | 14 | # title 15 | title = ttk.Label(frame, text='DateEntry', anchor=tk.CENTER) 16 | title.pack(padx=5, pady=2, fill=tk.BOTH) 17 | ttk.Separator(frame).pack(padx=5, pady=5, fill=tk.X) 18 | 19 | # default 20 | ttk.Label(frame, text='default').pack() 21 | entry = ttk.DateEntry(frame) 22 | entry.pack(padx=5, pady=5, fill=tk.BOTH) 23 | 24 | # color 25 | for color in style.theme.colors: 26 | ttk.Label(frame, text=color).pack() 27 | entry = ttk.DateEntry(frame, bootstyle=color) 28 | entry.pack(padx=5, pady=5, fill=tk.BOTH) 29 | 30 | ttk.Label(frame, text='disabled').pack() 31 | entry = ttk.DateEntry(frame) 32 | entry.configure(state=tk.DISABLED) 33 | entry.pack(padx=5, pady=5, fill=tk.BOTH) 34 | 35 | ttk.Label(frame, text='readonly').pack() 36 | entry = ttk.DateEntry(frame) 37 | entry.configure(state='readonly') 38 | entry.pack(padx=5, pady=5, fill=tk.BOTH) 39 | 40 | 41 | return frame 42 | 43 | 44 | def change_style(): 45 | theme = choice(style.theme_names()) 46 | style.theme_use(theme) 47 | 48 | 49 | if __name__ == '__main__': 50 | # create visual widget style tests 51 | root = tk.Tk() 52 | style = ttk.Style() 53 | 54 | ttk.Button(text="Change Theme", command=change_style).pack(padx=10, pady=10) 55 | 56 | test1 = create_entry_test(style) 57 | test1.pack(side=tk.LEFT, fill=tk.BOTH) 58 | 59 | root.mainloop() 60 | -------------------------------------------------------------------------------- /tests/widget_styles/test_entry.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap.constants import * 4 | from random import choice 5 | 6 | DARK = 'superhero' 7 | LIGHT = 'flatly' 8 | 9 | 10 | def create_entry_test(bootstyle, style): 11 | frame = ttk.Frame(padding=10) 12 | 13 | # title 14 | title = ttk.Label(frame, text='Entry', anchor=tk.CENTER) 15 | title.pack(padx=5, pady=2, fill=tk.BOTH) 16 | ttk.Separator(frame).pack(padx=5, pady=5, fill=tk.X) 17 | 18 | # default 19 | entry = ttk.Entry(frame, bootstyle=bootstyle) 20 | entry.pack(padx=5, pady=5, fill=tk.BOTH) 21 | entry.insert(tk.END, 'default') 22 | 23 | # color 24 | for color in style.theme.colors: 25 | entry = ttk.Entry(frame, bootstyle=color) 26 | entry.pack(padx=5, pady=5, fill=tk.BOTH) 27 | entry.insert(tk.END, color) 28 | 29 | # readonly 30 | entry = ttk.Entry(frame, bootstyle=bootstyle) 31 | entry.insert(tk.END, 'readonly') 32 | entry.configure(state=READONLY) 33 | entry.pack(padx=5, pady=5, fill=tk.BOTH) 34 | 35 | # disabled 36 | entry = ttk.Entry(frame, bootstyle=bootstyle) 37 | entry.insert(tk.END, 'disabled') 38 | entry.configure(state=DISABLED) 39 | entry.pack(padx=5, pady=5, fill=tk.BOTH) 40 | 41 | return frame 42 | 43 | 44 | def change_style(): 45 | theme = choice(root.style.theme_names()) 46 | root.style.theme_use(theme) 47 | 48 | 49 | if __name__ == '__main__': 50 | # create visual widget style tests 51 | root = ttk.Window(themename='sandstone') 52 | 53 | ttk.Button(text="Change Theme", command=change_style).pack(padx=10, pady=10) 54 | 55 | test1 = create_entry_test('TEntry', root.style) 56 | test1.pack(side=tk.LEFT, fill=tk.BOTH) 57 | 58 | root.mainloop() 59 | -------------------------------------------------------------------------------- /tests/widget_styles/test_floodgauge.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from random import choice 4 | from ttkbootstrap import utility 5 | utility.enable_high_dpi_awareness() 6 | 7 | root = tk.Tk() 8 | root.geometry('500x500') 9 | root.title('ttkbootstrap') 10 | style = ttk.Style() 11 | 12 | def change_style(): 13 | theme = choice(style.theme_names()) 14 | style.theme_use(theme) 15 | 16 | p1 = ttk.Floodgauge( 17 | bootstyle='info', 18 | font='helvetica 24 bold', 19 | mask="Memory Used {}%", 20 | value=45 21 | ) 22 | p1.pack(fill=tk.BOTH, expand=tk.YES, padx=10, pady=10) 23 | p1.start() 24 | 25 | btn = ttk.Button(text="Change Theme", command=change_style) 26 | btn.pack(padx=10, pady=10) 27 | 28 | p1['value'] = 50 29 | assert p1['value'] == 50 30 | assert p1.configure('value')[-1] == 50 31 | 32 | p1['mask'] = None 33 | assert p1.configure('mask')[-1] is None 34 | 35 | p1['text'] = "Updating the database" 36 | assert p1['text'] == "Updating the database" 37 | 38 | p1['font'] = "arial 18" 39 | assert p1['font'] == 'arial 18' 40 | 41 | p1['mask'] = '{}% Complete' 42 | assert p1.configure('mask')[-1] == '{}% Complete' 43 | 44 | var = ttk.IntVar(value=30) 45 | p1['variable'] = var 46 | assert p1['value'] == 30 47 | assert(str(var) == p1.cget('variable')) 48 | 49 | root.mainloop() 50 | -------------------------------------------------------------------------------- /tests/widget_styles/test_frame.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from random import choice 4 | from ttkbootstrap import utility 5 | utility.enable_high_dpi_awareness() 6 | 7 | DARK = 'superhero' 8 | LIGHT = 'flatly' 9 | 10 | 11 | def create_frame_test(bootstyle, style): 12 | frame = ttk.Frame(padding=10) 13 | 14 | # title 15 | title = ttk.Label(frame, text='Frame', anchor=tk.CENTER) 16 | title.pack(padx=5, pady=2, fill=tk.BOTH) 17 | ttk.Separator(frame).pack(padx=5, pady=5, fill=tk.X) 18 | 19 | # default 20 | frm = ttk.Frame(frame, style=bootstyle, width=150, height=100) 21 | frm.pack(padx=5, pady=5) 22 | frm.pack_propagate(0) 23 | ttk.Label(frm, text='default').pack(fill=tk.BOTH) 24 | 25 | # color 26 | for color in style.theme.colors: 27 | frm = ttk.Frame(frame, bootstyle=color, width=150, height=100) 28 | frm.pack(padx=5, pady=5) 29 | frm.pack_propagate(0) 30 | ttk.Label( 31 | master=frm, 32 | text=color, 33 | bootstyle=(color, 'inverse') 34 | ).pack(fill=tk.BOTH) 35 | 36 | return frame 37 | 38 | 39 | def change_style(): 40 | theme = choice(style.theme_names()) 41 | style.theme_use(theme) 42 | 43 | 44 | if __name__ == '__main__': 45 | # create visual widget style tests 46 | root = tk.Tk() 47 | style = ttk.Style() 48 | 49 | ttk.Button(text="Change Theme", command=change_style).pack(padx=10, pady=10) 50 | 51 | test1 = create_frame_test('TFrame', style) 52 | test1.pack(side=tk.LEFT, fill=tk.BOTH) 53 | 54 | root.mainloop() 55 | -------------------------------------------------------------------------------- /tests/widget_styles/test_label.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from random import choice 4 | from ttkbootstrap import utility 5 | utility.enable_high_dpi_awareness() 6 | 7 | DARK = 'superhero' 8 | LIGHT = 'flatly' 9 | 10 | def create_label_style(bootstyle, style, test_name): 11 | frame = ttk.Frame(root, padding=5) 12 | 13 | # title 14 | title = ttk.Label(frame, text=test_name, anchor=tk.CENTER) 15 | title.pack(padx=5, pady=2, fill=tk.BOTH) 16 | ttk.Separator(frame).pack(padx=5, pady=5, fill=tk.X) 17 | 18 | # default 19 | lbl = ttk.Label(frame, text='default', bootstyle=bootstyle) 20 | lbl.pack(padx=5, pady=5, fill=tk.BOTH) 21 | 22 | # colored 23 | for color in style.colors: 24 | lbl = ttk.Label(frame, text=color, bootstyle=(color, bootstyle)) 25 | lbl.pack(padx=5, pady=5, fill=tk.BOTH) 26 | 27 | return frame 28 | 29 | 30 | def change_style(): 31 | theme = choice(style.theme_names()) 32 | style.theme_use(theme) 33 | 34 | 35 | if __name__ == '__main__': 36 | # create visual widget style tests 37 | root = tk.Tk() 38 | style = ttk.Style() 39 | 40 | ttk.Button(text="Change Theme", command=change_style).pack(padx=10, pady=10) 41 | 42 | create_label_style('', style, 'Label').pack(side=tk.LEFT) 43 | create_label_style('inverse', style, 'Inverse Label').pack(side=tk.LEFT) 44 | 45 | root.mainloop() 46 | -------------------------------------------------------------------------------- /tests/widget_styles/test_labelframe.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from random import choice 4 | from ttkbootstrap import utility 5 | utility.enable_high_dpi_awareness() 6 | 7 | DARK = 'superhero' 8 | LIGHT = 'flatly' 9 | 10 | 11 | def create_labelframe_style(bootstyle, style): 12 | frame = ttk.Frame(root, padding=5) 13 | 14 | # title 15 | title = ttk.Label(frame, text='Labelframe', anchor=tk.CENTER) 16 | title.pack(padx=5, pady=2, fill=tk.BOTH) 17 | ttk.Separator(frame).pack(padx=5, pady=5, fill=tk.X) 18 | 19 | # default 20 | lbl = ttk.Labelframe( 21 | master=frame, 22 | text='default', 23 | bootstyle=bootstyle, 24 | width=150, 25 | height=75 26 | ) 27 | lbl.pack(padx=5, pady=5, fill=tk.BOTH) 28 | 29 | # colored 30 | for color in style.colors: 31 | lbl = ttk.Labelframe( 32 | master=frame, 33 | text=color, 34 | bootstyle=color, 35 | width=150, 36 | height=75 37 | ) 38 | lbl.pack(padx=5, pady=5, fill=tk.BOTH) 39 | 40 | return frame 41 | 42 | 43 | def change_style(): 44 | theme = choice(style.theme_names()) 45 | style.theme_use(theme) 46 | 47 | 48 | if __name__ == '__main__': 49 | # create visual widget style tests 50 | root = tk.Tk() 51 | style = ttk.Style() 52 | 53 | ttk.Button(text="Change Theme", command=change_style).pack(padx=10, pady=10) 54 | 55 | create_labelframe_style('', style).pack(side=tk.LEFT) 56 | 57 | root.mainloop() 58 | -------------------------------------------------------------------------------- /tests/widget_styles/test_menu.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | DARK = 'superhero' 7 | LIGHT = 'flatly' 8 | 9 | if __name__ == '__main__': 10 | # create visual widget style tests 11 | root = tk.Tk() 12 | style = ttk.Style(theme=DARK) 13 | 14 | menu = tk.Menu(root) 15 | for x in range(5): 16 | menu.insert_checkbutton('end', label=f'Option {x+1}') 17 | menu.post(100, 100) 18 | 19 | root.mainloop() -------------------------------------------------------------------------------- /tests/widget_styles/test_menubutton.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from random import choice 4 | from ttkbootstrap import utility 5 | utility.enable_high_dpi_awareness() 6 | 7 | DARK = 'superhero' 8 | LIGHT = 'flatly' 9 | 10 | 11 | def create_menubutton_frame(bootstyle, style, testname): 12 | frame = ttk.Frame(root, padding=5) 13 | 14 | title = ttk.Label( 15 | master=frame, 16 | text=testname, 17 | anchor=tk.CENTER 18 | ) 19 | title.pack(padx=5, pady=2, fill=tk.BOTH) 20 | 21 | ttk.Separator(frame).pack(padx=5, pady=5, fill=tk.X) 22 | 23 | btn = ttk.Menubutton( 24 | master=frame, 25 | text='default', 26 | bootstyle=bootstyle 27 | ) 28 | btn.pack(padx=5, pady=5, fill=tk.BOTH) 29 | 30 | for color in style.colors: 31 | btn = ttk.Menubutton( 32 | master=frame, 33 | text=color, 34 | bootstyle=(color, bootstyle) 35 | ) 36 | btn.pack(padx=5, pady=5, fill=tk.BOTH) 37 | 38 | btn = ttk.Menubutton( 39 | master=frame, 40 | text='disabled', 41 | state=tk.DISABLED, 42 | bootstyle=bootstyle 43 | ) 44 | btn.pack(padx=5, pady=5, fill=tk.BOTH) 45 | 46 | return frame 47 | 48 | 49 | def change_style(): 50 | theme = choice(style.theme_names()) 51 | style.theme_use(theme) 52 | 53 | 54 | if __name__ == '__main__': 55 | # create visual widget style tests 56 | root = tk.Tk() 57 | style = ttk.Style() 58 | 59 | ttk.Button(text="Change Theme", command=change_style).pack(padx=10, pady=10) 60 | 61 | create_menubutton_frame( 62 | '', style, 'Solid Menubutton' 63 | ).pack(side=tk.LEFT) 64 | 65 | create_menubutton_frame( 66 | 'outline', style, 'Outline Menubutton' 67 | ).pack(side=tk.LEFT) 68 | 69 | root.mainloop() 70 | -------------------------------------------------------------------------------- /tests/widget_styles/test_notebook.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from random import choice 4 | from ttkbootstrap import utility 5 | utility.enable_high_dpi_awareness() 6 | 7 | DARK = 'superhero' 8 | LIGHT = 'flatly' 9 | 10 | def create_notebook_frame(widget_style, style): 11 | frame = ttk.Frame(root, padding=5) 12 | 13 | # title 14 | title = ttk.Label(frame, text=widget_style, anchor=tk.CENTER) 15 | title.pack(padx=5, pady=2, fill=tk.BOTH) 16 | ttk.Separator(frame).pack(padx=5, pady=5, fill=tk.X) 17 | 18 | # default 19 | nb = ttk.Notebook(frame, height=50, width=100) 20 | nb.pack(padx=5, pady=5, fill=tk.BOTH) 21 | for i, _ in enumerate(style.colors): 22 | nb.add(ttk.Frame(nb), text=f'Tab {i+1}') 23 | 24 | # other colors 25 | for color in style.colors: 26 | nb = ttk.Notebook(frame, bootstyle=color, height=50, width=100) 27 | nb.pack(padx=5, pady=5, fill=tk.BOTH) 28 | for i, _ in enumerate(style.colors): 29 | nb.add(ttk.Frame(nb), text=f'Tab {i+1}') 30 | return frame 31 | 32 | def change_style(): 33 | theme = choice(style.theme_names()) 34 | style.theme_use(theme) 35 | 36 | 37 | if __name__ == '__main__': 38 | # create visual widget style tests 39 | root = tk.Tk() 40 | style = ttk.Style() 41 | 42 | ttk.Button(text="Change Theme", command=change_style).pack(padx=10, pady=10) 43 | 44 | create_notebook_frame('TNotebook', style).pack(side=tk.LEFT) 45 | 46 | root.mainloop() -------------------------------------------------------------------------------- /tests/widget_styles/test_optionmenu.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from random import choice 4 | from ttkbootstrap import utility 5 | utility.enable_high_dpi_awareness() 6 | 7 | def change_style(): 8 | theme = choice(style.theme_names()) 9 | style.theme_use(theme) 10 | 11 | 12 | if __name__ == '__main__': 13 | # create visual widget style tests 14 | root = tk.Tk() 15 | style = ttk.Style() 16 | 17 | ttk.Button(text="Change Theme", command=change_style).pack(padx=10, pady=10) 18 | var = tk.Variable() 19 | om = ttk.OptionMenu(root, var, 'default', *style.colors) 20 | om.pack(padx=10, pady=10, fill=tk.X) 21 | 22 | for i, color in enumerate(style.colors): 23 | var = tk.Variable() 24 | om = ttk.OptionMenu(root, var, color, *style.colors, bootstyle=color) 25 | om.pack(padx=10, pady=10, fill=tk.X) 26 | 27 | root.mainloop() 28 | 29 | 30 | -------------------------------------------------------------------------------- /tests/widget_styles/test_panedwindow.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from random import choice 4 | from ttkbootstrap import utility 5 | utility.enable_high_dpi_awareness() 6 | 7 | DARK = 'superhero' 8 | LIGHT = 'flatly' 9 | 10 | 11 | def create_panedwindow_frame(widget_style, style): 12 | frame = ttk.Frame(root, padding=5) 13 | 14 | # title 15 | title = ttk.Label(frame, text=widget_style, anchor=tk.CENTER) 16 | title.pack(padx=5, pady=2, fill=tk.BOTH) 17 | ttk.Separator(frame).pack(padx=5, pady=5, fill=tk.X) 18 | 19 | # default 20 | pw = ttk.Panedwindow(frame) 21 | pw.pack(padx=5, pady=5, fill=tk.BOTH) 22 | pw.add(ttk.Frame(pw, width=100, height=50, bootstyle='info')) 23 | pw.add(ttk.Frame(pw, width=100, height=50, bootstyle='success')) 24 | 25 | for color in style.colors: 26 | # default 27 | pw = ttk.Panedwindow(frame, bootstyle=color) 28 | pw.pack(padx=5, pady=5, fill=tk.BOTH) 29 | pw.add(ttk.Frame(pw, width=100, height=50)) 30 | pw.add(ttk.Frame(pw, width=100, height=50)) 31 | 32 | return frame 33 | 34 | 35 | def change_style(): 36 | theme = choice(style.theme_names()) 37 | style.theme_use(theme) 38 | 39 | 40 | if __name__ == '__main__': 41 | # create visual widget style tests 42 | root = tk.Tk() 43 | style = ttk.Style() 44 | 45 | ttk.Button(text="Change Theme", command=change_style).pack(padx=10, pady=10) 46 | 47 | create_panedwindow_frame('TPanedwindow', style).pack(side=tk.LEFT) 48 | 49 | root.mainloop() 50 | -------------------------------------------------------------------------------- /tests/widget_styles/test_sizegrip.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from random import choice 4 | from ttkbootstrap import utility 5 | utility.enable_high_dpi_awareness() 6 | 7 | DARK = 'superhero' 8 | LIGHT = 'flatly' 9 | 10 | 11 | def create_sizegrip_style(bootstyle, style): 12 | frame = ttk.Frame(root, padding=5) 13 | 14 | # title 15 | title = ttk.Label( 16 | master=frame, 17 | text='Sizegrip', 18 | anchor=tk.CENTER 19 | ) 20 | title.pack(padx=5, pady=2, fill=tk.BOTH) 21 | ttk.Separator(frame).pack(padx=5, pady=5, fill=tk.X) 22 | 23 | # default 24 | ttk.Label(frame, text=bootstyle).pack(fill=tk.X) 25 | sg = ttk.Sizegrip(frame) 26 | sg.pack(padx=5, pady=5, fill=tk.BOTH, expand=True) 27 | 28 | # colored 29 | for color in style.colors: 30 | ttk.Label(frame, text=color).pack(fill=tk.X) 31 | sg = ttk.Sizegrip(frame, bootstyle=(color, bootstyle)) 32 | sg.pack(padx=5, pady=5, fill=tk.BOTH, expand=True) 33 | 34 | return frame 35 | 36 | 37 | def change_style(): 38 | theme = choice(style.theme_names()) 39 | style.theme_use(theme) 40 | 41 | 42 | if __name__ == '__main__': 43 | # create visual widget style tests 44 | root = tk.Tk() 45 | style = ttk.Style() 46 | 47 | ttk.Button(text="Change Theme", command=change_style).pack(padx=10, pady=10) 48 | 49 | create_sizegrip_style('', style).pack( 50 | side=tk.LEFT, fill=tk.BOTH, expand=True 51 | ) 52 | 53 | root.mainloop() 54 | -------------------------------------------------------------------------------- /tests/widget_styles/test_spinbox.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from random import choice 4 | from ttkbootstrap import utility 5 | utility.enable_high_dpi_awareness() 6 | 7 | DARK = 'superhero' 8 | LIGHT = 'flatly' 9 | 10 | 11 | def create_spinbox_test(bootstyle, style): 12 | frame = ttk.Frame(padding=10) 13 | 14 | # title 15 | title = ttk.Label(frame, text='Spinbox', anchor=tk.CENTER) 16 | title.pack(padx=5, pady=2, fill=tk.BOTH) 17 | ttk.Separator(frame).pack(padx=5, pady=5, fill=tk.X) 18 | 19 | # default 20 | spinbox = ttk.Spinbox(frame) 21 | spinbox.pack(padx=5, pady=5, fill=tk.BOTH) 22 | spinbox.insert(tk.END, 'default') 23 | 24 | # color 25 | for color in style.theme.colors: 26 | spinbox = ttk.Spinbox(frame, bootstyle=color) 27 | spinbox.pack(padx=5, pady=5, fill=tk.BOTH) 28 | spinbox.insert(tk.END, color) 29 | 30 | # disabled 31 | spinbox = ttk.Spinbox(frame) 32 | spinbox.insert(tk.END, 'disabled') 33 | spinbox.configure(state=tk.DISABLED) 34 | spinbox.pack(padx=5, pady=5, fill=tk.BOTH) 35 | 36 | # readonly 37 | spinbox = ttk.Spinbox(frame) 38 | spinbox.insert(tk.END, 'readonly') 39 | spinbox.configure(state='readonly') 40 | spinbox.pack(padx=5, pady=5, fill=tk.BOTH) 41 | 42 | return frame 43 | 44 | 45 | def change_style(): 46 | theme = choice(style.theme_names()) 47 | style.theme_use(theme) 48 | 49 | 50 | if __name__ == '__main__': 51 | # create visual widget style tests 52 | root = tk.Tk() 53 | style = ttk.Style() 54 | 55 | ttk.Button(text="Change Theme", command=change_style).pack(padx=10, pady=10) 56 | 57 | test1 = create_spinbox_test('', style) 58 | test1.pack(side=tk.LEFT, fill=tk.BOTH) 59 | 60 | root.mainloop() 61 | -------------------------------------------------------------------------------- /tests/widget_styles/test_text.py: -------------------------------------------------------------------------------- 1 | import ttkbootstrap as ttk 2 | from random import choice 3 | from ttkbootstrap import utility 4 | utility.enable_high_dpi_awareness() 5 | 6 | DARK = 'superhero' 7 | LIGHT = 'flatly' 8 | 9 | def change_style(window): 10 | theme = choice(window.style.theme_names()) 11 | window.style.theme_use(theme) 12 | 13 | 14 | if __name__ == '__main__': 15 | # create visual widget style tests 16 | window = ttk.Window(themename='darkly') 17 | 18 | ttk.Button(text="Change Theme", command=lambda x=window: change_style(x)).pack(padx=10, pady=10) 19 | text = ttk.Text(window, font='helvetica 24 bold') 20 | text.pack(padx=10, pady=10) 21 | text.insert('end', 'Hello, this is my text.') 22 | 23 | window.mainloop() -------------------------------------------------------------------------------- /tests/widget_styles/test_toplevel.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from random import choice 4 | from ttkbootstrap import utility 5 | utility.enable_high_dpi_awareness() 6 | 7 | def change_style(): 8 | theme = choice(style.theme_names()) 9 | style.theme_use(theme) 10 | 11 | 12 | if __name__ == '__main__': 13 | # create visual widget style tests 14 | root = tk.Tk() 15 | style = ttk.Style() 16 | 17 | ttk.Label(root, text="Root").pack(padx=10, pady=10) 18 | 19 | top = tk.Toplevel(root) 20 | ttk.Label(top, text="Toplevel").pack(padx=10, pady=10) 21 | 22 | btn = ttk.Button(top, text="Change Theme", command=change_style) 23 | btn.pack(padx=10, pady=10) 24 | 25 | root.mainloop() -------------------------------------------------------------------------------- /tests/widgets/colorchooser.py: -------------------------------------------------------------------------------- 1 | import ttkbootstrap as ttk 2 | from ttkbootstrap.dialogs.colorchooser import ColorChooserDialog 3 | 4 | 5 | app = ttk.Window() 6 | 7 | cd = ColorChooserDialog(app, initialcolor='#adadad') 8 | cd.show() 9 | 10 | app.mainloop() -------------------------------------------------------------------------------- /tests/widgets/date_entry_widget.py: -------------------------------------------------------------------------------- 1 | import ttkbootstrap as ttk 2 | from ttkbootstrap.constants import * 3 | 4 | root = ttk.Window() 5 | 6 | frame = ttk.Frame(root, padding=10) 7 | frame.pack(padx=10, pady=10) 8 | 9 | de = ttk.DateEntry(frame) 10 | 11 | de.pack(fill=X) 12 | 13 | root.mainloop() -------------------------------------------------------------------------------- /tests/widgets/datepicker_dialog.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | from ttkbootstrap.widgets import DateEntry 3 | 4 | root = tk.Tk() 5 | 6 | de = DateEntry() 7 | de.pack(padx=10, pady=10) 8 | 9 | de.configure(bootstyle='danger') 10 | assert de['bootstyle'] == 'danger' 11 | assert de.button.cget('style') == 'danger.Date.TButton' 12 | assert de.configure('bootstyle') == 'danger' 13 | 14 | -------------------------------------------------------------------------------- /tests/widgets/datepicker_dialog2.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | from ttkbootstrap.dialogs import DatePickerDialog 3 | 4 | root = tk.Tk() 5 | 6 | dp = DatePickerDialog() 7 | 8 | root.mainloop() -------------------------------------------------------------------------------- /tests/widgets/dialogs.py: -------------------------------------------------------------------------------- 1 | import ttkbootstrap as ttk 2 | from ttkbootstrap.dialogs import Querybox, Messagebox 3 | from ttkbootstrap.icons import Icon 4 | import tkinter as tk 5 | 6 | from ttkbootstrap.localization import MessageCatalog 7 | MessageCatalog.locale('zh_cn') 8 | Messagebox.ok("Messagebox.ok", position=(500, 500)) 9 | 10 | Messagebox.okcancel("Messagebox.okcancel", position=(500, 500)) 11 | Messagebox.retrycancel("Messagebox.retrycancel", position=(500, 500)) 12 | Messagebox.yesno("Messagebox.yesno", position=(500, 500)) 13 | Messagebox.yesnocancel("Messagebox.yesnocancel", position=(1000, 1000)) 14 | 15 | Messagebox.show_error("Messagebox.show_error", position=(500, 500)) 16 | Messagebox.show_info("Messagebox.show_info", position=(500, 500)) 17 | Messagebox.show_question("Messagebox.show_question", position=(500, 500)) 18 | Messagebox.show_warning("Messagebox.show_warning", position=(500, 500)) 19 | 20 | Querybox.get_date(title="Querybox.get_date") 21 | Querybox.get_float("Querybox.get_float", position=(500, 500)) 22 | Querybox.get_integer("Querybox.get_integer", position=(500, 500)) 23 | Querybox.get_string("Querybox.get_string", position=(500, 500)) 24 | Querybox.get_font(title="Querybox.get_font", position=(500, 500)) 25 | Querybox.get_item("Querybox.get_item", initialvalue="apple", 26 | items=["apple", "banana", "grape", "kiwi", "orange", "pear"], 27 | position=(500, 500)) 28 | -------------------------------------------------------------------------------- /tests/widgets/querybox.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import ttkbootstrap as ttk 3 | from ttkbootstrap.dialogs import Querybox 4 | from ttkbootstrap import utility 5 | 6 | utility.enable_high_dpi_awareness() 7 | 8 | root = tk.Tk() 9 | result = Querybox.get_float("How much to charge?", initialvalue=5.4) 10 | print(result) 11 | 12 | result = Querybox.get_string("What is your name?") 13 | print(result) 14 | 15 | 16 | result = Querybox.get_integer("What is your age?") 17 | print(result) 18 | -------------------------------------------------------------------------------- /tests/widgets/scrolled_widgets.py: -------------------------------------------------------------------------------- 1 | import ttkbootstrap as ttk 2 | from ttkbootstrap.constants import * 3 | from ttkbootstrap.scrolled import ScrolledText, ScrolledFrame 4 | 5 | app = ttk.Window() 6 | 7 | st = ScrolledText(app, padding=5, height=10, hbar=True, autohide=True) 8 | st.text.configure(padx=15, pady=15) 9 | st.pack(fill=BOTH, expand=YES) 10 | st.insert(END, 'Insert your text here.') 11 | #st.text.configure(state=DISABLED) 12 | st.vbar.configure(bootstyle=ROUND) 13 | 14 | app.mainloop() 15 | 16 | 17 | # app = ttk.Window() 18 | 19 | # sf = ScrolledFrame(app, autohide=True) 20 | # sf.pack(fill=BOTH, expand=YES, padx=10, pady=10) 21 | 22 | # for x in range(20): 23 | # ttk.Checkbutton(sf, text=f"Checkbutton {x}").pack(anchor=W) 24 | 25 | # app.mainloop() -------------------------------------------------------------------------------- /tests/widgets/tableview.py: -------------------------------------------------------------------------------- 1 | import ttkbootstrap as ttk 2 | from ttkbootstrap.constants import * 3 | from pathlib import Path 4 | import csv 5 | from ttkbootstrap.tableview import TableRow, Tableview 6 | from ttkbootstrap.utility import scale_size 7 | 8 | app = ttk.Window(themename='flatly') 9 | colors = app.style.colors 10 | 11 | p = Path(__file__).parent / "Sample1000.csv" 12 | with open(p, encoding="utf-8") as f: 13 | reader = csv.reader(f) 14 | next(reader) 15 | rowdata = list(reader) 16 | 17 | # column configuration options 18 | # text, image, command, anchor, width, minwidth, maxwidth, stretch 19 | coldata = [ 20 | {"text": "SerialNumber", "stretch": False}, 21 | "CompanyName", 22 | "Employee", 23 | "Description", 24 | {"text": "Leave", "stretch": False}, 25 | ] 26 | 27 | dt = Tableview( 28 | master=app, 29 | # coldata=coldata, 30 | # rowdata=rowdata, 31 | paginated=True, 32 | searchable=True, 33 | bootstyle=PRIMARY, 34 | stripecolor=(None, None), 35 | autofit=False 36 | ) 37 | dt.pack(fill=BOTH, expand=YES, padx=5, pady=5) 38 | 39 | dt.build_table_data(coldata, rowdata) 40 | #dt.delete_columns(indices=[2, 3]) 41 | 42 | # modify the contents of a single cell 43 | row = dt.get_row(0) 44 | row.values[2] = "Israel" 45 | row.refresh() 46 | 47 | # modify an entire row 48 | row = dt.get_row(1) 49 | row.values = ['123456', 'My Company', 'Israel', 'Something here', 45] 50 | 51 | app.mainloop() 52 | -------------------------------------------------------------------------------- /tests/widgets/tooltip.py: -------------------------------------------------------------------------------- 1 | import ttkbootstrap as ttk 2 | from ttkbootstrap.constants import * 3 | from ttkbootstrap.tooltip import ToolTip 4 | 5 | app = ttk.Window(size=(400, 100)) 6 | 7 | b1 = ttk.Button(app, text="default tooltip") 8 | b1.pack(side=LEFT, padx=10, pady=10, fill=X, expand=YES) 9 | ToolTip( 10 | b1, 11 | text="This is the default tooltip. This yellow background and black foreground will be applied by default.", 12 | ) 13 | 14 | b2 = ttk.Button(app, text="styled tooltip") 15 | b2.pack(side=LEFT, padx=10, pady=10, fill=X, expand=YES) 16 | ToolTip( 17 | b2, 18 | text="This is a styled tooltip with less padding. You can change this style by using the `bootstyle` parameter with label style keywords.", 19 | padding=1, 20 | bootstyle="danger-inverse", 21 | ) 22 | 23 | app.mainloop() 24 | --------------------------------------------------------------------------------