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

How to use the event? #34

Open
vgrabko opened this issue Jul 15, 2016 · 0 comments
Open

How to use the event? #34

vgrabko opened this issue Jul 15, 2016 · 0 comments

Comments

@vgrabko
Copy link

vgrabko commented Jul 15, 2016

``
package main

import (
"github.com/visualfc/goqt/ui"
)

func main() {
ui.Run(func() {
w := ui.NewWidget()
defer w.Show()

    r := NewMyWidget()
    r.OnPaintEvent()
})

}

type MyWidget struct {
*ui.QWidget
}

func NewMyWidget() *MyWidget {
w := &MyWidget{}
w.QWidget = ui.NewWidget()
w.InstallEventFilter(w)
return w
}

func (w *MyWidget) OnPaintEvent(e *ui.QPaintEvent) bool {
w.PaintEvent() //w.QWidget.PaintEvent()

painter := ui.NewPainterWithPaintDevice(w)
defer painter.Delete()

//painter.Draw ...

return true

}
``

Errors:
./main.go:15: not enough arguments in call to r.OnPaintEvent ./main.go:31: not enough arguments in call to w.QWidget.PaintEvent

Where to take the variable 'e' ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant