Documentation ¶
Overview ¶
Iup wrapper for Go.
Documentation of this package is minimal on purpose. The Iup documentation is very good and go-iup strives to maintain a one-to-one relation with the C version of Iup. Where go-iup differs from the C variant documentation will exist.
go-iup function names drop the Iup prefix as they are under the iup package. go-iup constant names drop the IUP_ prefix as they are under the iup package.
Copyright (C) 2011 by Jeremy Cowgar <jeremy@cowgar.com>
This file is part of go-iup.
go-iup is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
go-iup is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with go-iup. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- func Alarm(t, m string, buttons ...string) int
- func ByteArrayToCUCharArray(content []byte) []C.uchar
- func ClassMatch(ih *Ihandle, classname string) bool
- func Close()
- func ConvertXYToPos(ih *Ihandle, x, y int) int
- func CopyClassAttributes(ih, dest *Ihandle)
- func Decorate(ih *Ihandle, opt interface{})
- func Destroy(ih *Ihandle)
- func Detach(ih *Ihandle)
- func ExitLoop()
- func Float64ArrayToC(nums []float64) []C.float
- func Flush()
- func FreeCStringArray(strs []*C.char)
- func GetAttribute(ih *Ihandle, name string) string
- func GetAttributeId(ih *Ihandle, name string, id int) string
- func GetAttributes(ih *Ihandle) string
- func GetChildCount(ih *Ihandle) int
- func GetChildPos(ih *Ihandle, child *Ihandle) int
- func GetClassName(ih *Ihandle) string
- func GetClassType(ih *Ihandle) string
- func GetColor(x, y, r, g, b int) (int, int, int)
- func GetFile(filename string) (string, int)
- func GetFloat(ih *Ihandle, name string) float64
- func GetFloatId(ih *Ihandle, name string, id int) float64
- func GetGlobal(name string) string
- func GetInt(ih *Ihandle, name string) int64
- func GetIntId(ih *Ihandle, name string, id int) int
- func GetLanguage() string
- func GetParam(title string, format string, args ...interface{}) bool
- func GetText(title, text string) (string, int)
- func Help(url string) int
- func Hide(ih *Ihandle) int
- func IHandleArrayToC(ihs []*Ihandle) []*C.Ihandle
- func IntArrayToC(nums []int) []C.int
- func ListDialog(typ int, title string, list []string, opt, max_col, max_lin int, marks []int) (int, []int)
- func Load(filename string) (err error)
- func LoadBuffer(buffer string) (err error)
- func LoopStep() int
- func LoopStepWait() int
- func MainLoop() int
- func MainLoopLevel() int
- func Map(ih *Ihandle) int
- func MapFont(iupfont string) string
- func MatGetAttribute(ih *Ihandle, name string, lin int, col int) string
- func MatGetFloat(ih *Ihandle, name string, lin int, col int) float64
- func MatGetInt(ih *Ihandle, name string, lin int, col int) int64
- func MatSetAttribute(ih *Ihandle, name string, lin int, col int, value unsafe.Pointer)
- func MatSetfAttribute(ih *Ihandle, name string, lin int, col int, format string, args ...interface{})
- func MatStoreAttribute(ih *Ihandle, name string, lin int, col int, value string)
- func Message(title, message string)
- func Open() int
- func OpenControlLib()
- func PlayInput(filename string) int
- func Popup(ih *Ihandle, x, y int) int
- func RecordInput(filename string, mode int) int
- func Redraw(ih *Ihandle, children bool)
- func Refresh(ih *Ihandle)
- func RefreshChildren(ih *Ihandle)
- func Reparent(child, new_parent, ref_child *Ihandle) int
- func ResetAttribute(ih *Ihandle, name string)
- func SaveClassAttributes(ih *Ihandle)
- func SaveImage(ih *Ihandle, file_name, format string) int
- func SaveImageAsText(ih *Ihandle, file_name, format, name string) int
- func SetActionFunc(ih *Ihandle, f ActionFunc)
- func SetAttribute(ih *Ihandle, name, value string)
- func SetAttributeHandle(ih *Ihandle, name string, ihNamed *Ihandle)
- func SetAttributeId(ih *Ihandle, name string, id int, value string)
- func SetAttributes(ih *Ihandle, values string)
- func SetButtonFunc(ih *Ihandle, f ButtonFunc)
- func SetCaretFunc(ih *Ihandle, f CaretFunc)
- func SetClassDefaultAttribute(classname, name, value string)
- func SetDblclickFunc(ih *Ihandle, f DblclickFunc)
- func SetDestroyFunc(ih *Ihandle, f DestroyFunc)
- func SetDropFilesFunc(ih *Ihandle, f DropFilesFunc)
- func SetEditFunc(ih *Ihandle, f EditFunc)
- func SetEnterWindowFunc(ih *Ihandle, f EnterWindowFunc)
- func SetFloat(ih *Ihandle, name string, value float32)
- func SetGetFocusFunc(ih *Ihandle, f GetFocusFunc)
- func SetGlobal(name string, value string)
- func SetHelpFunc(ih *Ihandle, f HelpFunc)
- func SetIdleFunc(f IdleFunc)
- func SetInt(ih *Ihandle, name string, value int32)
- func SetKAnyFunc(ih *Ihandle, f KAnyFunc)
- func SetKillFocusFunc(ih *Ihandle, f KillFocusFunc)
- func SetLanguage(lng string)
- func SetLeaveWindowFunc(ih *Ihandle, f LeaveWindowFunc)
- func SetListActionFunc(ih *Ihandle, f ListActionFunc)
- func SetMapFunc(ih *Ihandle, f MapFunc)
- func SetMotionFunc(ih *Ihandle, f MotionFunc)
- func SetMultiselectFunc(ih *Ihandle, f MultiselectFunc)
- func SetShowFunc(ih *Ihandle, f ShowFunc)
- func SetSpinFunc(ih *Ihandle, f SpinFunc)
- func SetTabChangeFunc(ih *Ihandle, f TabChangeFunc)
- func SetTabChangePosFunc(ih *Ihandle, f TabChangePosFunc)
- func SetTextActionFunc(ih *Ihandle, f TextActionFunc)
- func SetToggleActionFunc(ih *Ihandle, f ToggleActionFunc)
- func SetTrayClickFunc(ih *Ihandle, f TrayClickFunc)
- func SetUnmapFunc(ih *Ihandle, f UnmapFunc)
- func SetValueChangedFunc(ih *Ihandle, f ValueChangedFunc)
- func SetfAttribute(ih *Ihandle, name, format string, args ...interface{})
- func SetfAttributeId(ih *Ihandle, name string, id int, format string, args ...interface{})
- func SetfAttributeId2(ih *Ihandle, name string, lin int, col int, format string, args ...interface{})
- func Show(ih *Ihandle) int
- func ShowXY(ih *Ihandle, x, y int) int
- func StoreAttribute(ih *Ihandle, name, value string)
- func StoreAttributeId(ih *Ihandle, name string, id int, value string)
- func StoreGlobal(name, value string)
- func StringArrayToC(strs []string) []*C.char
- func TextConvertLinColToPos(ih *Ihandle, lin, col int) int
- func TextConvertPosToLinCol(ih *Ihandle, pos int) (int, int)
- func UnMapFont(driverfont string) string
- func Unmap(ih *Ihandle)
- func Update(ih *Ihandle)
- func UpdateChildren(ih *Ihandle)
- func Version() string
- type ActionFunc
- type ButtonFunc
- type CaretFunc
- type DblclickFunc
- type DestroyFunc
- type DropFilesFunc
- type EditFunc
- type EnterWindowFunc
- type GetFocusFunc
- type HelpFunc
- type IdleFunc
- type Ihandle
- func Append(ih, new_child *Ihandle) *Ihandle
- func Button(title string, opts ...interface{}) *Ihandle
- func Canvas(opts ...interface{}) *Ihandle
- func Cbox(args ...*Ihandle) *Ihandle
- func Cboxv(args []*Ihandle) *Ihandle
- func Cells(opts ...interface{}) *Ihandle
- func Clipboard() *Ihandle
- func ColorBrowser(opts ...interface{}) *Ihandle
- func ColorDlg(opts ...interface{}) *Ihandle
- func Colorbar(opts ...interface{}) *Ihandle
- func Create(classname string) *Ihandle
- func Createp(classname string, args ...string) *Ihandle
- func Createv(classname string, args []string) *Ihandle
- func Dial(orientation string, opts ...interface{}) *Ihandle
- func Dialog(child *Ihandle, opts ...interface{}) *Ihandle
- func ElementPropertiesDialog(ih *Ihandle, opts ...interface{}) *Ihandle
- func FileDlg(opts ...interface{}) *Ihandle
- func Fill(opts ...interface{}) *Ihandle
- func FontDlg(opts ...interface{}) *Ihandle
- func Frame(child *Ihandle, opts ...interface{}) *Ihandle
- func GetAttributeHandle(ih *Ihandle, name string) *Ihandle
- func GetBrother(ih *Ihandle) *Ihandle
- func GetChild(ih *Ihandle, pos int) *Ihandle
- func GetDialog(ih *Ihandle) *Ihandle
- func GetDialogChild(ih *Ihandle, name string) *Ihandle
- func GetFocus() *Ihandle
- func GetHandle(name string) *Ihandle
- func GetNextChild(ih, child *Ihandle) *Ihandle
- func GetParent(ih *Ihandle) *Ihandle
- func GridBox(args ...*Ihandle) *Ihandle
- func GridBoxv(args []*Ihandle) *Ihandle
- func Hbox(args ...*Ihandle) *Ihandle
- func Hboxv(args []*Ihandle) *Ihandle
- func Image(width, height int, pixels []byte) *Ihandle
- func ImageRGB(width, height int, pixels []byte) *Ihandle
- func ImageRGBA(width, height int, pixels []byte) *Ihandle
- func Insert(ih, ref_child, new_child *Ihandle) *Ihandle
- func Item(title string, opts ...interface{}) *Ihandle
- func Label(title string, opts ...interface{}) *Ihandle
- func LayoutDialog(ih *Ihandle, opts ...interface{}) *Ihandle
- func List(opts ...interface{}) *Ihandle
- func LoadImage(file_name string) *Ihandle
- func Matrix(opts ...interface{}) *Ihandle
- func Menu(args ...*Ihandle) *Ihandle
- func Menuv(args []*Ihandle, opts ...interface{}) *Ihandle
- func MessageDlg(opts ...interface{}) *Ihandle
- func NextField(ih *Ihandle) *Ihandle
- func Normalizer(args ...*Ihandle) *Ihandle
- func Normalizerv(args []*Ihandle) *Ihandle
- func OleControl(opts ...interface{}) *Ihandle
- func PreviousField(ih *Ihandle) *Ihandle
- func ProgressBar(opts ...interface{}) *Ihandle
- func Radio(child *Ihandle) *Ihandle
- func Sbox(child *Ihandle) *Ihandle
- func Separator() *Ihandle
- func SetAtt(ih *Ihandle, handle_name string, args ...string) *Ihandle
- func SetAttrs(ih *Ihandle, args ...string) *Ihandle
- func SetFocus(ih *Ihandle) *Ihandle
- func Spin(opts ...interface{}) *Ihandle
- func Split(child1, child2 *Ihandle, opts ...interface{}) *Ihandle
- func Submenu(title string, menu *Ihandle, opts ...interface{}) *Ihandle
- func Tabs(args ...*Ihandle) *Ihandle
- func Tabsv(args []*Ihandle, opts ...interface{}) *Ihandle
- func Text(opts ...interface{}) *Ihandle
- func Timer() *Ihandle
- func Toggle(title string, opts ...interface{}) *Ihandle
- func Tree(opts ...interface{}) *Ihandle
- func User() *Ihandle
- func Val(orientation string, opts ...interface{}) *Ihandle
- func Vbox(args ...*Ihandle) *Ihandle
- func Vboxv(args []*Ihandle) *Ihandle
- func Zbox(args ...*Ihandle) *Ihandle
- func Zboxv(args []*Ihandle) *Ihandle
- type KAnyFunc
- type KillFocusFunc
- type LeaveWindowFunc
- type ListActionFunc
- type MapFunc
- type MotionFunc
- type MultiselectFunc
- type ShowFunc
- type SpinFunc
- type TabChangeFunc
- type TabChangePosFunc
- type TextActionFunc
- type ToggleActionFunc
- type TrayClickFunc
- type UnmapFunc
- type ValueChangedFunc
Constants ¶
const CENTER = C.IUP_CENTER
const CENTERPARENT = C.IUP_CENTERPARENT
const CLOSE = C.IUP_CLOSE
const CONTINUE = C.IUP_CONTINUE
const CURRENT = C.IUP_CURRENT
const DEFAULT = C.IUP_DEFAULT
const HIDE = C.IUP_HIDE
const IGNORE = C.IUP_IGNORE
const ( // go-iup version string. // // go-iup version string is based off the built-against version // code of Iup with the addition of a `go-iup' version code // as the forth digit. i.e. 3.5.0.1 means that this version of // go-iup was built with Iup 3.5.0 in mind and is the `.1' release // of go-iup against Iup 3.5.0. IupGoVersion = "3.5.0.1" )
const LEFT = C.IUP_LEFT
const MAXIMIZE = C.IUP_MAXIMIZE
const MINIMIZE = C.IUP_MINIMIZE
const MOUSEPOS = C.IUP_MOUSEPOS
const RECBINARY = C.IUP_RECBINARY
const RECTEXT = C.IUP_RECTEXT
const RESTORE = C.IUP_RESTORE
const RIGHT = C.IUP_RIGHT
const SHOW = C.IUP_SHOW
Variables ¶
This section is empty.
Functions ¶
func ByteArrayToCUCharArray ¶
func ClassMatch ¶
func ConvertXYToPos ¶
func CopyClassAttributes ¶
func CopyClassAttributes(ih, dest *Ihandle)
func Float64ArrayToC ¶
func FreeCStringArray ¶
func GetAttribute ¶
func GetAttributes ¶
func GetChildCount ¶
func GetChildPos ¶
func GetClassName ¶
func GetClassType ¶
func GetFile ¶
Warning: This allocates 2048 for an incoming buffer size for the filename but if the user selects a filename more than 2048 characters a buffer over run WILL occur. This problem has been brought to the attention of the Iup maintainers as there is no way to tell GetFile how large the receiving buffer actually is.
func GetLanguage ¶
func GetLanguage() string
func GetParam ¶
Warning: Incompelete, only supports int64, float64 and bool variable types. This method is a work in progress
func GetText ¶
Warning: This allocates 4096 for an incoming buffer size but if the user enters more than 4096 characters a buffer over run WILL occur. This problem has been brought to the attention of the Iup maintainers as there is no way to tell IupGetText how large the receiving buffer actually is.
func IHandleArrayToC ¶
func IntArrayToC ¶
func ListDialog ¶
func ListDialog(typ int, title string, list []string, opt, max_col, max_lin int, marks []int) (int, []int)
Differs in that size is derrived from the list array
func LoadBuffer ¶
func LoopStepWait ¶
func LoopStepWait() int
func MainLoopLevel ¶
func MainLoopLevel() int
func MatSetAttribute ¶
func MatSetfAttribute ¶
func MatStoreAttribute ¶
func OpenControlLib ¶
func OpenControlLib()
func RecordInput ¶
func RefreshChildren ¶
func RefreshChildren(ih *Ihandle)
func ResetAttribute ¶
func SaveClassAttributes ¶
func SaveClassAttributes(ih *Ihandle)
func SaveImageAsText ¶
func SetActionFunc ¶
func SetActionFunc(ih *Ihandle, f ActionFunc)
func SetAttribute ¶
func SetAttributeHandle ¶
func SetAttributes ¶
func SetButtonFunc ¶
func SetButtonFunc(ih *Ihandle, f ButtonFunc)
func SetCaretFunc ¶
func SetClassDefaultAttribute ¶
func SetClassDefaultAttribute(classname, name, value string)
func SetDblclickFunc ¶
func SetDblclickFunc(ih *Ihandle, f DblclickFunc)
func SetDestroyFunc ¶
func SetDestroyFunc(ih *Ihandle, f DestroyFunc)
func SetDropFilesFunc ¶
func SetDropFilesFunc(ih *Ihandle, f DropFilesFunc)
func SetEditFunc ¶
func SetEnterWindowFunc ¶
func SetEnterWindowFunc(ih *Ihandle, f EnterWindowFunc)
func SetGetFocusFunc ¶
func SetGetFocusFunc(ih *Ihandle, f GetFocusFunc)
func SetHelpFunc ¶
func SetIdleFunc ¶
func SetIdleFunc(f IdleFunc)
The user idle callback function can use a select on input channels and a time.After() to process external events without taking too much CPU (idle loop can behave almost like an infinite loop otherwise) Example:
func idleFunc() int { select { case cmd := <-idleChan: // process cmd case <-time.After(time.Duration(150 * time.Millisecond)): } return iup.DEFAULT }
func SetKAnyFunc ¶
func SetKillFocusFunc ¶
func SetKillFocusFunc(ih *Ihandle, f KillFocusFunc)
func SetLanguage ¶
func SetLanguage(lng string)
func SetLeaveWindowFunc ¶
func SetLeaveWindowFunc(ih *Ihandle, f LeaveWindowFunc)
func SetListActionFunc ¶
func SetListActionFunc(ih *Ihandle, f ListActionFunc)
func SetMapFunc ¶
func SetMotionFunc ¶
func SetMotionFunc(ih *Ihandle, f MotionFunc)
func SetMultiselectFunc ¶
func SetMultiselectFunc(ih *Ihandle, f MultiselectFunc)
func SetShowFunc ¶
func SetSpinFunc ¶
func SetTabChangeFunc ¶
func SetTabChangeFunc(ih *Ihandle, f TabChangeFunc)
func SetTabChangePosFunc ¶
func SetTabChangePosFunc(ih *Ihandle, f TabChangePosFunc)
func SetTextActionFunc ¶
func SetTextActionFunc(ih *Ihandle, f TextActionFunc)
func SetToggleActionFunc ¶
func SetToggleActionFunc(ih *Ihandle, f ToggleActionFunc)
func SetTrayClickFunc ¶
func SetTrayClickFunc(ih *Ihandle, f TrayClickFunc)
func SetUnmapFunc ¶
func SetValueChangedFunc ¶
func SetValueChangedFunc(ih *Ihandle, f ValueChangedFunc)
func SetfAttribute ¶
func SetfAttributeId ¶
func SetfAttributeId2 ¶
func StoreAttribute ¶
func StoreGlobal ¶
func StoreGlobal(name, value string)
func StringArrayToC ¶
func TextConvertLinColToPos ¶
func UpdateChildren ¶
func UpdateChildren(ih *Ihandle)
Types ¶
type ActionFunc ¶
type DestroyFunc ¶
type EnterWindowFunc ¶
type GetFocusFunc ¶
type Ihandle ¶
Primary widget handle type.
func ColorBrowser ¶
func ColorBrowser(opts ...interface{}) *Ihandle
func Dialog ¶
Differs from IupDialog in that any number of parameters may be passed after the child widget. Strings will be interpreted as attributes to set on the newly created dialog.
func ElementPropertiesDialog ¶
func GetAttributeHandle ¶
func GetBrother ¶
func GetDialogChild ¶
func GetNextChild ¶
func LayoutDialog ¶
func MessageDlg ¶
func MessageDlg(opts ...interface{}) *Ihandle
func Normalizer ¶
func Normalizerv ¶
func OleControl ¶
func OleControl(opts ...interface{}) *Ihandle
func PreviousField ¶
func ProgressBar ¶
func ProgressBar(opts ...interface{}) *Ihandle
func SetAttrs ¶
This method does not exist in C Iup. It has been provided as a convience function to allow code such as:
box := iup.Hbox(button1, button2).SetAttrs("GAP", "5", "MARGIN", "8x8")
C Iup provides SetAtt for this purpose but in Go Iup SetAttrs is an easier method to accomplish this task due to no necessity of handle_name.
type KillFocusFunc ¶
type LeaveWindowFunc ¶
type MultiselectFunc ¶
type TabChangeFunc ¶
type TabChangePosFunc ¶
type ToggleActionFunc ¶
type TrayClickFunc ¶
type ValueChangedFunc ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
iup-greeter
Hello World using a custom dialog.
|
Hello World using a custom dialog. |
iup-hello
Show a 'Hello World' message box.
|
Show a 'Hello World' message box. |
iup-rot13
Hello World using a custom dialog.
|
Hello World using a custom dialog. |
iup-versions
Display the go-iup and Iup library version numbers.
|
Display the go-iup and Iup library version numbers. |