Documentation
¶
Overview ¶
Package gtk is the GTK4-hosted Linux back-end: instead of blitting to a from-scratch X11/Wayland surface, GTK owns the window, the toolkit's pixel framebuffer goes in a GtkPicture, and native platform controls (toolkit.NativeControl) are real GtkEntry/GtkButton/… overlaid above it in a GtkFixed. It links no cgo — everything is github.com/go-gtk/gtk4 over purego.
It is the third native-control host, the sibling of internal/cocoa and internal/win32, and runs the same NativeControl descriptor reconcile (syncNative) they do — but here the widgets are GTK's, so a radio group finally groups properly rather than sharing one global action.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
Window is the GTK4-hosted back-end window. It satisfies the window.Backend contract (Run/Close/Size/String).
func Open ¶
Open creates the GTK window (but does not enter the loop; Run does). width and height are logical points; scale is framebuffer pixels per point.
func (*Window) Repaint ¶ added in v0.63.0
func (w *Window) Repaint()
Repaint asks for a frame from any goroutine. It implements github.com/go-widgets/window.Repainter: the application present loop calls it (gated by the handler's NeedsPresent), and a background producer that has queued a scene change may call it directly. It only raises a flag the frame clock reads on the main thread, so it makes no GTK call off that thread and never allocates a callback — cheap enough to call every tick.
func (*Window) Run ¶
Run binds root and drives the GLib main loop until the window is closed. It presents a frame only when one was asked for — see Window.Repaint.