Skip to content

Is it possible to run winapi.MessageLoop() asyncronously? #32

@pluto439

Description

@pluto439

As it is now, repl terminal gets blocked when I launch winapi.MessageLoop(). Is there a way to start it asyncronously?

Here is the code I'm using. The only difference from one on docs page is lack of local, it doesn't work in repl for some reason.

winapi = require'winapi'
require'winapi.windowclass'

win = winapi.Window{
   w = 500,                --all these are "initial fields"
   h = 300,
   title = 'Lua rulez',
   autoquit = true,        --this is to quit app when the window is closed
   visible = false,        --this field is from BaseWindow
}

function win:on_close()    --this is an event handler
   print'Bye'
end

print(win.title)           --this is how to read the value of a property
win.title = 'Lua rulez!'   --this is how to set the value of a property
win:show()                 --this is a method call

winapi.MessageLoop() --start the message loop

I want to do win.w=100 after the window is opened. From terminal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions