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

Builtin required size getters #153

Open
Moosems opened this issue Apr 26, 2024 · 0 comments
Open

Builtin required size getters #153

Moosems opened this issue Apr 26, 2024 · 0 comments
Labels
Area: widgets Widget related stuff enhancement New feature or request

Comments

@Moosems
Copy link
Collaborator

Moosems commented Apr 26, 2024

What's your feature request?

I would like a builtin way to get the needed size of widgets without Tcl calls :D

Currently its:

button = Button(window, text="Click Me!", tooltip="Placeholder Widget ;)")
button.grid()


# Resize Window
width = Tcl.call(int, "winfo", "reqwidth", button)
height = Tcl.call(int, "winfo", "reqheight", button)
window.width = width
window.height = height

What it could be:

width = button.necessaryWidth()
height = button.necessaryHeight()

Or some other way of writing the function

Alternatives you've considered

Just dealing with it?

@Moosems Moosems added enhancement New feature or request Area: widgets Widget related stuff labels Apr 26, 2024
@Moosems Moosems changed the title Builtin size getters Builtin required size getters Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: widgets Widget related stuff enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant