Documentation
¶
Overview ¶
Package window provides GTK window implementations.
Index ¶
- Variables
- func ErrWidgetCreationFailed(name string) error
- type MainWindow
- func (mw *MainWindow) AddOverlay(widget *gtk.Widget)
- func (mw *MainWindow) Close()
- func (mw *MainWindow) ContentArea() *gtk.Box
- func (mw *MainWindow) ContentOverlay() *gtk.Overlay
- func (mw *MainWindow) Destroy()
- func (mw *MainWindow) SetContent(widget *gtk.Widget)
- func (mw *MainWindow) SetTitle(title string)
- func (mw *MainWindow) Show()
- func (mw *MainWindow) TabBar() *component.TabBar
- func (mw *MainWindow) Window() *gtk.ApplicationWindow
- type WindowError
Constants ¶
This section is empty.
Variables ¶
var ( // ErrWindowCreationFailed is returned when the GTK application window cannot be created. ErrWindowCreationFailed = WindowError{Message: "failed to create application window"} )
Functions ¶
func ErrWidgetCreationFailed ¶
ErrWidgetCreationFailed returns an error for a failed widget creation.
Types ¶
type MainWindow ¶
type MainWindow struct {
// contains filtered or unexported fields
}
MainWindow represents the main browser window.
func New ¶
func New(ctx context.Context, app *gtk.Application, tabBarPosition string) (*MainWindow, error)
New creates a new main browser window. tabBarPosition controls whether the tab bar is at the "top" or "bottom" (default: "top").
func (*MainWindow) AddOverlay ¶
func (mw *MainWindow) AddOverlay(widget *gtk.Widget)
AddOverlay adds a widget as an overlay above the content area.
func (*MainWindow) ContentArea ¶
func (mw *MainWindow) ContentArea() *gtk.Box
ContentArea returns the main content container widget.
func (*MainWindow) ContentOverlay ¶ added in v0.27.0
func (mw *MainWindow) ContentOverlay() *gtk.Overlay
ContentOverlay returns the overlay container for the content area.
func (*MainWindow) Destroy ¶
func (mw *MainWindow) Destroy()
Destroy releases all GTK resources held by the window.
func (*MainWindow) SetContent ¶
func (mw *MainWindow) SetContent(widget *gtk.Widget)
SetContent replaces the current content widget with the given widget.
func (*MainWindow) SetTitle ¶ added in v0.21.0
func (mw *MainWindow) SetTitle(title string)
SetTitle sets the window title.
func (*MainWindow) TabBar ¶
func (mw *MainWindow) TabBar() *component.TabBar
TabBar returns the window's tab bar component.
func (*MainWindow) Window ¶
func (mw *MainWindow) Window() *gtk.ApplicationWindow
Window returns the underlying GTK application window.
type WindowError ¶
type WindowError struct {
Message string
}
WindowError is a window-related error.
func (WindowError) Error ¶
func (e WindowError) Error() string
Error implements the error interface.