khchen / wNim

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

tooltip can be set, but can't be read #6

Closed retsyo closed 6 years ago

retsyo commented 6 years ago

the following code says w_bug.nim(20, 34) Error: undeclared identifier: 'tooltip'

import wNim

var app = App()
var frame = Frame(title="demo", size = (320, 200), style=wDefaultFrameStyle or wModalFrame)

var statusBar = StatusBar(frame)
var panel = Panel(frame)

var btn1 = Button(panel, label="button")
btn1.tooltip = "button 1"

proc layout() =
    panel.layout:
        btn1:
            top == panel.top
            left == panel.left
            width == panel.innerWidth

btn1.wEvent_MouseEnter do ():
    statusBar.setStatusText(btn1.tooltip)   # this can't be read

panel.wEvent_Size do ():
    layout()

layout()
frame.center()
frame.show()
app.mainLoop()