Skip to content
Proyek

Tentang

Energy adalah framework yang dikembangkan dengan bahasa Go dan berbasis CEF (Chromium Embedded Framework) untuk membuat aplikasi desktop lintas platform untuk Windows, Mac OS X, dan Linux

Proyek lainnya

Cara angka ini diukur

623 bintang50 Fork +1 dalam 24 jam

Yang dapat Anda lakukan

  • Three rendering engines: LCL native controls (lightweight, system look), Webview system runtime (WebView2 / WebKit2, no extra dependencies), CEF full Chromium (complete browser capabilities). Use them together or independently
  • Visual designer: Energy Designer supports drag-and-drop components, property/event configuration, and one-click run preview, generating maintainable Go source code
  • 100+ native controls: Based on LCL, providing 100+ system-native GUI components including buttons, grids, tree views, list views, dialogs, code editors, and more
  • Go + Web hybrid architecture: Go backend handles window management, system calls, file I/O, encryption, etc.; Web frontend (HTML + CSS + JavaScript) handles UI rendering. Supports Vue, React, Angular, and other mainstream frontend frameworks

Pertumbuhan bintang terukur

dalam 24 jam
+1
dalam 7 hari
+1
dalam 15 hari
+2
dalam 1 bulan
Mengumpulkan riwayat

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

3.0

A Go framework for building cross-platform desktop applications based on LCL & CEF & Webview (Webview2, Webkit2)

中文 | English


go-version github release Build Status repo Go Report Go Reference Ask DeepWiki Discord codecov contributors license

Introduction

Energy is a framework developed in Go using: LCL, CEF, Webview2, Webkit2Gtk, WKWebView

LCL — Native UI component library

CEF — Browser component, CEF3 via CEF4Delphi

Webview2 — Browser component, Webview2 via WebView4Delphi; uses the system runtime

Webkit2 (Webkit2Gtk / WKWebView) — Browser component, Webkit2; uses the system runtime

Features

  • Three rendering engines: LCL native controls (lightweight, system look), Webview system runtime (WebView2 / WebKit2, no extra dependencies), CEF full Chromium (complete browser capabilities). Use them together or independently
  • Visual designer: Energy Designer supports drag-and-drop components, property/event configuration, and one-click run preview, generating maintainable Go source code
  • 100+ native controls: Based on LCL, providing 100+ system-native GUI components including buttons, grids, tree views, list views, dialogs, code editors, and more
  • Go + Web hybrid architecture: Go backend handles window management, system calls, file I/O, encryption, etc.; Web frontend (HTML + CSS + JavaScript) handles UI rendering. Supports Vue, React, Angular, and other mainstream frontend frameworks
  • Bidirectional IPC: High-performance event-driven IPC enabling Go and Web to call each other and exchange data, with callback support and automatic type conversion
  • Local resource loading: Custom protocol scheme to load local files or Go embedded resources directly, without an HTTP server; HTTP server loading is also supported
  • Cross-platform: Windows (7+), macOS (Intel / Apple Silicon), Linux (x86 / ARM)
  • NO CGO: Optionally develop in pure Go — no CGO compilation required, lowering the environment setup barrier

Development Environment

  • Golang >= 1.20
  • Energy development environment ([CEF or System Runtime], libenergy runtime)
  1. Install Golang
  2. Create a project from Energy Designer Releases

Quick Start

LCL Native Mode

package main

import (
	"github.com/energye/lcl/api"
	"github.com/energye/lcl/lcl"
)

type TMainForm struct {
	lcl.TEngForm
}

var MainForm TMainForm

func main() {
	lcl.Init()
	lcl.RunApp(&MainForm)
}

func (m *TMainForm) FormCreate(sender lcl.IObject) {
	m.SetCaption("Hello Energy")
	m.SetWidth(400)
	m.SetHeight(300)
	m.WorkAreaCenter()

	btn := lcl.NewButton(m)
	btn.SetParent(m)
	btn.SetCaption("Click Me")
	btn.SetLeft(50)
	btn.SetTop(50)
	btn.SetOnClick(func(sender lcl.IObject) {
		api.ShowMessage("Hello from Go!")
	})
}

Webview Hybrid Mode

package main

import (
	"github.com/energye/energy/v3/application"
	"github.com/energye/energy/v3/window"
	"github.com/energye/energy/v3/wv"
	"github.com/energye/lcl/lcl"
	"github.com/energye/lcl/types"
)

type TForm1 struct {
	window.TWindow
	Webview1 wv.IWebview
}

var Form1 TForm1

func (m *TForm1) FormCreate(sender lcl.IObject) {
	m.TWindow.InternalBeforeFormCreate() // window create before call
	m.SetCaption("Hello Energy")
	m.SetWidth(800)
	m.SetHeight(600)

	m.Webview1 = wv.NewWebview(m)
	m.Webview1.SetAlign(types.AlClient)
	m.Webview1.SetParent(m)

	m.TWindow.FormCreate(sender) // window widget create after call

	m.Webview1.SetWindow(m)
}

func main() {
	wvApp := wv.Init()
	wvApp.SetOptions(application.Options{
		DefaultURL: "https://energye.github.io",
	})
	wv.Run(&Form1)
}

Using Energy Designer

  1. Launch Energy Designer
  2. Create a new project, drag components onto the canvas
  3. Configure properties and events
  4. Click Run to preview

NO CGO

Optionally develop in pure Go — no CGO compilation required

Examples

Documentation

Platform Support

Windows MacOS Linux

32-bit 64-bit Tested OS Versions
Windows Windows Windows 7, 10, 11
MacOSX MacOSX MacOSX MacOSX Intel x86
MacOS M1/M2 MacOS MacOS MacOS Apple Silicon
Linux Linux Linux Deepin 20.8, Ubuntu 18.04, LinuxMint 21
Linux ARM Linux ARM Linux ARM Kylin-V10-SP1-2107

Related Projects


If you find this project helpful, please give us a Star!


Screenshots

image


License

license

Contributors

Jelajahi proyek terkait

Memuat…