Categorygithub.com/whtiehack/wingui
modulepackage
0.0.9
Repository: https://github.com/whtiehack/wingui.git
Documentation: pkg.go.dev

# README

Windows GUI Library - wingui

GitHub Go Report Card GoDoc GitHub All Releases

Actions Status

Golang GUI library for windows, UI created by ResEdit or Visual Studio Resource Editor

Lightweight, high performance and small executable file size Windows GUI library.

UI Design tool

ResEdit

Visual Studio Resource Editor

Other dialog box editor

Requires

GCC (Optionally, windres.exe can be used to generate a syso file from res or rc.)

MinGW http://www.mingw.org

or

TDM-GCC http://tdm-gcc.tdragon.net/

windres.exe

This tool in TDM-GCC-64/bin/windres.exe,don't know where in MinGW.

You can also use rc.exe and link.exe to generate syso file.

Usage

Simple usage:

Generate x.syso file from rc or res file use windres.exe tool.

generate syso file:

windres -i emptyProject/Debug/resource.res -O coff -o vsui.syso

or

windres -i ui/ui.rc -O coff -o ui.syso

main.go

package main

import "github.com/whtiehack/wingui"

func main() {
	dlg, _ := wingui.NewDialog(101, 0, nil)
	dlg.SetIcon(105)
	btnok, _ := wingui.BindNewButton(1002, dlg)
	btncancel, _ := wingui.BindNewButton(1003, dlg)
	btnok.OnClicked = func() {
		dlg.Close()
	}
	btncancel.OnClicked = btnok.OnClicked
	dlg.Show()
	// This invoke is optional.
	wingui.SetCurrentDialog(dlg.Handle())
	wingui.MessageLoop()
}


run: go run .

Don't use go run main.go, because golang can't load x.syso files.

More examples

Examples

see https://github.com/whtiehack/wingui/tree/master/examples

Welcome PRs.

References

https://github.com/lxn/walk

https://github.com/sumorf/gowi

https://docs.microsoft.com/zh-cn/windows/win32/

https://docs.microsoft.com/zh-cn/windows/win32/uxguide/controls

https://docs.microsoft.com/zh-cn/windows/win32/controls/window-controls

Screenshot

UI Screenshot details

Effect

resedit

wowjump

File size

size

ResEdit

resedit

wowjump ResEdit Download

Visual Studio Resource Editor

vsreseditor

TODOs

click to show
  • Edit

  • Static Text

  • Image

  • ComboBoxx

  • ListBox


Button
  • PushButton
  • CheckBox
  • Radio Button

  • Slider Control

  • Progress Bar

  • Tab Control

  • ListView Control

  • Spin Control

  • Rich Edit

  • DateTimePicker

  • Month Calendar

  • TreeView Control

  • Hot Key

  • Accelerator

  • Menu

Recommend

If you need to do complex GUI programs, you can use govcl or walk.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

BindNewButton create a new Button and bind to target dlg.
No description provided by the author
BindNewComboBox create a new ComboBox and bind to target dlg.
BindNewEdit create a new Edit and bind to dlg.
BindNewStatic create a new Image and bind to target dlg.
BindNewListBox create a new ListBox and bind to target dlg.
BindNewProgressBar create a new ProgressBar and bind to target dlg.
BindNewStatic create a new Static and bind to target dlg.
BindNewTrackBar create a new TrackBar and bind to target dlg.
BindTabControl create a new TabControl and bind to target dlg.
InitHInstance init hInstance,used by Dialog APIs.
MessageLoop start windows message loop.
NewBitmapFromFile create a new Bitmap from file.
NewBitmapFromResource create a new Bitmap from resource.
NewBitmapFromResourceId create a new Bitmap from resource ID.
No description provided by the author
NewButton create a new Button,need bind to Dialog before use.
NewComboBox create a new ComboBox,need bind to Dialog before use.
NewDialog create a new Dialog.
NewEdit create a new Edit ,need bind to Dialog before use.
NewImage create a new Image,need bind to Dialog before use.
NewListBox create a new ListBox,need bind to Dialog before use.
NewModalDialog create a new modal Dialog.
NewProgressBar create a new ProgressBar,need bind to Dialog before use.
NewStatic create a new Static,need bind to Dialog before use.
NewTabControl create a new TabControl, need bind to Dialog before use.
NewTrackBar create a new TrackBar,need bind to Dialog before use.
No description provided by the author
SetCurrentDialog make sure Message Loop could process dialog msg correct,such as Tabstop msg.

# Structs

Bitmap struct.
Button a widget for Dialog.
ComboBox a ComboBox widget for Dialog.
Dialog is main windows struct.
DialogConfig TODO.
Edit a widget for Dialog.
Image a static image widget for Dialog.
ListBox a ListBox widget for Dialog.
ProgressBar a widget for Dialog.
Rectangle is a Rect struct.
No description provided by the author
Static a static label widget for Dialog.
TabControl a widget for Dialog.
TrackBar a widget for Dialog.
WindowBase is an interface that provides operations common to all windows.

# Interfaces

Widget inspect dialog item.

# Type aliases

ModalDialogCallBack is modal dialog callback.