Open mingnet opened 4 years ago
import ( "github.com/lxn/walk" "github.com/lxn/win" )
type LogView struct { walk.TextEdit }
func NewLogView(parent walk.Container) (LogView, error) { e,err := walk.NewTextEditWithStyle(parent,win.WS_VSCROLL) if err != nil { return nil,err } lv := &LogView{e} lv.SetReadOnly(true) return lv, nil }
func (lv *LogView) PostAppendText(value string) { lv.AppendText(value) }
func (lv *LogView) Write(p []byte) (int, error) { lv.PostAppendText(string(p)) return len(p), nil }
import ( "github.com/lxn/walk" "github.com/lxn/win" )
type LogView struct { walk.TextEdit }
func NewLogView(parent walk.Container) (LogView, error) { e,err := walk.NewTextEditWithStyle(parent,win.WS_VSCROLL) if err != nil { return nil,err } lv := &LogView{e} lv.SetReadOnly(true) return lv, nil }
func (lv *LogView) PostAppendText(value string) { lv.AppendText(value) }
func (lv *LogView) Write(p []byte) (int, error) { lv.PostAppendText(string(p)) return len(p), nil }
this work for me! thanks
I want a log window, so I want to use the logview in the example. But I found the line height of this example to be a problem, as shown below, and I don't know how to change this. How can I deal with this?
The os is win7 x64.