gui

package
v0.0.0-...-e758773 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2011 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package gui defines a basic graphical user interface programming model.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigEvent

type ConfigEvent struct {
	Config image.Config
}

A ConfigEvent is sent each time the window's color model or size changes. The client should respond by calling Window.Screen to obtain a new image.

type ErrEvent

type ErrEvent struct {
	Err os.Error
}

An ErrEvent is sent when an error occurs.

type KeyEvent

type KeyEvent struct {
	// The value k represents key k being pressed.
	// The value -k represents key k being released.
	// The specific set of key values is not specified,
	// but ordinary characters represent themselves.
	Key int
}

A KeyEvent is sent for a key press or release.

type MouseEvent

type MouseEvent struct {
	// Buttons is a bit mask of buttons: 1<<0 is left, 1<<1 middle, 1<<2 right.
	// It represents button state and not necessarily the state delta: bit 0
	// being on means that the left mouse button is down, but does not imply
	// that the same button was up in the previous MouseEvent.
	Buttons int
	// Loc is the location of the cursor.
	Loc image.Point
	// Nsec is the event's timestamp.
	Nsec int64
}

A MouseEvent is sent for a button press or release or for a mouse movement.

type Window

type Window interface {
	// Screen returns an editable Image for the window.
	Screen() draw.Image
	// FlushImage flushes changes made to Screen() back to screen.
	FlushImage()
	// EventChan returns a channel carrying UI events such as key presses,
	// mouse movements and window resizes.
	EventChan() <-chan interface{}
	// Close closes the window.
	Close() os.Error
}

A Window represents a single graphics window.

Directories

Path Synopsis
Package x11 implements an X11 backend for the exp/gui package.
Package x11 implements an X11 backend for the exp/gui package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL