khchen / wNim

Nim's Windows GUI Framework
MIT License
326 stars 17 forks source link

How to set the frame position according to the screen size #52

Closed EasiestSoft closed 4 years ago

EasiestSoft commented 4 years ago

How to set the frame position according to the screen size

It seems that I can only center the frame, but sometimes I don’t want to center the frame, but set x to (screen.width - frame.width -100) and y to (screen.height - frame.height -100) , how can I do that

khchen commented 4 years ago

Of course you can. For example:

import wNim/[wApp, wFrame, wUtils]

var app = App()
var frame = Frame()

let screen = wGetScreenSize()

frame.position = (screen.width - frame.size.width - 100,
  screen.height - frame.size.height - 100)

frame.show()
app.mainLoop()
EasiestSoft commented 4 years ago

Thanks I love Nim and I love wNim