func onLoadFile(ih *iup.Ihandle) int { dlg := iup.FileDlg("ALLOWNEW=NO,DIALOGTYPE=Open,TITLE=Open") iup.SetAttributeHandle(dlg, "PARENTDIALOG", mainDlg) iup.Popup(dlg, iup.CENTER, iup.CENTER) if iup.GetInt(dlg, "STATUS") == -1 { return iup.IGNORE } filename := iup.GetAttribute(dlg, "VALUE") iup.Destroy(dlg) content, err := ioutil.ReadFile(filename) if err != nil { iup.Message("Error", fmt.Sprintf("Error: %s", err)) return iup.IGNORE } iup.StoreAttribute(text, "VALUE", string(content)) return iup.IGNORE }
func main() { iup.Open() defer iup.Close() iup.Message("Greetings", "Hello, World!") }