{"id":17268198,"url":"https://github.com/gen2brain/iup-go","last_synced_at":"2025-04-08T16:07:43.855Z","repository":{"id":44452748,"uuid":"497891663","full_name":"gen2brain/iup-go","owner":"gen2brain","description":"Cross-platform UI library with native controls","archived":false,"fork":false,"pushed_at":"2024-11-06T05:00:29.000Z","size":4861,"stargazers_count":303,"open_issues_count":7,"forks_count":11,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-01T15:11:43.830Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gen2brain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-30T10:20:33.000Z","updated_at":"2025-03-21T16:29:02.000Z","dependencies_parsed_at":"2024-12-02T01:18:56.247Z","dependency_job_id":null,"html_url":"https://github.com/gen2brain/iup-go","commit_stats":{"total_commits":52,"total_committers":5,"mean_commits":10.4,"dds":0.09615384615384615,"last_synced_commit":"0f971ac33ed43d2363dacc7c6deca7508226e29f"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Fiup-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Fiup-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Fiup-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen2brain%2Fiup-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gen2brain","download_url":"https://codeload.github.com/gen2brain/iup-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247878022,"owners_count":21011158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T08:12:46.427Z","updated_at":"2025-04-08T16:07:43.826Z","avatar_url":"https://github.com/gen2brain.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## iup-go\n[![Build Status](https://github.com/gen2brain/iup-go/actions/workflows/build.yml/badge.svg)](https://github.com/gen2brain/iup-go/actions)\n[![Go Reference](https://pkg.go.dev/badge/github.com/gen2brain/iup-go.svg)](https://pkg.go.dev/github.com/gen2brain/iup-go/iup)\n\nGo bindings for [IUP](https://www.tecgraf.puc-rio.br/iup/), a multi-platform toolkit for building graphical user interfaces.\nThe toolkit provides system native UI controls for Windows, Linux (GTK+), and macOS.\n\nIUP C source code is included and compiled together with bindings.\nNote that the first build can take a few minutes.\n\n### Requirements\n\n#### Windows\n\nOn Windows, you need a C compiler, like [Mingw-w64](https://mingw-w64.org) or [TDM-GCC](http://tdm-gcc.tdragon.net/).\nYou can also build a binary in [MSYS2](https://msys2.github.io/) shell.\n\nNote that Windows manifest is included in the build by default. IUP controls appearance will follow the system appearance only if the manifest is used.\nIf not using the manifest, it will always look like Windows XP Classic. See below how to disable manifest if you want to include your own.\n\n* To remove console window, i.e., compile GUI app, build with `-ldflags \"-H=windowsgui\"`.\n* You can add icon resource to `.exe` file with the [rsrc](https://github.com/akavel/rsrc) tool.\n\n![windows](examples/sample/sample_windows.png)\n\n#### Linux\n\nOn Linux, you need a C compiler and GTK+ development packages.\n\n* Debian/Ubuntu: `apt-get install libgtk-3-dev`\n* RedHat/Fedora: `dnf install gtk3-devel`\n\nWhen you are not using `gl` tag, the library is built with `GDK_NULL` to completely remove the [X11](https://en.wikipedia.org/wiki/X_Window_System) usage,\nso it should just work in [Wayland](https://en.wikipedia.org/wiki/Wayland_(display_server_protocol)).\n\nYou may provide explicit compiler and linker flags instead of using the defaults provided by pkg-config, if `gtk3` and other dependencies are in a non-standard location:\n\n```\nCGO_CFLAGS=\"-I\u003cinclude path\u003e ...\" CGO_LDFLAGS=\"-L\u003cdir\u003e -llib ...\" go build -tags nopkconfig\n```  \n\nNote that you can also build and link against the GTK2 version, see build tags below.\n\n![linux](examples/sample/sample_linux.png)\n\n#### macOS\n\nOn macOS, you need Xcode or Command Line Tools for Xcode.\n\nNote that support for `Cocoa` is a **work in progress**. Not everything is implemented. If you can help with Cocoa or GLCanvas, please join the IUP mailing list.\nAlso note that you must use and distribute binary in the `.app` directory, together with `.nib` compiled resources, see [example.app](https://github.com/gen2brain/iup-go/tree/main/dist/darwin/example.app).\n\nYou can also build for GTK+ in macOS, with `gtk` build tag. It will use [Quartz](https://en.wikipedia.org/wiki/Quartz_(graphics_layer)) native rendering. \nSee [screenshot](examples/sample/sample_darwin_gtk.png), `.app` is not required with GTK+.\n\nInstall GTK+ development packages with brew.\n\n* `brew install gtk+3`\n\n![darwin](examples/sample/sample_darwin.png)\n\n#### Other\n\nAlthough not tested, the library should work on other Unix-like systems, FreeBSD, NetBSD, OpenBSD, DragonFly, Solaris, Illumos, and AIX.\n\nYou can also compile for time-tested [Motif](https://en.wikipedia.org/wiki/Motif_(software)) library if GTK+ is not available,\nthough not all controls and attributes are possible, check the documentation for details.\n\n* Debian/Ubuntu: `apt-get install libmotif-dev libxmu-dev libxpm-dev`\n* RedHat/Fedora: `dnf install motif-devel libXpm-devel`\n\n![motif](examples/sample/sample_motif.png)\n\n### Build tags\n\n* `gl` - build with support for GLCanvas (Windows and Linux)\n* `gtk` - use GTK+ in macOS or Windows\n* `gtk2` - link with GTK2 version, default is GTK3 (Linux)\n* `motif` - build for X11/Motif 2.x environment\n* `nomanifest` - do not include manifest in Windows build\n* `nopkgconfig` - do not use pkg-config for compile and link flags. User specifies CGO_CFLAGS and CGO_LDFLAGS env vars\n\n### Documentation\n\n[IUP](https://www.tecgraf.puc-rio.br/iup/) documentation is nice, every Go function in doc reference there.\nAlso check [Go Reference](https://pkg.go.dev/github.com/gen2brain/iup-go/iup) and [Examples](https://github.com/gen2brain/iup-go/tree/main/examples).\n\n### Thread-Safety\n\nUser interface (and OpenGL) is usually not thread-safe and IUP is not thread-safe. Some platforms enforce running UI on the main thread.\nNote that a goroutine can arbitrarily and randomly be scheduled or rescheduled on different running threads.\n\nThe secondary threads (goroutine) should not directly update the UI, instead, use `PostMessage` that is expected to be thread-safe.\nSee [example](https://github.com/gen2brain/iup-go/tree/main/examples/postmessage) that sends data to an element,\nthat will be received by a callback when the main loop regains control. You can also use the `IdleFunc` and `Timer`.\n\n### Cross-compile (Linux)\n\nTo cross-compile for Windows install [MinGW](https://www.mingw-w64.org/) toolchain.\n\n```\n$ CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -ldflags \"-s -w\"\n$ file alarm.exe\nalarm.exe: PE32+ executable (console) x86-64, for MS Windows\n\n$ CGO_ENABLED=1 CC=i686-w64-mingw32-gcc GOOS=windows GOARCH=386 go build -ldflags \"-s -w\"\n$ file alarm.exe\nalarm.exe: PE32 executable (console) Intel 80386, for MS Windows\n```\n\nTo cross-compile for macOS install [OSXCross](https://github.com/tpoechtrager/osxcross) toolchain.\n\n```\n$ CGO_ENABLED=1 CC=x86_64-apple-darwin21.1-clang GOOS=darwin GOARCH=amd64 go build -ldflags \"-linkmode external -s -w '-extldflags=-mmacosx-version-min=10.14'\"\n$ file alarm\nalarm: Mach-O 64-bit x86_64 executable, flags:\u003cNOUNDEFS|DYLDLINK|TWOLEVEL|WEAK_DEFINES|BINDS_TO_WEAK\u003e\n\n$ CGO_ENABLED=1 CC=aarch64-apple-darwin21.1-clang GOOS=darwin GOARCH=arm64 go build -ldflags \"-linkmode external -s -w '-extldflags=-mmacosx-version-min=10.14'\"\n$ file alarm\nalarm: Mach-O 64-bit arm64 executable, flags:\u003cNOUNDEFS|DYLDLINK|TWOLEVEL|WEAK_DEFINES|BINDS_TO_WEAK|PIE\u003e\n```\n\n### Credits\n\n* [Tecgraf/PUC-Rio](https://www.tecgraf.puc-rio.br)\n* [matwachich](https://github.com/matwachich/iup)\n\n### License\n\niup-go is MIT licensed, same as IUP. View [LICENSE](https://github.com/gen2brain/iup-go/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgen2brain%2Fiup-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgen2brain%2Fiup-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgen2brain%2Fiup-go/lists"}