Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try to replace the three buttons by tcl vsapi #44

Open
littlewhitecloud opened this issue May 16, 2024 · 0 comments
Open

try to replace the three buttons by tcl vsapi #44

littlewhitecloud opened this issue May 16, 2024 · 0 comments
Labels
📗 help wanted Extra attention is needed ❌ invalid This doesn't seem right

Comments

@littlewhitecloud
Copy link
Owner

Here I found something intreseting:
image
It seems that windows put the max, min, restore, close or even help button's glyph in the DWMWindow class.
And there is something from the tcl/tk ttk_vsapi manual page (https://www.tcl.tk/man/tcl9.0/TkCmd/ttk_vsapi.html):

Change the appearance of a ttk::checkbutton(n) to use the Explorer pin part EBP_HEADERPIN.

ttk::style element create pin vsapi EXPLORERBAR 3 {
    {pressed !selected} 3
    {active !selected} 2
    {pressed selected} 6
    {active selected} 5
    {selected} 4
    {} 1
}
ttk::style layout Explorer.Pin {Explorer.Pin.pin -sticky news}
pack [ttk::checkbutton .pin -style Explorer.Pin]

And this program created a checkbutton with a element from the vsapi in the EXPLOREBAR.
image
image
So I am thinking we can get the elements from the vsapi in the DWMWindow and let dwm to draw the three buttons.

Sadly, it doesn't work when I wrote down something like this:

ttk::style element create max vsapi DWMWINDOW 29 \
    {disabled 4 pressed 3 active 2 {} 1}
ttk::style layout MaxButton {MaxButton.max -sticky news}
pack [ttk::button .close -style MaxButton]

TODO: make it works

@littlewhitecloud littlewhitecloud added 📗 help wanted Extra attention is needed ❌ invalid This doesn't seem right labels May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📗 help wanted Extra attention is needed ❌ invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant