示例#1
0
文件: rot13.go 项目: DaviWei/iup
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
}
示例#2
0
文件: hello.go 项目: DaviWei/iup
func main() {
	iup.Open()
	defer iup.Close()

	iup.Message("Greetings", "Hello, World!")
}