Box*cview.BoxPrimitivecview.Primitive GetBackgroundColor returns the box's background color. GetBorder returns a value indicating whether the box have a border
or not. GetBorderPadding returns the size of the padding around the box content.
Deprecated: This function is provided for backwards compatibility.
Developers should use GetPadding instead. GetDrawFunc returns the callback function which was installed with
SetDrawFunc() or nil if no such function has been installed. GetInnerRect returns the position of the inner rectangle (x, y, width,
height), without the border and without any padding. Width and height values
will clamp to 0 and thus never be negative. GetInputCapture returns the function installed with SetInputCapture() or nil
if no such function has been installed. GetMouseCapture returns the function installed with SetMouseCapture() or nil
if no such function has been installed. GetPadding returns the size of the padding around the box content. GetTitle returns the box's current title. HasFocus returns whether or not this primitive has focus. InRect returns true if the given coordinate is within the bounds of the box's
rectangle. SetBackgroundColor sets the box's background color. SetBackgroundTransparent sets the flag indicating whether or not the box's
background is transparent. The screen is not cleared before drawing the
application. Overlaying transparent widgets directly onto the screen may
result in artifacts. To resolve this, add a blank, non-transparent Box to
the bottom layer of the interface via Panels, or set a handler via
SetBeforeDrawFunc which clears the screen. SetBorder sets the flag indicating whether or not the box should have a
border. SetBorderAttributes sets the border's style attributes. You can combine
different attributes using bitmask operations:
box.SetBorderAttributes(tcell.AttrUnderline | tcell.AttrBold) SetBorderColor sets the box's border color. SetBorderColorFocused sets the box's border color when the box is focused. SetBorderPadding sets the size of the padding around the box content.
Deprecated: This function is provided for backwards compatibility.
Developers should use SetPadding instead. SetDrawFunc sets a callback function which is invoked after the box primitive
has been drawn. This allows you to add a more individual style to the box
(and all primitives which extend it).
The function is provided with the box's dimensions (set via SetRect()). It
must return the box's inner dimensions (x, y, width, height) which will be
returned by GetInnerRect(), used by descendent primitives to draw their own
content. SetInputCapture installs a function which captures key events before they are
forwarded to the primitive's default key event handler. This function can
then choose to forward that key event (or a different one) to the default
handler by returning it. If nil is returned, the default handler will not
be called.
Providing a nil handler will remove a previously existing handler.
Note that this function will not have an effect on primitives composed of
other primitives, such as Form, Flex, or Grid. Key events are only captured
by the primitives that have focus (e.g. InputField) and only one primitive
can have focus at a time. Composing primitives such as Form pass the focus on
to their contained primitives and thus never receive any key events
themselves. Therefore, they cannot intercept key events. SetMouseCapture sets a function which captures mouse events (consisting of
the original tcell mouse event and the semantic mouse action) before they are
forwarded to the primitive's default mouse event handler. This function can
then choose to forward that event (or a different one) by returning it or
returning a nil mouse event, in which case the default handler will not be
called.
Providing a nil handler will remove a previously existing handler. SetPadding sets the size of the padding around the box content. SetTitle sets the box's title. SetTitleAlign sets the alignment of the title, one of AlignLeft, AlignCenter,
or AlignRight. SetTitleColor sets the box's title color. ShowFocus sets the flag indicating whether or not the borders of this
primitive should change thickness when focused. WrapInputHandler wraps an input handler (see InputHandler()) with the
functionality to capture input (see SetInputCapture()) before passing it
on to the provided (default) input handler.
This is only meant to be used by subclassing primitives. WrapMouseHandler wraps a mouse event handler (see MouseHandler()) with the
functionality to capture mouse events (see SetMouseCapture()) before passing
them on to the provided (default) event handler.
This is only meant to be used by subclassing primitives.
Focusable : github.com/pancsta/cview.Focusable
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.