Documentation ¶
Overview ¶
Package dialog provides a modal dialog widget with support for ok/cancel.
Index ¶
- Variables
- func Close(w IWidget, app gowid.IApp)
- func Open(w IOpenExt, container gowid.ISettableComposite, width gowid.IWidgetDimension, ...)
- func OpenExt(w IOpenExt, container gowid.ISettableComposite, width gowid.IWidgetDimension, ...)
- func UserInput(w IWidget, ev interface{}, size gowid.IRenderSize, focus gowid.Selector, ...) bool
- type Button
- type IMaximizer
- type IModal
- type IOpenExt
- type ISwitchFocus
- type IWidget
- type Maximizer
- type OpenCloseCB
- type Options
- type SavedContainer
- type SavedSubWidget
- type SolidFunction
- type Widget
- func (w *Widget) Close(app gowid.IApp)
- func (w *Widget) EscapeCloses() bool
- func (w *Widget) FocusOnButtons(app gowid.IApp)
- func (w *Widget) FocusOnContent(app gowid.IApp)
- func (w *Widget) GetNoFunction() gowid.IWidgetChangedCallback
- func (w *Widget) Height() gowid.IWidgetDimension
- func (w *Widget) IsMaxed() bool
- func (w *Widget) IsModal() bool
- func (w *Widget) IsOpen() bool
- func (w *Widget) IsSwitchFocus() bool
- func (w *Widget) Maximize(app gowid.IApp)
- func (w *Widget) OnOpenClose(f gowid.IWidgetChangedCallback)
- func (w *Widget) Open(container gowid.ISettableComposite, width gowid.IWidgetDimension, ...)
- func (w *Widget) OpenGlobally(width gowid.IWidgetDimension, app gowid.IApp)
- func (w *Widget) RemoveOnOpenClose(f gowid.IIdentity)
- func (w *Widget) SavedContainer() gowid.ISettableComposite
- func (w *Widget) SavedSubWidget() gowid.IWidget
- func (w *Widget) SetContentWidth(d gowid.IWidgetDimension, app gowid.IApp)
- func (w *Widget) SetHeight(d gowid.IWidgetDimension, app gowid.IApp)
- func (w *Widget) SetOpen(open bool, app gowid.IApp)
- func (w *Widget) SetSavedContainer(c gowid.ISettableComposite, app gowid.IApp)
- func (w *Widget) SetSavedSubWidget(w2 gowid.IWidget, app gowid.IApp)
- func (w *Widget) SetSubWidget(inner gowid.IWidget, app gowid.IApp)
- func (w *Widget) SetWidth(d gowid.IWidgetDimension, app gowid.IApp)
- func (w *Widget) String() string
- func (w *Widget) SubWidget() gowid.IWidget
- func (w *Widget) SwitchFocus(app gowid.IApp)
- func (w *Widget) Unmaximize(app gowid.IApp)
- func (w *Widget) UserInput(ev interface{}, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) bool
- func (w *Widget) Width() gowid.IWidgetDimension
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultBackground = gowid.NewUrwidColor("white") DefaultButton = gowid.NewUrwidColor("dark blue") DefaultButtonText = gowid.NewUrwidColor("yellow") DefaultText = gowid.NewUrwidColor("black") )
View Source
var OkCancel, ExitCancel, CloseOnly, NoButtons []Button
Functions ¶
func Open ¶
func Open(w IOpenExt, container gowid.ISettableComposite, width gowid.IWidgetDimension, app gowid.IApp)
func OpenExt ¶
func OpenExt(w IOpenExt, container gowid.ISettableComposite, width gowid.IWidgetDimension, height gowid.IWidgetDimension, app gowid.IApp)
Types ¶
type Button ¶
type Button struct { Msg string Action gowid.IWidgetChangedCallback }
var Quit, Exit, CloseD, Cancel Button
type IMaximizer ¶ added in v1.2.0
type ISwitchFocus ¶ added in v1.3.0
type IWidget ¶
type IWidget interface { gowid.IWidget gowid.ISettableComposite // Not ICompositeWidget - no SubWidgetSize GetNoFunction() gowid.IWidgetChangedCallback EscapeCloses() bool IsOpen() bool SetOpen(open bool, app gowid.IApp) SavedSubWidget() gowid.IWidget SetSavedSubWidget(w gowid.IWidget, app gowid.IApp) SavedContainer() gowid.ISettableComposite SetSavedContainer(c gowid.ISettableComposite, app gowid.IApp) Width() gowid.IWidgetDimension SetWidth(gowid.IWidgetDimension, gowid.IApp) Height() gowid.IWidgetDimension SetHeight(gowid.IWidgetDimension, gowid.IApp) }
type Maximizer ¶
type Maximizer struct { Maxed bool Width gowid.IWidgetDimension Height gowid.IWidgetDimension }
type Options ¶
type Options struct { Buttons []Button NoShadow bool NoEscapeClose bool ButtonStyle gowid.ICellStyler BackgroundStyle gowid.ICellStyler BorderStyle gowid.ICellStyler FocusOnWidget bool NoFrame bool Modal bool TabToButtons bool StartIdx int }
type SavedContainer ¶
type SavedContainer struct{}
type SavedSubWidget ¶
type SavedSubWidget struct{}
type SolidFunction ¶
type Widget ¶
type Widget struct { gowid.IWidget Options Options NoFunction gowid.IWidgetChangedCallback Callbacks *gowid.Callbacks // contains filtered or unexported fields }
Widget - represents a modal dialog. The bottom widget is rendered without the focus at full size. The bottom widget is rendered between a horizontal and vertical padding widget set up with the sizes provided.
func (*Widget) EscapeCloses ¶
func (*Widget) FocusOnButtons ¶ added in v1.3.0
func (*Widget) FocusOnContent ¶ added in v1.3.0
func (*Widget) GetNoFunction ¶
func (w *Widget) GetNoFunction() gowid.IWidgetChangedCallback
func (*Widget) Height ¶
func (w *Widget) Height() gowid.IWidgetDimension
func (*Widget) IsSwitchFocus ¶ added in v1.3.0
func (*Widget) OnOpenClose ¶
func (w *Widget) OnOpenClose(f gowid.IWidgetChangedCallback)
func (*Widget) Open ¶
func (w *Widget) Open(container gowid.ISettableComposite, width gowid.IWidgetDimension, app gowid.IApp)
func (*Widget) OpenGlobally ¶
func (w *Widget) OpenGlobally(width gowid.IWidgetDimension, app gowid.IApp)
Open the dialog at the top-level of the widget hierarchy which is the App - it itself is an IComposite
func (*Widget) RemoveOnOpenClose ¶
func (*Widget) SavedContainer ¶
func (w *Widget) SavedContainer() gowid.ISettableComposite
func (*Widget) SavedSubWidget ¶
func (*Widget) SetContentWidth ¶
func (w *Widget) SetContentWidth(d gowid.IWidgetDimension, app gowid.IApp)
func (*Widget) SetSavedContainer ¶
func (w *Widget) SetSavedContainer(c gowid.ISettableComposite, app gowid.IApp)
func (*Widget) SetSavedSubWidget ¶
func (*Widget) SwitchFocus ¶ added in v1.3.0
func (*Widget) Unmaximize ¶ added in v1.2.0
func (*Widget) Width ¶
func (w *Widget) Width() gowid.IWidgetDimension
Click to show internal directories.
Click to hide internal directories.