GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-68166: Add support of "vsapi" in ttk.Style.element_create() by serhiy-storchaka · Pull Request #111393 · python/cpython

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Oct 27, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Fix and document Add support of "vsapi" element type in tkinter.ttk.Style.element_create().
  • Add tests for element_create() and other ttk.Style methods.
  • Add examples for element_create() in the documentation.
  • Issue: ttk.Style.element_create using incorrect tk.call syntax #68166

📚 Documentation preview 📚: https://cpython-previews--111393.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@serhiy-storchaka
pythongh-68166: Fix support of "vsapi" in ttk.Style.element_create()
3432df2
* Fix and document support of "vsapi" element type in
  tkinter.ttk.Style.element_create().
* Add tests for element_create() and other ttk.Style methods.
* Add examples for element_create() in the documentation.
@serhiy-storchaka serhiy-storchaka added type-bug An unexpected behavior, bug, or error topic-tkinter needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Oct 27, 2023
@serhiy-storchaka
serhiy-storchaka requested a review from terryjreedy October 27, 2023 09:50
@bedevere-app bedevere-app Bot mentioned this pull request Oct 27, 2023
ttk.Style.element_create using incorrect tk.call syntax #68166
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label Oct 27, 2023
serhiy-storchaka added 3 commits October 27, 2023 13:29
@serhiy-storchaka
Try to fix tests on Windows.
273c73a
@serhiy-storchaka
Test _script_from_settings() with vsapi.
e6a82ba
@serhiy-storchaka
Add explicit root in examples.
8cb53cc
@terryjreedy

terryjreedy commented Oct 28, 2023

Copy link
Copy Markdown
Member

I verified that the reproducer in the issue still fails main and runs with the patch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

terryjreedy
terryjreedy reviewed Oct 28, 2023
View reviewed changes
Comment thread Doc/library/tkinter.ttk.rst Outdated
Create a new element in the current theme, of the given *etype* which is
expected to be either "image", "from" or "vsapi". The latter is only
available in Tk 8.6a for Windows XP and Vista and is not described here.
available in Tk 8.6a for Windows XP and Vista.

@terryjreedy terryjreedy Oct 28, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have never heard of 'Tk 8.6a'; seems like a typo. XP is no longer supported and 8.5 is not supported on Windows. Is Vista still supported? https://www.tcl.tk/man/tcl8.6/TkCmd/ttk_vsapi.html does say just xp/vista, but does tk not support Win 10/11 'visual styles'?

In any case, the issue test code passing 'vsapi' runs on 8.6.13 on Win 10. Does it do nothing on Win 10? Given

>>> ttk.Style().theme_names()
('winnative', 'clam', 'alt', 'default', 'classic', 'vista', 'xpnative')

the vsapi tests run (and pass on my machine), so my guess is that xp/vista themes are still available and usable. If so, the doc should not suggest not. Perhaps

Suggested change
available in Tk 8.6a for Windows XP and Vista.
available for Windows and only supports the XP theme.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@serhiy-storchaka serhiy-storchaka Oct 28, 2023

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that 8.6a refers to the alpha version of 8.6 (perhaps it was in the alpha stage when this was added).

"and only supports the XP theme" is not correct. You can use it in any theme, you can create XP-like or Vista-like theme using this API (and the "vista" theme is created in Tk by calling such commands). I left "available in Tk 8.6 on Windows" (there are other references to 8.6 and 8.5 in docs).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chrstphrchvz reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
serhiy-storchaka added 5 commits October 28, 2023 11:27
@serhiy-storchaka
Tweak docs.
8ab089c
@serhiy-storchaka
Add tests for theme_create().
06a4734
@serhiy-storchaka
Fix tests on Windows.
b1b40e2
@serhiy-storchaka
Merge branch 'main' into ttk-style-element-create
2204119
@serhiy-storchaka
Add a What's New entry.
37967d5
@serhiy-storchaka serhiy-storchaka added type-feature A feature request or enhancement and removed needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes type-bug An unexpected behavior, bug, or error labels Nov 8, 2023
@serhiy-storchaka serhiy-storchaka changed the title gh-68166: Fix support of "vsapi" in ttk.Style.element_create() gh-68166: Add support of "vsapi" in ttk.Style.element_create() Nov 8, 2023
@serhiy-storchaka

serhiy-storchaka commented Nov 8, 2023

Copy link
Copy Markdown
Member Author

Now it is a new feature and will not be backported.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka
serhiy-storchaka merged commit 4dcfd02 into python:main Nov 27, 2023
@bedevere-app bedevere-app Bot removed the awaiting core review label Nov 27, 2023
@serhiy-storchaka
serhiy-storchaka deleted the ttk-style-element-create branch November 27, 2023 18:57
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@serhiy-storchaka @aisk
pythongh-68166: Add support of "vsapi" in ttk.Style.element_create() (p…
019206b
…ythonGH-111393)
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@serhiy-storchaka @Glyphack
pythongh-68166: Add support of "vsapi" in ttk.Style.element_create() (p…
7a00ef6
…ythonGH-111393)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@terryjreedy terryjreedy terryjreedy left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

topic-tkinter type-feature A feature request or enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@serhiy-storchaka @terryjreedy
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.