ui/eg/frame-place
Noah Petherbridge f9b305679a Tooltip Widget and Event Refactor
* Tooltip can be added to any target widget (e.g. Button) and pop up on
  mouse over.
* Refactor the event system. Instead of passing a render.Point to all
  event handlers, pass an EventData struct which can hold the Point or
  the render.Engine.
* Add event types Computed and Present, so a widget can set a handler on
  whenever its Computed or Present method is called.
2020-03-09 17:13:33 -07:00
..
main.go Tooltip Widget and Event Refactor 2020-03-09 17:13:33 -07:00
README.md Place Strategy for Frame Widget 2020-03-08 22:07:46 -07:00
screenshot.png Place Strategy for Frame Widget 2020-03-08 22:07:46 -07:00

Frame Placement Example

Screenshot

About

This demonstrates using the Place() method of the MainWindow and Frame to position widgets around the window. The MainWindow itself and two child frames (red and blue) are given the same set of buttons, placed relative to their own parent widget.

The options for frame placing are:

  • Point: Absolute X,Y coordinate relative to parent
  • Side: binding the widget relative to a side of its parent.
    • Top, Bottom, Left and Right to anchor to a side. In Bottom and Right, the child widget's size is taken into account, so the right edge of the widget would be Right pixels from the parent's right edge.
    • Center and Middle options allow to anchor it to the center horizontally or middle vertically.

Click any button and the title bar will update to show the name of the button clicked and which parent it belonged to.

Run it

go run main.go