Skip to content

Add callbacks to widget interface #6

@redstarcoder

Description

@redstarcoder

Currently even implementing a simple button click can get a bit messy. This wouldn't be an issue if we had simple callbacks:

// KeyPress processes a KeyPress event
type KeyPressCallback func(key glfw.Key, action glfw.Action, mods glfw.ModifierKey)
OnKeyPress(callback KeyPressCallback)
// CharPress processes a character
type CharPressCallback func(char rune)
OnCharPress(callback CharPressCallback)
// MMove processes a MouseMove event
type MMoveCallback func(xpos, ypos float64)
OnMMove(callback MMoveCallback)
// MClick processes a MouseClick event
type MClickCallback func(xpos, ypos float64, button glfw.MouseButton, action glfw.Action, mods glfw.ModifierKey)
OnMClick(callback MClickCallback)

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions