Documentation ¶
Overview ¶
Package tk is a wm[0] toolkit.
[0]: https://godoc.org/gitlab.com/cznic/wm
Index ¶
- type Meter
- type Scrollbar
- func (s *Scrollbar) HandlePosition() int
- func (s *Scrollbar) HandleSize() int
- func (s *Scrollbar) OnClickDecrement(h wm.OnMouseHandler, finalize func())
- func (s *Scrollbar) OnClickDecrementPage(h wm.OnMouseHandler, finalize func())
- func (s *Scrollbar) OnClickIncrement(h wm.OnMouseHandler, finalize func())
- func (s *Scrollbar) OnClickIncrementPage(h wm.OnMouseHandler, finalize func())
- func (s *Scrollbar) OnPaint(h wm.OnPaintHandler, finalize func())
- func (s *Scrollbar) OnSetHandlePosition(h wm.OnSetIntHandler, finalize func())
- func (s *Scrollbar) OnSetHandleSize(h wm.OnSetIntHandler, finalize func())
- func (s *Scrollbar) OnSetPosition(h wm.OnSetPositionHandler, finalize func())
- func (s *Scrollbar) OnSetSize(h wm.OnSetSizeHandler, finalize func())
- func (s *Scrollbar) OnSetStyle(h wm.OnSetStyleHandler, finalize func())
- func (s *Scrollbar) Paint(ctx wm.PaintContext)
- func (s *Scrollbar) Position() wm.Position
- func (s *Scrollbar) RemoveOnClickDecrement()
- func (s *Scrollbar) RemoveOnClickDecrementPage()
- func (s *Scrollbar) RemoveOnClickIncrement()
- func (s *Scrollbar) RemoveOnClickIncrementPage()
- func (s *Scrollbar) RemoveOnPaint()
- func (s *Scrollbar) RemoveOnSetHandlePosition()
- func (s *Scrollbar) RemoveOnSetHandleSize()
- func (s *Scrollbar) RemoveOnSetPosition()
- func (s *Scrollbar) RemoveOnSetSize()
- func (s *Scrollbar) RemoveOnSetStyle()
- func (s *Scrollbar) SetHandlePosition(v int)
- func (s *Scrollbar) SetHandleSize(v int)
- func (s *Scrollbar) SetPosition(v wm.Position)
- func (s *Scrollbar) SetSize(v wm.Size)
- func (s *Scrollbar) SetStyle(v wm.Style)
- func (s *Scrollbar) SetView(origin, viewportSize, contentSize int)
- func (s *Scrollbar) Size() wm.Size
- func (s *Scrollbar) Style() wm.Style
- type View
- func (v *View) End()
- func (v *View) Home()
- func (v *View) HorizontalScrollbarEnabled() bool
- func (v *View) OnSetHorizontalScrollbarEnabled(h wm.OnSetBoolHandler, finalize func())
- func (v *View) OnSetVerticalScrollbarEnabled(h wm.OnSetBoolHandler, finalize func())
- func (v *View) PageDown()
- func (v *View) PageUp()
- func (v *View) RemoveOnSetHorizontalScrollbarEnabled()
- func (v *View) RemoveOnSetVerticalScrollbarEnabled()
- func (v *View) SetHorizontalScrollbarEnabled(b bool)
- func (v *View) SetVerticalScrollbarEnabled(b bool)
- func (v *View) VerticalScrollbarEnabled() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Meter ¶
type Meter interface { // Metrics is called when window's viewport is set or updated. The // result .Height reflects the total contents height. The result .Width // reflect the maximum width of the content in area. If any of the // values are unknown a negative number is returned in the respective // output variable. Metrics(viewport wm.Rectangle) wm.Size }
Meter provides metrics of content displayed in the client area of a window.
type Scrollbar ¶
type Scrollbar struct {
// contains filtered or unexported fields
}
Scrollbar represents an UI element used to show that a View content overflows its window and provide visual feedback of the position of its viewport.
Scrollbar methods must be called only directly from an event handler goroutine or from a function that was enqueued using wm.Application.Post or wm.Application.PostWait.
func NewScrollbar ¶
NewScrollbar returns a newly created Scrollbar.
func (*Scrollbar) HandlePosition ¶
HandlePosition returns the position of the scrollbar handle.
func (*Scrollbar) HandleSize ¶
HandleSize returns the size of the scrollbar handle.
func (*Scrollbar) OnClickDecrement ¶
func (s *Scrollbar) OnClickDecrement(h wm.OnMouseHandler, finalize func())
OnClickDecrement sets a handler invokend on clicking the left arrow of a horizontal scrollbar or the up arrow of a vertical scrollbar. When the event handler is removed, finalize is called, if not nil.
func (*Scrollbar) OnClickDecrementPage ¶
func (s *Scrollbar) OnClickDecrementPage(h wm.OnMouseHandler, finalize func())
OnClickDecrementPage sets a handler invokend on clicking the area between the left arrow of and the scrollbar handle of a horizontal scrollbar or between the the up arrow and the scrollbar handle of a vertical scrollbar. When the event handler is removed, finalize is called, if not nil.
func (*Scrollbar) OnClickIncrement ¶
func (s *Scrollbar) OnClickIncrement(h wm.OnMouseHandler, finalize func())
OnClickIncrement sets a handler invokend on clicking the right arrow of a horizontal scrollbar or the down arrow of a vertical scrollbar. When the event handler is removed, finalize is called, if not nil.
func (*Scrollbar) OnClickIncrementPage ¶
func (s *Scrollbar) OnClickIncrementPage(h wm.OnMouseHandler, finalize func())
OnClickIncrementPage sets a handler invokend on clicking the area between the scrollbar handle and the right arrow of a horizontal scrollbar or between the scrollbar handle an dthe down arrow of a vertical scrollbar. When the event handler is removed, finalize is called, if not nil.
func (*Scrollbar) OnPaint ¶
func (s *Scrollbar) OnPaint(h wm.OnPaintHandler, finalize func())
OnPaint sets a paint handler. When the event handler is removed, finalize is called, if not nil.
func (*Scrollbar) OnSetHandlePosition ¶
func (s *Scrollbar) OnSetHandlePosition(h wm.OnSetIntHandler, finalize func())
OnSetHandlePosition sets a handler invoked on SetHandlePosition. When the event handler is removed, finalize is called, if not nil.
func (*Scrollbar) OnSetHandleSize ¶
func (s *Scrollbar) OnSetHandleSize(h wm.OnSetIntHandler, finalize func())
OnSetHandleSize sets a handler invoked on SetHandleSize. When the event handler is removed, finalize is called, if not nil.
func (*Scrollbar) OnSetPosition ¶
func (s *Scrollbar) OnSetPosition(h wm.OnSetPositionHandler, finalize func())
OnSetPosition sets a handler invoked on SetPosition. When the event handler is removed, finalize is called, if not nil.
func (*Scrollbar) OnSetSize ¶
func (s *Scrollbar) OnSetSize(h wm.OnSetSizeHandler, finalize func())
OnSetSize sets a handler invoked on SetSize. When the event handler is removed, finalize is called, if not nil.
func (*Scrollbar) OnSetStyle ¶
func (s *Scrollbar) OnSetStyle(h wm.OnSetStyleHandler, finalize func())
OnSetStyle sets a handler invoked on SetStyle. When the event handler is removed, finalize is called, if not nil.
func (*Scrollbar) Paint ¶
func (s *Scrollbar) Paint(ctx wm.PaintContext)
Paint ask the scrollbar to render itself. It is intended to be only called from a "hook" paint handler that determines where the scrollbar appears.
func (*Scrollbar) RemoveOnClickDecrement ¶
func (s *Scrollbar) RemoveOnClickDecrement()
RemoveOnClickDecrement undoes the most recent OnClickDecrement call. The function will panic if there is no handler set.
func (*Scrollbar) RemoveOnClickDecrementPage ¶
func (s *Scrollbar) RemoveOnClickDecrementPage()
RemoveOnClickDecrementPage undoes the most recent OnClickDecrement call. The function will panic if there is no handler set.
func (*Scrollbar) RemoveOnClickIncrement ¶
func (s *Scrollbar) RemoveOnClickIncrement()
RemoveOnClickIncrement undoes the most recent OnClickIncrement call. The function will panic if there is no handler set.
func (*Scrollbar) RemoveOnClickIncrementPage ¶
func (s *Scrollbar) RemoveOnClickIncrementPage()
RemoveOnClickIncrementPage undoes the most recent OnClickIncrementPage call. The function will panic if there is no handler set.
func (*Scrollbar) RemoveOnPaint ¶
func (s *Scrollbar) RemoveOnPaint()
RemoveOnPaint undoes the most recent OnPaint call. The function will panic if there is no handler set.
func (*Scrollbar) RemoveOnSetHandlePosition ¶
func (s *Scrollbar) RemoveOnSetHandlePosition()
RemoveOnSetHandlePosition undoes the most recent OnSetHandlePosition call. The function will panic if there is no handler set.
func (*Scrollbar) RemoveOnSetHandleSize ¶
func (s *Scrollbar) RemoveOnSetHandleSize()
RemoveOnSetHandleSize undoes the most recent OnSetHandleSize call. The function will panic if there is no handler set.
func (*Scrollbar) RemoveOnSetPosition ¶
func (s *Scrollbar) RemoveOnSetPosition()
RemoveOnSetPosition undoes the most recent OnSetPosition call. The function will panic if there is no handler set.
func (*Scrollbar) RemoveOnSetSize ¶
func (s *Scrollbar) RemoveOnSetSize()
RemoveOnSetSize undoes the most recent OnSetSize call. The function will panic if there is no handler set.
func (*Scrollbar) RemoveOnSetStyle ¶
func (s *Scrollbar) RemoveOnSetStyle()
RemoveOnSetStyle undoes the most recent OnSetStyle call. The function will panic if there is no handler set.
func (*Scrollbar) SetHandlePosition ¶
SetHandlePosition sets the scrollbar handle position.
func (*Scrollbar) SetHandleSize ¶
SetHandleSize sets the scrollbar handle size.
func (*Scrollbar) SetPosition ¶
SetPosition sets the scrollbar position.
type View ¶
View displays content possibly overflowing the size of its client area.
View methods must be called only directly from an event handler goroutine or from a function that was enqueued using wm.Application.Post or wm.Application.PostWait.
func NewView ¶
NewView configures w to show scrollbars when content, measured using the meter parameter, overflows the client area of w and returns the resulting View. The user can use the scrollbars to control the View's Origin.
NewView must be called only directly from an event handler goroutine or from a function that was enqueued using wm.Application.Post or wm.Application.PostWait.
func (*View) HorizontalScrollbarEnabled ¶
HorizontalScrollbarEnabled reports whether the horizontal scrollbar is enabled.
func (*View) OnSetHorizontalScrollbarEnabled ¶
func (v *View) OnSetHorizontalScrollbarEnabled(h wm.OnSetBoolHandler, finalize func())
OnSetHorizontalScrollbarEnabled sets a handler invoked on SetHorizontalScrollbarEnabled. When the event handler is removed, finalize is called, if not nil.
func (*View) OnSetVerticalScrollbarEnabled ¶
func (v *View) OnSetVerticalScrollbarEnabled(h wm.OnSetBoolHandler, finalize func())
OnSetVerticalScrollbarEnabled sets a handler invoked on SetVerticalScrollbarEnabled. When the event handler is removed, finalize is called, if not nil.
func (*View) PageDown ¶
func (v *View) PageDown()
PageDown makes the view show the next page of content.
func (*View) PageUp ¶
func (v *View) PageUp()
PageUp makes the view show the previous page of content.
func (*View) RemoveOnSetHorizontalScrollbarEnabled ¶
func (v *View) RemoveOnSetHorizontalScrollbarEnabled()
RemoveOnSetHorizontalScrollbarEnabled undoes the most recent OnSetHorizontalScrollbarEnabled call. The function will panic if there is no handler set.
func (*View) RemoveOnSetVerticalScrollbarEnabled ¶
func (v *View) RemoveOnSetVerticalScrollbarEnabled()
RemoveOnSetVerticalScrollbarEnabled undoes the most recent OnSetVerticalScrollbarEnabled call. The function will panic if there is no handler set.
func (*View) SetHorizontalScrollbarEnabled ¶
SetHorizontalScrollbarEnabled sets whether the horizontal scrollbar is enabled.
func (*View) SetVerticalScrollbarEnabled ¶
SetVerticalScrollbarEnabled sets whether the vertical scrollbar is enabled.
func (*View) VerticalScrollbarEnabled ¶
VerticalScrollbarEnabled reports whether the vertical scrollbar is enabled.