func jk_bv_eth_get_devicelist() []byte { bveth.JKStartBroadCast() time.Sleep(1000 * time.Millisecond) str, _ := bveth.JK_selfresponse_serialize(bveth.GlobalDeviceList.Device) // str := bveth.JKBVEthToString() bveth.JK_close_listen_udp() return str }
func (bv *bvethWindow) sendRequestRefresh() { if bv.sendRequest == true { return } for { if bv.sendRequest == false { break } } bveth.JKStartBroadCast() bv.sendRequest = true }
func BvEthWindow(parent walk.Window) { mw := new(bvethWindow) bveth.JKStartBroadCast() mw.model = NewEnvModel() main := MainWindow{ AssignTo: &mw.MainWindow, Title: "局域网工具", MinSize: Size{400, 320}, Layout: VBox{}, Children: []Widget{ ListBox{ AssignTo: &mw.listDevices, Model: mw.model, OnItemActivated: mw.lb_ItemActivated, // ReadOnly: true, }, PushButton{ AssignTo: &mw.refresh, Text: "刷新", OnClicked: mw.sendRequestRefresh, }, }, } err := main.Create() if err != nil { jklog.L().Fatal(err) } go mw.setModelItemThread() mw.Run() }