Skip to content
Projets

À propos

Energy est un framework développé en Go et basé sur CEF (Chromium Embedded Framework), destiné à créer des applications de bureau multiplateformes pour Windows, Mac OS X et Linux.

Autres projets

Comment ces chiffres sont mesurés

What you can do

  • 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

Progression mesurée des étoiles

in 24h
+1
in 7 days
+1
in 15 days
+2
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

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

Explorer des projets similaires

Chargement…