Go wrapper around the Iup GUI toolset

Iup Go Wrapper

iup is a Go wrapper around the Iup GUI toolkit. The project was started on April 27, 2011.

Fork

https://github.com/grd/iup is a fork of https://github.com/jcowgar/go-iup because I got frustrated that the original repo just didn't work and appeared abandoned. I wanted to update it to Go 1.1 and add a 10 minute quick installation guide. --grd

Changes in go-iup vs. Iup in C

Documentation is minimal with go-iup because Iup's documentation is very good and valid since go-iup strives for a 1-to-1 mapping. However, there are some general changes to better fit into the Go language.

  1. Iup has been dropped from the function names. go-iup functions are already accessed by the iup package name. So, IupOpen becomes iup.Open(), IupVersion() becomes iup.Version(), etc...
  2. IUP_ has been dropped from the constant names for the same reason as #1. Thus, IUP_IGNORE becomes iup.IGNORE, IUP_DEFAULT becomes iup.DEFAULT, etc...
  3. Anything as of Iup 3.5 that has been marked as deprecated has not and will not be wrapped in go-iup. No sense in wrapping it and then next release removing it. Just don't even start with it.
  4. The old ACTION name has been replaced by a SetCallback method in Iup. Thus, any widget that expects an ACTION name on control creation in Iup C does not in go-iup. For example, IupButton("Press Me", "PRESS_ME_ACTION") no longer takes the "PRESS_ME_ACTION" parameter.
  5. All widgets can accept a variable number of optional parameters. These parameters, if a string, are considered attributes to be set on the newly created widget. If a valid Icallback type, then they are considered callbacks to be set on the newly created widget.

Callbacks, Actions ... Old and New

button = IupButton("Say Hello", "SAY_HELLO")
IupSetAttributes(button, "FLAT=YES,ALIGNMENT=ALEFT")
IupSetFunction("SAY_HELLO", printHello)

has been replaced with

button := iup.Button("Say Hello", 
    "FLAT=YES,ALIGNMENT=ALEFT",
    (iup.ActionFunc)(printHello))

The optional parameters can appear in any order. For example the following is the same as the prior:

button := iup.Button("Say Hello", 
    "FLAT=YES", 
    (iup.ActionFunc)(printHello)), 
    "ALIGNMENT=ALEFT")

Installing the Iup library

go-iup deals with three projects from Tecgraf:

  • Iup - Cross platform native control GUI library
  • Cd - Cross platform canvas drawing library
  • Im - Cross platform image library

To use go-iup you must install all three libraries. Download the appropriate archive files from the Iup Download Tips page. You should then place the .a (library) files in your lib/ directory and .h (header) files in your include/ directory. If compiling on Windows, .dll (dynamically linked library) files in your %PATH%.

Building go-iup

$ git clone https://github.com/leonrbaker/iup.git
$ cd go-iup
$ ./all.bash

Ten minute quick installation guide for Ubuntu 12.04

Fetch the Linux Libraries from sourceforge.net according the Iup Download Tips page. In this case (Ubuntu 64-bit platform):

  • Im - im-3.8.1_Linux32_64_lib.tar.gz
  • Cd - cd-5.6.1_Linux32_64_lib.tar.gz
  • Iup - iup-3.8_Linux32_64_lib.tar.gz

Extract the libraries and then take the following steps for each of the libraries:

$ cd *extracted library*
$ sudo bash install
$ sudo bash install_dev

Now the libraries are installed.

However, Go iup requires the development libraries from Gtk+ installed. If it's not already installed, execute the following:

$ sudo apt-get install libgtk2.0-dev

Installing Go iup.

$ go get github.com/grd/iup
$ <GOPATH>/src/github.com/grd/iup/all.bash

That's it. Don't complain if it doesn't work. It's probably your fault.

Special notes for Windows

You should download the 'dllw4' variant of Iup. This is the dynamically linked version of the libraries for MinGW. For easy compliation you should have already installed a working version of MinGW and MSYS. Building will be the same as any other platform but started from the MSYS Bash shell.

Quick installation guide for Windows

Make sure MinGW is installed and that it contains the C++ libraries! MinGW with installer is 32-bit only, and for simplicity that what we use.

Fetch the Windows Shared Libraries from sourceforge.net according the Iup Download Tips page. In this case:

  • Im - im-3.8.1_Win32_dllw4_lib.zip
  • Cd - cd-5.6.1_Win32_dllw4_lib.zip
  • Iup - iup-3.8_Win32_dllw4_lib.zip

Extract the libraries to a destination of choice, for instance C:\iup. Make sure that the dll's and .a's are placed directly in this dir and the include files are in the include directory. Open the command prompt and execute the following:

C:\> set IUPHOME=C:\iup

With C:\iup I mean the location where the iup files are placed.

Installing Go iup.

C:\> go get github.com/grd/iup 

(Or download the zip file from github.com)

C:\> <GOPATH>/src/github.com/grd/iup/all

Again that's it. Don't complain if it doesn't work. It's probably your fault.

Similar Resources

Windows GUI library for Go (Golang). Comes with a graphical UI designer.

Version 2 Please go to Version 2 of this library for the latest version. Windows GUI Library This is a pure Go library to create native Windows GUIs.

Jan 1, 2023

Super minimal, rock-solid foundation for concurrent GUI in Go.

Super minimal, rock-solid foundation for concurrent GUI in Go.

faiface/gui Super minimal, rock-solid foundation for concurrent GUI in Go. Installation go get -u github.com/faiface/gui Currently uses GLFW under th

Dec 23, 2022

Cross platform rapid GUI framework for golang based on Dear ImGui.

Cross platform rapid GUI framework for golang based on Dear ImGui.

giu Cross platform rapid GUI framework for golang based on Dear ImGui and the great golang binding imgui-go. Any contribution (features, widgets, tuto

Dec 28, 2022

This project provides Go bindings for nuklear.h — a small ANSI C GUI library.

This project provides Go bindings for nuklear.h — a small ANSI C GUI library.

Nuklear Package nk provides Go bindings for nuklear.h — a small ANSI C gui library. See github.com/vurtun/nuklear. All the binding code has automatica

Jan 1, 2023

GUI toolkit for go

GUI toolkit for go

Mostly-immediate-mode GUI library for Go. Source port to go of an early version of nuklear. ⚠️ Subject to backwards incompatible changes. ⚠️ ⚠️ Featur

Jan 1, 2023

A list of Go GUI projects

(Please follow @Go100and1 for updates on this page, and all kinds of details and facts in Go). A list of Go GUI/graphics/image related projects native

Jan 3, 2023

Odile is a simple GUI for the croc utility by Schollz.

Odile is a simple GUI for the croc utility by Schollz.

Odile Odile is a simple GUI for the croc utility by Schollz. This program uses Fyne, a UI toolkit written in Go, as the graphical interface. Effort wa

Dec 17, 2022

Golang bindings for XCGUI, Windows GUI library, DirectUI design idea.

Golang bindings for XCGUI, Windows GUI library, DirectUI design idea.

XCGUI 项目文档 帮助文档 程序示例 介绍 English | 简体中文 DirectUI设计思想: 在窗口内没有子窗口,界面元素都是逻辑上的区域(无HWND句柄,安全,灵活), 所有UI元素都是自主开发(不受系统限制), 更加灵活的实现各种程序界面,满足不同用户的需求.

Dec 22, 2022

Tutorials for Gio, the GUI framwork in Go.

Tutorials for Gio, the GUI framwork in Go.

#go, #golang, #gui, #gioui You want a Gui. Of course you do. Did you know that Go has a great GUI library called Gio? In a 10-part tutorial we will st

Dec 28, 2022
Easy Go GUI wrapper for interactive manipulation of visual algorithms/backend code.
Easy Go GUI wrapper for interactive manipulation of visual algorithms/backend code.

RenderView ================ Install: go get github.com/TheGrum/renderview Needs either Shiny (limited functionality), Gio, go-gtk, or gotk3. The latt

Aug 4, 2022
Cross platform GUI in Go based on Material Design
Cross platform GUI in Go based on Material Design

About Fyne is an easy to use UI toolkit and app API written in Go. It is designed to build applications that run on desktop and mobile devices with a

Jan 3, 2023
Platform-native GUI library for Go.

ui: platform-native GUI library for Go This is a library that aims to provide simple GUI software development in Go. It is based on my libui, a simple

Jan 9, 2023
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by Electron)

Thanks to go-astilectron build cross platform GUI apps with GO and HTML/JS/CSS. It is the official GO bindings of astilectron and is powered by Electr

Jan 9, 2023
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs)
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs)

gowd Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs) How to use this library: Download and install nwjs Install this library g

Dec 11, 2022
A Windows GUI toolkit for the Go Programming Language
A Windows GUI toolkit for the Go Programming Language

About Walk Walk is a "Windows Application Library Kit" for the Go Programming Language. Its primarily useful for Desktop GUI development, but there is

Dec 30, 2022
RobotGo, Go Native cross-platform GUI automation @vcaesar

Robotgo Golang Desktop Automation. Control the mouse, keyboard, bitmap, read the screen, Window Handle and global event listener. RobotGo supports Mac

Jan 7, 2023
Common library for Go GUI apps on Windows
Common library for Go GUI apps on Windows

winc Common library for Go GUI apps on Windows. It is for Windows OS only. This makes library smaller than some other UI libraries for Go.

Dec 12, 2022
Cross-platform GUI for go is never this easy and clean.
Cross-platform GUI for go is never this easy and clean.

gimu Strongly suggest NOT to use this project anymore, the auto-generated cgo wrapper of Nuklear has a random crash issue which is hard to fix (becaus

Jul 12, 2022
Windows GUI framework for Go.

gform is an easy to use Windows GUI toolkit for Go It provides two approaches to create UI. 1. Pure code. gform.Init() mainWindow := gform.NewForm(ni

Jan 1, 2023