-
Notifications
You must be signed in to change notification settings - Fork 50
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
Fixed sized windows #158
Comments
At the moment all windows are resizable. Why do you want to forbid the user to do this? |
It's just nice to have, in example tiling window managers are generally don't tile windows with fixed sizes or ratios. They usually stretch the window across the screen and that could break the look and/or layout of the window. |
Also having an option to limit the minimum size of the window would be nice. |
OK. I will have a look into an implementation, I think it's easy. |
I have implemented it in commit e4b6749 . |
in linux everything works as intended |
the bit of code from https://github.com/simonkrauter/NiGui/blob/master/examples/example_05_handle_window_close.nim doesn't work with |
|
I wouldn't base conclusions on results from a three generations old Windows version in a VM. If you would like to provide valid results, it should be done in a native Windows 10 or Windows 11 system. |
fair point, but i don't have any other Windows installations at the moment. If you can, you could test it. import nigui
import nigui/msgBox
app.init()
var window = newWindow("NiGui example")
# window.width = 600.scaleToDpi
# window.height = 400.scaleToDpi
window.minWidth = 600.scaleToDpi
window.minHeight = 400.scaleToDpi
# window.resizable = false
# window.alwaysOnTop = true
window.centerOnScreen()
# window.onResize = proc (e: ResizeEvent) =
# var w = e.window
# w.width = 600.scaleToDpi
# w.height = 400.scaleToDpi
var container = newLayoutContainer(Layout_Vertical)
# container.padding = 10
window.add(container)
var button = newButton("Button 1")
container.add(button)
var textArea = newTextArea()
textArea.editable = false
container.add(textArea)
button.onClick = proc(event: ClickEvent) =
textArea.addLine("Button1 clicked, message box opened.")
window.alert("This is simple message box.", "simple message box")
textArea.addLine("Message box closed.")
window.onCloseClick = proc(event: CloseClickEvent) =
case window.msgBox("Do you want to quit?", "Quit?", "Quit", "Minimize", "Cancel")
of 1: window.dispose()
of 2: window.minimize()
else: discard
window.show()
app.run() |
Running on Windows 10.
I can confirm this.
I tested this example with |
Is there a way to make windows with fixed sizes or ratios?
The text was updated successfully, but these errors were encountered: