func onRotate(ih *iup.Ihandle) int { content := iup.GetAttribute(text, "VALUE") content = rot13(content) iup.StoreAttribute(text, "VALUE", string(content)) return iup.DEFAULT }
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 sayHelloToSomeone(ih *iup.Ihandle) int { fmt.Printf("Hello, %s!\n", iup.GetAttribute(someone, "VALUE")) return 0 }
func sayHello(ih *iup.Ihandle) int { fmt.Printf("Hello, %s!\n", iup.GetAttribute(ih, "TO_WHO")) return 0 }
func onGo(ih *iup.Ihandle) int { iup.StoreAttribute(browser, "VALUE", iup.GetAttribute(urlentry, "VALUE")) return iup.DEFAULT }