Documentation ¶
Overview ¶
Package giu - A rapid cross-platform GUI framework for Go based on Dear ImGui and the great Go binding imgui-go.
for details and usage see README of the project.
Index ¶
- Constants
- Variables
- func AlignTextToFramePadding()
- func Assert(cond bool, t, method, msg string, args ...any)
- func CalcTextSize(text string) (width, height float32)
- func CalcTextSizeV(text string, hideAfterDoubleHash bool, wrapWidth float32) (w, h float32)
- func CloseCurrentPopup()
- func EnqueueNewTextureFromRgba(rgba image.Image, loadCb func(t *Texture))
- func GenAutoID(id string) string
- func GetAvailableRegion() (width, height float32)
- func GetCursorPos() image.Point
- func GetCursorScreenPos() image.Point
- func GetFramePadding() (x, y float32)
- func GetItemInnerSpacing() (w, h float32)
- func GetItemSpacing() (w, h float32)
- func GetMousePos() image.Point
- func GetWidgetWidth(w Widget) (result float32)
- func GetWindowPadding() (x, y float32)
- func ImageToRgba(img image.Image) *image.RGBA
- func IsItemActive() bool
- func IsItemClicked(mouseButton MouseButton) bool
- func IsItemHovered() bool
- func IsKeyDown(key Key) bool
- func IsKeyPressed(key Key) bool
- func IsKeyReleased(key Key) bool
- func IsMouseClicked(button MouseButton) bool
- func IsMouseDoubleClicked(button MouseButton) bool
- func IsMouseDown(button MouseButton) bool
- func IsMouseReleased(button MouseButton) bool
- func IsWindowAppearing() bool
- func IsWindowCollapsed() bool
- func IsWindowFocused(flags FocusedFlags) bool
- func IsWindowHovered(flags HoveredFlags) bool
- func LoadImage(imgPath string) (*image.RGBA, error)
- func NewTextureFromRgba(rgba image.Image, loadCallback func(*Texture))
- func OpenPopup(name string)
- func OpenURL(url string)
- func PopClipRect()
- func PopFont()
- func PopItemWidth()
- func PopStyle()
- func PopStyleColor()
- func PopStyleColorV(count int)
- func PopStyleV(count int)
- func PopTextWrapPos()
- func PushButtonTextAlign(width, height float32)
- func PushClipRect(clipRectMin, clipRectMax image.Point, intersectWithClipRect bool)
- func PushColorButton(col color.Color)
- func PushColorButtonActive(col color.Color)
- func PushColorButtonHovered(col color.Color)
- func PushColorFrameBg(col color.Color)
- func PushColorText(col color.Color)
- func PushColorTextDisabled(col color.Color)
- func PushColorWindowBg(col color.Color)
- func PushFont(font *FontInfo) bool
- func PushFramePadding(width, height float32)
- func PushItemSpacing(width, height float32)
- func PushItemWidth(width float32)
- func PushSelectableTextAlign(width, height float32)
- func PushStyleColor(id StyleColorID, col color.Color)
- func PushTextWrapPos()
- func PushWindowPadding(width, height float32)
- func RegisterString(str string) string
- func RegisterStringPointer(str *string) *string
- func RegisterStringSlice(str []string) []string
- func SameLine()
- func SetCursorPos(pos image.Point)
- func SetCursorScreenPos(pos image.Point)
- func SetDefaultFont(fontName string, size float32)
- func SetDefaultFontFromBytes(fontBytes []byte, size float32)
- func SetDefaultFontSize(size float32)
- func SetItemDefaultFocus()
- func SetKeyboardFocusHere()
- func SetKeyboardFocusHereV(i int)
- func SetMouseCursor(cursor MouseCursorType)
- func SetNextWindowPos(x, y float32)
- func SetNextWindowSize(width, height float32)
- func SetNextWindowSizeV(width, height float32, condition ExecCondition)
- func ToVec2(pt image.Point) imgui.Vec2
- func ToVec4Color(col color.Color) imgui.Vec4
- func Update()
- func Vec4ToRGBA(vec4 imgui.Vec4) color.RGBA
- type Action
- type AlignmentSetter
- type AlignmentType
- type ArrowButtonWidget
- type BulletTextWidget
- type BulletWidget
- type ButtonWidget
- type Canvas
- func (c *Canvas) AddBezierCubic(pos0, cp0, cp1, pos1 image.Point, col color.Color, thickness float32, ...)
- func (c *Canvas) AddCircle(center image.Point, radius float32, col color.Color, segments int, ...)
- func (c *Canvas) AddCircleFilled(center image.Point, radius float32, col color.Color)
- func (c *Canvas) AddImage(texture *Texture, pMin, pMax image.Point)
- func (c *Canvas) AddImageV(texture *Texture, pMin, pMax, uvMin, uvMax image.Point, col color.Color)
- func (c *Canvas) AddLine(p1, p2 image.Point, col color.Color, thickness float32)
- func (c *Canvas) AddQuad(p1, p2, p3, p4 image.Point, col color.Color, thickness float32)
- func (c *Canvas) AddQuadFilled(p1, p2, p3, p4 image.Point, col color.Color)
- func (c *Canvas) AddRect(pMin, pMax image.Point, col color.Color, rounding float32, ...)
- func (c *Canvas) AddRectFilled(pMin, pMax image.Point, col color.Color, rounding float32, ...)
- func (c *Canvas) AddText(pos image.Point, col color.Color, text string)
- func (c *Canvas) AddTriangle(p1, p2, p3 image.Point, col color.Color, thickness float32)
- func (c *Canvas) AddTriangleFilled(p1, p2, p3 image.Point, col color.Color)
- func (c *Canvas) PathArcTo(center image.Point, radius, min, max float32, numSegments int)
- func (c *Canvas) PathArcToFast(center image.Point, radius float32, min12, max12 int)
- func (c *Canvas) PathBezierCubicCurveTo(p1, p2, p3 image.Point, numSegments int)
- func (c *Canvas) PathClear()
- func (c *Canvas) PathFillConvex(col color.Color)
- func (c *Canvas) PathLineTo(pos image.Point)
- func (c *Canvas) PathLineToMergeDuplicate(pos image.Point)
- func (c *Canvas) PathStroke(col color.Color, closed bool, thickness float32)
- type CheckboxWidget
- type ChildWidget
- func (c *ChildWidget) Border(border bool) *ChildWidget
- func (c *ChildWidget) Build()
- func (c *ChildWidget) Flags(flags WindowFlags) *ChildWidget
- func (c *ChildWidget) ID(id string) *ChildWidget
- func (c *ChildWidget) Layout(widgets ...Widget) *ChildWidget
- func (c *ChildWidget) Size(width, height float32) *ChildWidget
- type CodeEditorWidget
- func (ce *CodeEditorWidget) Border(border bool) *CodeEditorWidget
- func (ce *CodeEditorWidget) Build()
- func (ce *CodeEditorWidget) Copy()
- func (ce *CodeEditorWidget) Cut()
- func (ce *CodeEditorWidget) Delete()
- func (ce *CodeEditorWidget) ErrorMarkers(markers imgui.ErrorMarkers) *CodeEditorWidget
- func (ce *CodeEditorWidget) GetCurrentLineText() string
- func (ce *CodeEditorWidget) GetCursorPos() (x, y int)
- func (ce *CodeEditorWidget) GetScreenCursorPos() (x, y int)
- func (ce *CodeEditorWidget) GetSelectedText() string
- func (ce *CodeEditorWidget) GetSelectionStart() (x, y int)
- func (ce *CodeEditorWidget) GetText() string
- func (ce *CodeEditorWidget) GetWordUnderCursor() string
- func (ce *CodeEditorWidget) HandleKeyboardInputs(b bool) *CodeEditorWidget
- func (ce *CodeEditorWidget) HasSelection() bool
- func (ce *CodeEditorWidget) ID(id string) *CodeEditorWidget
- func (ce *CodeEditorWidget) InsertText(text string)
- func (ce *CodeEditorWidget) IsTextChanged() bool
- func (ce *CodeEditorWidget) LanguageDefinition(definition LanguageDefinition) *CodeEditorWidget
- func (ce *CodeEditorWidget) Paste()
- func (ce *CodeEditorWidget) SelectWordUnderCursor()
- func (ce *CodeEditorWidget) ShowWhitespaces(s bool) *CodeEditorWidget
- func (ce *CodeEditorWidget) Size(w, h float32) *CodeEditorWidget
- func (ce *CodeEditorWidget) TabSize(size int) *CodeEditorWidget
- func (ce *CodeEditorWidget) Text(str string) *CodeEditorWidget
- type ColorEditFlags
- type ColorEditWidget
- type ColumnWidget
- type ComboCustomWidget
- type ComboFlags
- type ComboWidget
- type ConditionWidget
- type ContextMenuWidget
- type CustomWidget
- type DatePickerWidget
- func (d *DatePickerWidget) Build()
- func (d *DatePickerWidget) Format(format string) *DatePickerWidget
- func (d *DatePickerWidget) OnChange(onChange func()) *DatePickerWidget
- func (d *DatePickerWidget) Size(width float32) *DatePickerWidget
- func (d *DatePickerWidget) StartOfWeek(weekday time.Weekday) *DatePickerWidget
- type DialogResult
- type DialogResultCallback
- type Direction
- type Disposable
- type DragIntWidget
- type DrawFlags
- type DummyWidget
- type EventHandler
- func (eh *EventHandler) Build()
- func (eh *EventHandler) OnActivate(cb func()) *EventHandler
- func (eh *EventHandler) OnActive(cb func()) *EventHandler
- func (eh *EventHandler) OnClick(mouseButton MouseButton, callback func()) *EventHandler
- func (eh *EventHandler) OnDClick(mouseButton MouseButton, callback func()) *EventHandler
- func (eh *EventHandler) OnDeactivate(cb func()) *EventHandler
- func (eh *EventHandler) OnHover(onHover func()) *EventHandler
- func (eh *EventHandler) OnKeyDown(key Key, cb func()) *EventHandler
- func (eh *EventHandler) OnKeyPressed(key Key, cb func()) *EventHandler
- func (eh *EventHandler) OnKeyReleased(key Key, cb func()) *EventHandler
- func (eh *EventHandler) OnMouseDown(mouseButton MouseButton, callback func()) *EventHandler
- func (eh *EventHandler) OnMouseReleased(mouseButton MouseButton, callback func()) *EventHandler
- type ExecCondition
- type FocusedFlags
- type FontInfo
- type HSplitterWidget
- type HoveredFlags
- type ImPlotYAxis
- type ImageButtonWidget
- func (b *ImageButtonWidget) BgColor(bgColor color.Color) *ImageButtonWidget
- func (b *ImageButtonWidget) Build()
- func (b *ImageButtonWidget) FramePadding(padding int) *ImageButtonWidget
- func (b *ImageButtonWidget) OnClick(onClick func()) *ImageButtonWidget
- func (b *ImageButtonWidget) Size(width, height float32) *ImageButtonWidget
- func (b *ImageButtonWidget) TintColor(tintColor color.Color) *ImageButtonWidget
- func (b *ImageButtonWidget) UV(uv0, uv1 image.Point) *ImageButtonWidget
- type ImageButtonWithRgbaWidget
- func (b *ImageButtonWithRgbaWidget) BgColor(bgColor color.Color) *ImageButtonWithRgbaWidget
- func (b *ImageButtonWithRgbaWidget) Build()
- func (b *ImageButtonWithRgbaWidget) FramePadding(padding int) *ImageButtonWithRgbaWidget
- func (b *ImageButtonWithRgbaWidget) OnClick(onClick func()) *ImageButtonWithRgbaWidget
- func (b *ImageButtonWithRgbaWidget) Size(width, height float32) *ImageButtonWithRgbaWidget
- func (b *ImageButtonWithRgbaWidget) TintColor(tintColor color.Color) *ImageButtonWithRgbaWidget
- func (b *ImageButtonWithRgbaWidget) UV(uv0, uv1 image.Point) *ImageButtonWithRgbaWidget
- type ImageWidget
- func (i *ImageWidget) BorderCol(borderColor color.Color) *ImageWidget
- func (i *ImageWidget) Build()
- func (i *ImageWidget) OnClick(cb func()) *ImageWidget
- func (i *ImageWidget) Size(width, height float32) *ImageWidget
- func (i *ImageWidget) TintColor(tintColor color.Color) *ImageWidget
- func (i *ImageWidget) Uv(uv0, uv1 image.Point) *ImageWidget
- type ImageWithFileWidget
- type ImageWithRgbaWidget
- type ImageWithURLWidget
- func (i *ImageWithURLWidget) Build()
- func (i *ImageWithURLWidget) LayoutForFailure(widgets ...Widget) *ImageWithURLWidget
- func (i *ImageWithURLWidget) LayoutForLoading(widgets ...Widget) *ImageWithURLWidget
- func (i *ImageWithURLWidget) OnClick(cb func()) *ImageWithURLWidget
- func (i *ImageWithURLWidget) OnFailure(onFailure func(error)) *ImageWithURLWidget
- func (i *ImageWithURLWidget) OnReady(onReady func()) *ImageWithURLWidget
- func (i *ImageWithURLWidget) Size(width, height float32) *ImageWithURLWidget
- func (i *ImageWithURLWidget) Timeout(downloadTimeout time.Duration) *ImageWithURLWidget
- type InputFloatWidget
- func (i *InputFloatWidget) Build()
- func (i *InputFloatWidget) Flags(flags InputTextFlags) *InputFloatWidget
- func (i *InputFloatWidget) Format(format string) *InputFloatWidget
- func (i *InputFloatWidget) Label(label string) *InputFloatWidget
- func (i *InputFloatWidget) Labelf(format string, args ...any) *InputFloatWidget
- func (i *InputFloatWidget) OnChange(onChange func()) *InputFloatWidget
- func (i *InputFloatWidget) Size(width float32) *InputFloatWidget
- type InputHandler
- type InputHandlerHandleCallback
- type InputIntWidget
- func (i *InputIntWidget) Build()
- func (i *InputIntWidget) Flags(flags InputTextFlags) *InputIntWidget
- func (i *InputIntWidget) Label(label string) *InputIntWidget
- func (i *InputIntWidget) Labelf(format string, args ...any) *InputIntWidget
- func (i *InputIntWidget) OnChange(onChange func()) *InputIntWidget
- func (i *InputIntWidget) Size(width float32) *InputIntWidget
- type InputTextFlags
- type InputTextMultilineWidget
- func (i *InputTextMultilineWidget) Build()
- func (i *InputTextMultilineWidget) Callback(cb imgui.InputTextCallback) *InputTextMultilineWidget
- func (i *InputTextMultilineWidget) Flags(flags InputTextFlags) *InputTextMultilineWidget
- func (i *InputTextMultilineWidget) Label(label string) *InputTextMultilineWidget
- func (i *InputTextMultilineWidget) Labelf(format string, args ...any) *InputTextMultilineWidget
- func (i *InputTextMultilineWidget) OnChange(onChange func()) *InputTextMultilineWidget
- func (i *InputTextMultilineWidget) Size(width, height float32) *InputTextMultilineWidget
- type InputTextWidget
- func (i *InputTextWidget) AutoComplete(candidates []string) *InputTextWidget
- func (i *InputTextWidget) Build()
- func (i *InputTextWidget) Callback(cb imgui.InputTextCallback) *InputTextWidget
- func (i *InputTextWidget) Flags(flags InputTextFlags) *InputTextWidget
- func (i *InputTextWidget) Hint(hint string) *InputTextWidget
- func (i *InputTextWidget) Label(label string) *InputTextWidget
- func (i *InputTextWidget) Labelf(format string, args ...any) *InputTextWidget
- func (i *InputTextWidget) OnChange(onChange func()) *InputTextWidget
- func (i *InputTextWidget) Size(width float32) *InputTextWidget
- type InvisibleButtonWidget
- type Key
- type LabelWidget
- type LanguageDefinition
- type Layout
- type ListBoxState
- type ListBoxWidget
- func (l *ListBoxWidget) Border(b bool) *ListBoxWidget
- func (l *ListBoxWidget) Build()
- func (l *ListBoxWidget) ContextMenu(menuItems []string) *ListBoxWidget
- func (l *ListBoxWidget) OnChange(onChange func(selectedIndex int)) *ListBoxWidget
- func (l *ListBoxWidget) OnDClick(onDClick func(selectedIndex int)) *ListBoxWidget
- func (l *ListBoxWidget) OnMenu(onMenu func(selectedIndex int, menu string)) *ListBoxWidget
- func (l *ListBoxWidget) Size(width, height float32) *ListBoxWidget
- type ListClipperWrapper
- type MainMenuBarWidget
- type MarkdownWidget
- type MasterWindow
- func (w *MasterWindow) Close()
- func (w *MasterWindow) GetPos() (x, y int)
- func (w *MasterWindow) GetSize() (width, height int)
- func (w *MasterWindow) RegisterKeyboardShortcuts(s ...WindowShortcut) *MasterWindow
- func (w *MasterWindow) Run(loopFunc func())
- func (w *MasterWindow) SetAdditionalInputHandlerCallback(cb InputHandlerHandleCallback)
- func (w *MasterWindow) SetBgColor(bgColor color.Color)
- func (w *MasterWindow) SetCloseCallback(cb func() bool)
- func (w *MasterWindow) SetDropCallback(cb func([]string))
- func (w *MasterWindow) SetIcon(icons []image.Image)
- func (w *MasterWindow) SetInputHandler(handler InputHandler)
- func (w *MasterWindow) SetPos(x, y int)
- func (w *MasterWindow) SetShouldClose(v bool)
- func (w *MasterWindow) SetSize(x, y int)
- func (w *MasterWindow) SetSizeLimits(minw, minh, maxw, maxh int)
- func (w *MasterWindow) SetTitle(title string)
- type MasterWindowFlags
- type MemoryEditorWidget
- type MenuBarWidget
- type MenuItemWidget
- type MenuWidget
- type Modifier
- type MouseButton
- type MouseCursorType
- type MsgboxButtons
- type MsgboxWidget
- type PlotAxisFlags
- type PlotBarHWidget
- type PlotBarWidget
- type PlotCanvasWidget
- func (p *PlotCanvasWidget) AxisLimits(xmin, xmax, ymin, ymax float64, cond ExecCondition) *PlotCanvasWidget
- func (p *PlotCanvasWidget) Build()
- func (p *PlotCanvasWidget) Flags(flags PlotFlags) *PlotCanvasWidget
- func (p *PlotCanvasWidget) Plots(plots ...PlotWidget) *PlotCanvasWidget
- func (p *PlotCanvasWidget) Size(width, height int) *PlotCanvasWidget
- func (p *PlotCanvasWidget) XAxeFlags(flags PlotAxisFlags) *PlotCanvasWidget
- func (p *PlotCanvasWidget) XTicks(ticks []PlotTicker, showDefault bool) *PlotCanvasWidget
- func (p *PlotCanvasWidget) YAxeFlags(yFlags, y2Flags, y3Flags PlotAxisFlags) *PlotCanvasWidget
- func (p *PlotCanvasWidget) YTicks(ticks []PlotTicker, showDefault bool, yAxis ImPlotYAxis) *PlotCanvasWidget
- type PlotFlags
- type PlotLineWidget
- type PlotLineXYWidget
- type PlotPieChartWidget
- type PlotScatterWidget
- type PlotScatterXYWidget
- type PlotTicker
- type PlotWidget
- type PopupModalWidget
- type PopupWidget
- type ProgressBarWidget
- type ProgressIndicatorWidget
- type RadioButtonWidget
- type RowWidget
- type SelectableFlags
- type SelectableWidget
- func (s *SelectableWidget) Build()
- func (s *SelectableWidget) Flags(flags SelectableFlags) *SelectableWidget
- func (s *SelectableWidget) OnClick(onClick func()) *SelectableWidget
- func (s *SelectableWidget) OnDClick(onDClick func()) *SelectableWidget
- func (s *SelectableWidget) Selected(selected bool) *SelectableWidget
- func (s *SelectableWidget) Size(width, height float32) *SelectableWidget
- type SeparatorWidget
- type Shortcut
- type ShortcutType
- type SliderFlags
- type SliderFloatWidget
- func (sf *SliderFloatWidget) Build()
- func (sf *SliderFloatWidget) Format(format string) *SliderFloatWidget
- func (sf *SliderFloatWidget) Label(label string) *SliderFloatWidget
- func (sf *SliderFloatWidget) Labelf(format string, args ...any) *SliderFloatWidget
- func (sf *SliderFloatWidget) OnChange(onChange func()) *SliderFloatWidget
- func (sf *SliderFloatWidget) Size(width float32) *SliderFloatWidget
- type SliderIntWidget
- func (s *SliderIntWidget) Build()
- func (s *SliderIntWidget) Format(format string) *SliderIntWidget
- func (s *SliderIntWidget) Label(label string) *SliderIntWidget
- func (s *SliderIntWidget) Labelf(format string, args ...any) *SliderIntWidget
- func (s *SliderIntWidget) OnChange(onChange func()) *SliderIntWidget
- func (s *SliderIntWidget) Size(width float32) *SliderIntWidget
- type SmallButtonWidget
- type SpacingWidget
- type SplitDirection
- type SplitLayoutWidget
- type Splitable
- type StackWidget
- type StyleColorID
- type StyleSetter
- func (ss *StyleSetter) Build()
- func (ss *StyleSetter) SetColor(colorID StyleColorID, col color.Color) *StyleSetter
- func (ss *StyleSetter) SetDisabled(d bool) *StyleSetter
- func (ss *StyleSetter) SetFont(font *FontInfo) *StyleSetter
- func (ss *StyleSetter) SetFontSize(size float32) *StyleSetter
- func (ss *StyleSetter) SetStyle(varID StyleVarID, width, height float32) *StyleSetter
- func (ss *StyleSetter) SetStyleFloat(varID StyleVarID, value float32) *StyleSetter
- func (ss *StyleSetter) To(widgets ...Widget) *StyleSetter
- type StyleVarID
- type TabBarFlags
- type TabBarWidget
- type TabItemFlags
- type TabItemWidget
- type TableColumnFlags
- type TableColumnWidget
- type TableFlags
- type TableRowFlags
- type TableRowWidget
- type TableWidget
- func (t *TableWidget) Build()
- func (t *TableWidget) Columns(cols ...*TableColumnWidget) *TableWidget
- func (t *TableWidget) FastMode(b bool) *TableWidget
- func (t *TableWidget) Flags(flags TableFlags) *TableWidget
- func (t *TableWidget) Freeze(col, row int) *TableWidget
- func (t *TableWidget) ID(id string) *TableWidget
- func (t *TableWidget) InnerWidth(width float64) *TableWidget
- func (t *TableWidget) Rows(rows ...*TableRowWidget) *TableWidget
- func (t *TableWidget) Size(width, height float32) *TableWidget
- type Texture
- type TooltipWidget
- type TreeNodeFlags
- type TreeNodeWidget
- type TreeTableRowWidget
- type TreeTableWidget
- func (tt *TreeTableWidget) Build()
- func (tt *TreeTableWidget) Columns(cols ...*TableColumnWidget) *TreeTableWidget
- func (tt *TreeTableWidget) Flags(flags TableFlags) *TreeTableWidget
- func (tt *TreeTableWidget) Freeze(col, row int) *TreeTableWidget
- func (tt *TreeTableWidget) Rows(rows ...*TreeTableRowWidget) *TreeTableWidget
- func (tt *TreeTableWidget) Size(width, height float32) *TreeTableWidget
- type VSliderIntWidget
- func (vs *VSliderIntWidget) Build()
- func (vs *VSliderIntWidget) Flags(flags SliderFlags) *VSliderIntWidget
- func (vs *VSliderIntWidget) Format(format string) *VSliderIntWidget
- func (vs *VSliderIntWidget) Label(label string) *VSliderIntWidget
- func (vs *VSliderIntWidget) Labelf(format string, args ...any) *VSliderIntWidget
- func (vs *VSliderIntWidget) OnChange(onChange func()) *VSliderIntWidget
- func (vs *VSliderIntWidget) Size(width, height float32) *VSliderIntWidget
- type VSplitterWidget
- type Widget
- type WindowFlags
- type WindowShortcut
- type WindowWidget
- func (w *WindowWidget) BringToFront()
- func (w *WindowWidget) CurrentPosition() (x, y float32)
- func (w *WindowWidget) CurrentSize() (width, height float32)
- func (w *WindowWidget) Flags(flags WindowFlags) *WindowWidget
- func (w *WindowWidget) HasFocus() bool
- func (w *WindowWidget) IsOpen(open *bool) *WindowWidget
- func (w *WindowWidget) Layout(widgets ...Widget)
- func (w *WindowWidget) Pos(x, y float32) *WindowWidget
- func (w *WindowWidget) RegisterKeyboardShortcuts(s ...WindowShortcut) *WindowWidget
- func (w *WindowWidget) Size(width, height float32) *WindowWidget
Constants ¶
const ( FocusedFlagsNone = imgui.FocusedFlagsNone FocusedFlagsChildWindows = imgui.FocusedFlagsChildWindows // Return true if any children of the window is focused FocusedFlagsRootWindow = imgui.FocusedFlagsRootWindow // Test from root window (top most parent of the current hierarchy) FocusedFlagsAnyWindow = imgui.FocusedFlagsAnyWindow // Return true if any window is focused. Important: If you are trying to tell how to dispatch your low-level inputs do NOT use this. Use 'io.WantCaptureMouse' instead! Please read the FAQ! FocusedFlagsNoPopupHierarchy = imgui.FocusedFlagsNoPopupHierarchy // Do not consider popup hierarchy (do not treat popup emitter as parent of popup) (when used with ChildWindows or RootWindow) // FocusedFlagsDockHierarchy = 1 << 4 // Consider docking hierarchy (treat dockspace host as parent of docked window) (when used with ChildWindows or RootWindow). FocusedFlagsRootAndChildWindows = imgui.FocusedFlagsRootAndChildWindows )
focused flags list.
const ( PlotFlagsNone = PlotFlags(imgui.ImPlotFlags_None) PlotFlagsNoTitle = PlotFlags(imgui.ImPlotFlags_NoTitle) PlotFlagsNoLegend = PlotFlags(imgui.ImPlotFlags_NoLegend) PlotFlagsNoMenus = PlotFlags(imgui.ImPlotFlags_NoMenus) PlotFlagsNoBoxSelect = PlotFlags(imgui.ImPlotFlags_NoBoxSelect) PlotFlagsNoMousePos = PlotFlags(imgui.ImPlotFlags_NoMousePos) PlotFlagsNoHighlight = PlotFlags(imgui.ImPlotFlags_NoHighlight) PlotFlagsNoChild = PlotFlags(imgui.ImPlotFlags_NoChild) PlotFlagsEqual = PlotFlags(imgui.ImPlotFlags_Equal) PlotFlagsYAxis2 = PlotFlags(imgui.ImPlotFlags_YAxis2) PlotFlagsYAxis3 = PlotFlags(imgui.ImPlotFlags_YAxis3) PlotFlagsQuery = PlotFlags(imgui.ImPlotFlags_Query) PlotFlagsCrosshairs = PlotFlags(imgui.ImPlotFlags_Crosshairs) PlotFlagsAntiAliased = PlotFlags(imgui.ImPlotFlags_AntiAliased) PlotFlagsCanvasOnly = PlotFlags(imgui.ImPlotFlags_CanvasOnly) )
plot flags.
const ( DialogResultOK DialogResult = true DialogResultCancel DialogResult = false DialogResultYes = DialogResultOK DialogResultNo = DialogResultCancel )
dialog results.
const ( TextureFilterNearest = iota TextureFilterLinear TextureFilterNearestMipmapNearest TextureFilterLinearMipmapNearest TextureFilterNearestMipmapLinear TextureFilterLinearMipmapLinear )
Texture filtering types.
const ( // Auto is used to widget.Size to indicate height or width to occupy available spaces. Auto float32 = -1 )
Variables ¶
var Context context
Context represents a giu context.
var DontCare int = imgui.GlfwDontCare
DontCare could be used as an argument to (*MasterWindow).SetSizeLimits.
Functions ¶
func AlignTextToFramePadding ¶
func AlignTextToFramePadding()
AlignTextToFramePadding vertically aligns upcoming text baseline to FramePadding.y so that it will align properly to regularly framed items. Call if you have text on a line before a framed item.
func CalcTextSize ¶
CalcTextSize calls CalcTextSizeV(text, false, -1).
func CalcTextSizeV ¶
CalcTextSizeV calculates text dimensions.
func CloseCurrentPopup ¶
func CloseCurrentPopup()
CloseCurrentPopup closes currently opened popup. If no popups opened, no action will be taken.
func EnqueueNewTextureFromRgba ¶
EnqueueNewTextureFromRgba adds loading texture request to loading queue it allows us to run this method in main loop NOTE: remember to call it after NewMasterWindow!
func GetAvailableRegion ¶
func GetAvailableRegion() (width, height float32)
GetAvailableRegion returns region available for rendering. it is always WindowSize-WindowPadding*2.
func GetCursorPos ¶
GetCursorPos gets imgui drawing cursor inside of current window.
func GetCursorScreenPos ¶
GetCursorScreenPos returns imgui drawing cursor on the screen.
func GetFramePadding ¶
func GetFramePadding() (x, y float32)
GetFramePadding returns current frame padding.
func GetItemInnerSpacing ¶
func GetItemInnerSpacing() (w, h float32)
GetItemInnerSpacing returns current item inner spacing.
func GetItemSpacing ¶
func GetItemSpacing() (w, h float32)
GetItemSpacing returns current item spacing.
func GetWidgetWidth ¶
GetWidgetWidth returns a width of widget NOTE: THIS IS A BETA SOLUTION and may contain bugs in most cases, you may want to use supported by imgui GetItemRectSize. There is an upstream issue for this problem: https://github.com/ocornut/imgui/issues/3714
This function is just a workaround used in giu.
NOTE: user-definied widgets, which contains more than one giu widget will be processed incorrectly (only width of the last built widget will be processed)
here is a list of known bugs: - BUG: user can interact with invisible widget (created by GetWidgetWidth)
if you find anything else, please report it on https://github.com/zoomasochist/giu Any contribution is appreciated!
func GetWindowPadding ¶
func GetWindowPadding() (x, y float32)
GetWindowPadding returns window padding.
func ImageToRgba ¶
ImageToRgba converts image.Image to *image.RGBA.
func IsItemClicked ¶
func IsItemClicked(mouseButton MouseButton) bool
IsItemClicked returns true if mouse is clicked NOTE: if you're looking for clicking detection, see EventHandler.go.
func IsItemHovered ¶
func IsItemHovered() bool
IsItemHovered returns true if mouse is over the item.
func IsKeyPressed ¶
IsKeyPressed returns true if key `key` is pressed.
func IsKeyReleased ¶
IsKeyReleased returns true if key `key` is released.
func IsMouseClicked ¶
func IsMouseClicked(button MouseButton) bool
IsMouseClicked returns true if mouse button `button` is clicked NOTE: if you're looking for clicking detection, see EventHandler.go.
func IsMouseDoubleClicked ¶
func IsMouseDoubleClicked(button MouseButton) bool
IsMouseDoubleClicked returns true if mouse button `button` is double clicked.
func IsMouseDown ¶
func IsMouseDown(button MouseButton) bool
IsMouseDown returns true if mouse button `button` is down.
func IsMouseReleased ¶
func IsMouseReleased(button MouseButton) bool
IsMouseReleased returns true if mouse button `button` is released.
func IsWindowAppearing ¶
func IsWindowAppearing() bool
IsWindowAppearing returns true if window is appearing.
func IsWindowCollapsed ¶
func IsWindowCollapsed() bool
IsWindowCollapsed returns true if window is disappearing.
func IsWindowFocused ¶
func IsWindowFocused(flags FocusedFlags) bool
IsWindowFocused returns true if window is focused NOTE: see also (*Window).HasFocus and (*Window).BringToFront.
func IsWindowHovered ¶
func IsWindowHovered(flags HoveredFlags) bool
IsWindowHovered returns true if the window is hovered.
func NewTextureFromRgba ¶
NewTextureFromRgba creates a new texture from image.Image and, when it is done, calls loadCallback(loadedTexture).
func OpenPopup ¶
func OpenPopup(name string)
OpenPopup opens a popup with specified id. NOTE: you need to build this popup first (see Pop(Modal)Widget).
func PopItemWidth ¶
func PopItemWidth()
PopItemWidth should be called to stop applying PushItemWidth effect If it isn't called imgui will panic.
func PopStyle ¶
func PopStyle()
PopStyle should be called to stop applying style. It should be called as much times, as you Called PushStyle... NOTE: If you don't call PopStyle imgui will panic.
func PopStyleColor ¶
func PopStyleColor()
PopStyleColor is used to stop applying colors styles. It should be called after each PushStyleColor... (for each push) If PopStyleColor wasn't called after PushColor... or was called inproperly, imgui will panic.
func PopStyleColorV ¶
func PopStyleColorV(count int)
PopStyleColorV does similar to PopStyleColor, but allows to specify how much style colors would you like to pop.
func PopStyleV ¶
func PopStyleV(count int)
PopStyleV does similarly to PopStyle, but allows to specify number of styles you're going to pop.
func PopTextWrapPos ¶
func PopTextWrapPos()
PopTextWrapPos should be caled as many times as PushTextWrapPos on each frame.
func PushButtonTextAlign ¶
func PushButtonTextAlign(width, height float32)
PushButtonTextAlign sets alignment for button text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered.
func PushClipRect ¶
PushClipRect pushes a clipping rectangle for both ImGui logic (hit-testing etc.) and low-level ImDrawList rendering.
func PushColorButton ¶
PushColorButton calls PushStyleColor(StyleColorButton,...) NOTE: don't forget to call PopStyleColor()!
func PushColorButtonActive ¶
PushColorButtonActive calls PushStyleColor(StyleColorButtonActive,...) NOTE: don't forget to call PopStyleColor()!
func PushColorButtonHovered ¶
PushColorButtonHovered calls PushStyleColor(StyleColorButtonHovered,...) NOTE: don't forget to call PopStyleColor()!
func PushColorFrameBg ¶
PushColorFrameBg calls PushStyleColor(StyleColorFrameBg,...) NOTE: don't forget to call PopStyleColor()!
func PushColorText ¶
PushColorText calls PushStyleColor(StyleColorText,...) NOTE: don't forget to call PopStyleColor()!
func PushColorTextDisabled ¶
PushColorTextDisabled calls PushStyleColor(StyleColorTextDisabled,...) NOTE: don't forget to call PopStyleColor()!
func PushColorWindowBg ¶
PushColorWindowBg calls PushStyleColor(StyleColorWindowBg,...) NOTE: don't forget to call PopStyleColor()!
func PushFont ¶
PushFont sets font to "font" NOTE: PopFont has to be called NOTE: Don't use PushFont. use StyleSetter instead.
func PushFramePadding ¶
func PushFramePadding(width, height float32)
PushFramePadding calls PushStyleVar(StyleFramePadding,...)
func PushItemSpacing ¶
func PushItemSpacing(width, height float32)
PushItemSpacing calls PushStyleVar(StyleVarItemSpacing,...)
func PushItemWidth ¶
func PushItemWidth(width float32)
PushItemWidth sets following item's widths NOTE: don't forget to call PopItemWidth! If you don't do so, imgui will panic.
func PushSelectableTextAlign ¶
func PushSelectableTextAlign(width, height float32)
PushSelectableTextAlign sets alignment for selectable text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered.
func PushStyleColor ¶
func PushStyleColor(id StyleColorID, col color.Color)
PushStyleColor wrapps imgui.PushStyleColor NOTE: don't forget to call PopStyleColor()!
func PushTextWrapPos ¶
func PushTextWrapPos()
PushTextWrapPos adds the position, where the text should be frapped. use PushTextWrapPos, render text. If text reaches frame end, rendering will be continued at the start pos in line below. NOTE: Don't forget to call PopWrapTextPos NOTE: it is done automatically in LabelWidget (see (*LabelWIdget).Wrapped()).
func PushWindowPadding ¶
func PushWindowPadding(width, height float32)
PushWindowPadding calls PushStyleVar(StyleWindowPadding,...)
func RegisterString ¶
RegisterString register string to font atlas builder. Note only register strings that will be displayed on the UI.
func RegisterStringPointer ¶
RegisterStringPointer registers string pointer to font atlas builder. Note only register strings that will be displayed on the UI.
func RegisterStringSlice ¶
RegisterStringSlice calls RegisterString for each slice element
func SameLine ¶
func SameLine()
SameLine wrapps imgui.SomeLine Don't use if you don't have to (use RowWidget instead).
func SetCursorPos ¶
SetCursorPos sets imgui drawing cursor inside of current window.
func SetCursorScreenPos ¶
SetCursorScreenPos sets imgui drawing cursor on the screen.
func SetDefaultFont ¶
SetDefaultFont changes default font.
func SetDefaultFontFromBytes ¶
SetDefaultFontFromBytes changes default font by bytes of the font file.
func SetDefaultFontSize ¶
func SetDefaultFontSize(size float32)
SetDefaultFontSize sets the default font size. Invoke this before MasterWindow.NewMasterWindow(..).
func SetItemDefaultFocus ¶
func SetItemDefaultFocus()
SetItemDefaultFocus set the item focused by default.
func SetKeyboardFocusHere ¶
func SetKeyboardFocusHere()
SetKeyboardFocusHere sets keyboard focus at *NEXT* widget.
func SetKeyboardFocusHereV ¶
func SetKeyboardFocusHereV(i int)
SetKeyboardFocusHereV sets keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget. Use -1 to access previous widget.
func SetMouseCursor ¶
func SetMouseCursor(cursor MouseCursorType)
SetMouseCursor sets mouse cursor layout.
func SetNextWindowPos ¶
func SetNextWindowPos(x, y float32)
SetNextWindowPos sets position of next window.
func SetNextWindowSize ¶
func SetNextWindowSize(width, height float32)
SetNextWindowSize sets size of the next window.
func SetNextWindowSizeV ¶
func SetNextWindowSizeV(width, height float32, condition ExecCondition)
SetNextWindowSizeV does similar to SetNextWIndowSize but allows to specify imgui.Condition.
func ToVec4Color ¶
ToVec4Color converts rgba color to imgui.Vec4.
func Update ¶
func Update()
Update updates giu app it is done by default after each frame. However because frames stops rendering, when no user action is done, it may be necessary to Update ui manually at some point.
func Vec4ToRGBA ¶
Vec4ToRGBA converts imgui's Vec4 to golang rgba color.
Types ¶
type AlignmentSetter ¶
type AlignmentSetter struct {
// contains filtered or unexported fields
}
AlignmentSetter allows to align to right / center a widget or widgets group. NOTE: Because of AlignSetter uses experimental GetWidgetWidth, it is experimental too. usage: see examples/align
list of known bugs: - BUG: DatePickerWidget doesn't work properly - BUG: there is some bug with SelectableWidget - BUG: ComboWidget and ComboCustomWidgets doesn't work properly.
func (*AlignmentSetter) Build ¶
func (a *AlignmentSetter) Build()
Build implements Widget interface.
func (*AlignmentSetter) ID ¶
func (a *AlignmentSetter) ID(id string) *AlignmentSetter
ID allows to manually set AlignmentSetter ID NOTE: there isn't any known reason to use this method, however it is here for some random cases. YOU DON'T NEED TO USE IT in normal conditions.
func (*AlignmentSetter) To ¶
func (a *AlignmentSetter) To(widgets ...Widget) *AlignmentSetter
To sets a layout, alignment should be applied to.
type AlignmentType ¶
type AlignmentType byte
AlignmentType represents a bype of alignment to use with AlignSetter.
const ( // AlignLeft is here just for clearity. // if set, no action is taken so don't use it. AlignLeft AlignmentType = iota // AlignCenter centers widget. AlignCenter // AlignRight aligns a widget to right side of window. AlignRight )
type ArrowButtonWidget ¶
type ArrowButtonWidget struct {
// contains filtered or unexported fields
}
ArrowButtonWidget represents a square button with an arrow.
func ArrowButton ¶
func ArrowButton(dir Direction) *ArrowButtonWidget
ArrowButton creates ArrowButtonWidget.
func (*ArrowButtonWidget) Build ¶
func (b *ArrowButtonWidget) Build()
Build implements Widget interface.
func (*ArrowButtonWidget) ID ¶
func (b *ArrowButtonWidget) ID(id string) *ArrowButtonWidget
ID allows to manually set widget's id.
func (*ArrowButtonWidget) OnClick ¶
func (b *ArrowButtonWidget) OnClick(onClick func()) *ArrowButtonWidget
OnClick adds callback called when button is clicked.
type BulletTextWidget ¶
type BulletTextWidget struct {
// contains filtered or unexported fields
}
BulletTextWidget does similar to BulletWidget, but allows to add a text after a bullet. Very useful to create lists.
func BulletText ¶
func BulletText(text string) *BulletTextWidget
BulletText creates bulletTextWidget.
func BulletTextf ¶
func BulletTextf(format string, args ...any) *BulletTextWidget
BulletTextf is a formatting version of BulletText.
func (*BulletTextWidget) Build ¶
func (bt *BulletTextWidget) Build()
Build implements Widget interface.
type BulletWidget ¶
type BulletWidget struct{}
BulletWidget adds a small, white dot (bullet). useful in enumerations.
type ButtonWidget ¶
type ButtonWidget struct {
// contains filtered or unexported fields
}
ButtonWidget represents a ImGui button widget.
func Buttonf ¶
func Buttonf(format string, args ...any) *ButtonWidget
Buttonf creates button with formated label NOTE: works like fmt.Sprintf (see `go doc fmt`).
func (*ButtonWidget) Disabled ¶
func (b *ButtonWidget) Disabled(d bool) *ButtonWidget
Disabled sets button's disabled state NOTE: same effect as Style().SetDisabled.
func (*ButtonWidget) OnClick ¶
func (b *ButtonWidget) OnClick(onClick func()) *ButtonWidget
OnClick sets callback called when button is clicked NOTE: to set double click, see EventHandler.go.
func (*ButtonWidget) Size ¶
func (b *ButtonWidget) Size(width, height float32) *ButtonWidget
Size sets button's size.
type Canvas ¶
type Canvas struct {
// contains filtered or unexported fields
}
Canvas represents imgui.DrawList from imgui.h:
A single draw command list (generally one per window, conceptually you may see this as a dynamic "mesh" builder)
for more details and use cases see examples/canvas.
func GetCanvas ¶
func GetCanvas() *Canvas
GetCanvas returns current draw list (for current window). it will fail if called out of window's layout.
func (*Canvas) AddBezierCubic ¶
func (c *Canvas) AddBezierCubic(pos0, cp0, cp1, pos1 image.Point, col color.Color, thickness float32, numSegments int)
AddBezierCubic draws bezier cubic.
func (*Canvas) AddCircle ¶
func (c *Canvas) AddCircle(center image.Point, radius float32, col color.Color, segments int, thickness float32)
AddCircle draws a circle.
func (*Canvas) AddCircleFilled ¶
AddCircleFilled draws a filled circle.
func (*Canvas) AddQuadFilled ¶
AddQuadFilled draws a filled quad.
func (*Canvas) AddRect ¶
func (c *Canvas) AddRect(pMin, pMax image.Point, col color.Color, rounding float32, roundingCorners DrawFlags, thickness float32)
AddRect draws a rectangle.
func (*Canvas) AddRectFilled ¶
func (c *Canvas) AddRectFilled(pMin, pMax image.Point, col color.Color, rounding float32, roundingCorners DrawFlags)
AddRectFilled draws a rectangle filled with `col`.
func (*Canvas) AddTriangle ¶
AddTriangle draws a triangle.
func (*Canvas) AddTriangleFilled ¶
AddTriangleFilled draws a filled triangle.
func (*Canvas) PathArcToFast ¶
func (*Canvas) PathBezierCubicCurveTo ¶
func (*Canvas) PathFillConvex ¶
func (*Canvas) PathLineTo ¶
func (*Canvas) PathLineToMergeDuplicate ¶
type CheckboxWidget ¶
type CheckboxWidget struct {
// contains filtered or unexported fields
}
CheckboxWidget adds a checkbox.
func Checkbox ¶
func Checkbox(text string, selected *bool) *CheckboxWidget
Checkbox creates a new CheckboxWidget.
func (*CheckboxWidget) OnChange ¶
func (c *CheckboxWidget) OnChange(onChange func()) *CheckboxWidget
OnChange adds callback called when checkbox's state was changed.
type ChildWidget ¶
type ChildWidget struct {
// contains filtered or unexported fields
}
func Child ¶
func Child() *ChildWidget
func (*ChildWidget) Border ¶
func (c *ChildWidget) Border(border bool) *ChildWidget
func (*ChildWidget) Flags ¶
func (c *ChildWidget) Flags(flags WindowFlags) *ChildWidget
func (*ChildWidget) ID ¶
func (c *ChildWidget) ID(id string) *ChildWidget
ID sets the interval id of child widgets.
func (*ChildWidget) Layout ¶
func (c *ChildWidget) Layout(widgets ...Widget) *ChildWidget
func (*ChildWidget) Size ¶
func (c *ChildWidget) Size(width, height float32) *ChildWidget
type CodeEditorWidget ¶
type CodeEditorWidget struct {
// contains filtered or unexported fields
}
CodeEditorWidget represents imgui.TextEditor.
func (*CodeEditorWidget) Border ¶
func (ce *CodeEditorWidget) Border(border bool) *CodeEditorWidget
Border sets editors borders.
func (*CodeEditorWidget) Build ¶
func (ce *CodeEditorWidget) Build()
Build implements Widget interface.
func (*CodeEditorWidget) Delete ¶
func (ce *CodeEditorWidget) Delete()
Delete deletes the selection.
func (*CodeEditorWidget) ErrorMarkers ¶
func (ce *CodeEditorWidget) ErrorMarkers(markers imgui.ErrorMarkers) *CodeEditorWidget
ErrorMarkers sets error markers.
func (*CodeEditorWidget) GetCurrentLineText ¶
func (ce *CodeEditorWidget) GetCurrentLineText() string
GetCurrentLineText returns current line.
func (*CodeEditorWidget) GetCursorPos ¶
func (ce *CodeEditorWidget) GetCursorPos() (x, y int)
GetCursorPos returns cursor position. (in characters).
func (*CodeEditorWidget) GetScreenCursorPos ¶
func (ce *CodeEditorWidget) GetScreenCursorPos() (x, y int)
GetScreenCursorPos returns cursor position on the screen. (in pixels).
func (*CodeEditorWidget) GetSelectedText ¶
func (ce *CodeEditorWidget) GetSelectedText() string
GetSelectedText returns selected text.
func (*CodeEditorWidget) GetSelectionStart ¶
func (ce *CodeEditorWidget) GetSelectionStart() (x, y int)
GetSelectionStart returns star pos of selection.
func (*CodeEditorWidget) GetText ¶
func (ce *CodeEditorWidget) GetText() string
GetText returns whole text from editor.
func (*CodeEditorWidget) GetWordUnderCursor ¶
func (ce *CodeEditorWidget) GetWordUnderCursor() string
GetWordUnderCursor returns the word under the cursor.
func (*CodeEditorWidget) HandleKeyboardInputs ¶
func (ce *CodeEditorWidget) HandleKeyboardInputs(b bool) *CodeEditorWidget
HandleKeyboardInputs sets if editor should handle keyboard input.
func (*CodeEditorWidget) HasSelection ¶
func (ce *CodeEditorWidget) HasSelection() bool
HasSelection returns true if some text is selected.
func (*CodeEditorWidget) ID ¶
func (ce *CodeEditorWidget) ID(id string) *CodeEditorWidget
ID allows to manually set editor's ID. It isn't necessary to use it in a normal conditions.
func (*CodeEditorWidget) InsertText ¶
func (ce *CodeEditorWidget) InsertText(text string)
InsertText inserts the `text`.
func (*CodeEditorWidget) IsTextChanged ¶
func (ce *CodeEditorWidget) IsTextChanged() bool
IsTextChanged returns true if the editable text was changed in the frame.
func (*CodeEditorWidget) LanguageDefinition ¶
func (ce *CodeEditorWidget) LanguageDefinition(definition LanguageDefinition) *CodeEditorWidget
LanguageDefinition sets code editor language definition.
func (*CodeEditorWidget) SelectWordUnderCursor ¶
func (ce *CodeEditorWidget) SelectWordUnderCursor()
SelectWordUnderCursor selects the word under cursor.
func (*CodeEditorWidget) ShowWhitespaces ¶
func (ce *CodeEditorWidget) ShowWhitespaces(s bool) *CodeEditorWidget
ShowWhitespaces sets if whitespaces are shown in code editor.
func (*CodeEditorWidget) Size ¶
func (ce *CodeEditorWidget) Size(w, h float32) *CodeEditorWidget
Size sets editor's size.
func (*CodeEditorWidget) TabSize ¶
func (ce *CodeEditorWidget) TabSize(size int) *CodeEditorWidget
TabSize sets editor's tab size.
func (*CodeEditorWidget) Text ¶
func (ce *CodeEditorWidget) Text(str string) *CodeEditorWidget
Text sets editor's text.
type ColorEditFlags ¶
type ColorEditFlags int
ColorEditFlags for ColorEdit3V(), etc.
const ( // ColorEditFlagsNone default = 0. ColorEditFlagsNone ColorEditFlags = imgui.ColorEditFlagsNone // ColorEditFlagsNoAlpha ignores Alpha component (read 3 components from the input pointer). ColorEditFlagsNoAlpha ColorEditFlags = imgui.ColorEditFlagsNoAlpha // ColorEditFlagsNoPicker disables picker when clicking on colored square. ColorEditFlagsNoPicker ColorEditFlags = imgui.ColorEditFlagsNoPicker // ColorEditFlagsNoOptions disables toggling options menu when right-clicking on inputs/small preview. ColorEditFlagsNoOptions ColorEditFlags = imgui.ColorEditFlagsNoOptions // ColorEditFlagsNoSmallPreview disables colored square preview next to the inputs. (e.g. to show only the inputs). ColorEditFlagsNoSmallPreview ColorEditFlags = imgui.ColorEditFlagsNoSmallPreview // ColorEditFlagsNoInputs disables inputs sliders/text widgets (e.g. to show only the small preview colored square). ColorEditFlagsNoInputs ColorEditFlags = imgui.ColorEditFlagsNoInputs // ColorEditFlagsNoTooltip disables tooltip when hovering the preview. ColorEditFlagsNoTooltip ColorEditFlags = imgui.ColorEditFlagsNoTooltip // ColorEditFlagsNoLabel disables display of inline text label (the label is still forwarded to the tooltip and picker). ColorEditFlagsNoLabel ColorEditFlags = imgui.ColorEditFlagsNoLabel // ColorEditFlagsNoDragDrop disables drag and drop target. ColorButton: disable drag and drop source. ColorEditFlagsNoDragDrop ColorEditFlags = imgui.ColorEditFlagsNoDragDrop // ColorEditFlagsAlphaBar shows vertical alpha bar/gradient in picker. ColorEditFlagsAlphaBar ColorEditFlags = imgui.ColorEditFlagsAlphaBar // ColorEditFlagsAlphaPreview displays preview as a transparent color over a checkerboard, instead of opaque. ColorEditFlagsAlphaPreview ColorEditFlags = imgui.ColorEditFlagsAlphaPreview // ColorEditFlagsAlphaPreviewHalf displays half opaque / half checkerboard, instead of opaque. ColorEditFlagsAlphaPreviewHalf ColorEditFlags = imgui.ColorEditFlagsAlphaPreviewHalf // ColorEditFlagsHDR = (WIP) surrently only disable 0.0f..1.0f limits in RGBA edition (note: you probably want to use // ImGuiColorEditFlags_Float flag as well). ColorEditFlagsHDR ColorEditFlags = imgui.ColorEditFlagsHDR // ColorEditFlagsRGB sets the format as RGB. ColorEditFlagsRGB ColorEditFlags = imgui.ColorEditFlagsRGB // ColorEditFlagsHSV sets the format as HSV. ColorEditFlagsHSV ColorEditFlags = imgui.ColorEditFlagsHSV // ColorEditFlagsHEX sets the format as HEX. ColorEditFlagsHEX ColorEditFlags = imgui.ColorEditFlagsHEX // ColorEditFlagsUint8 _display_ values formatted as 0..255. ColorEditFlagsUint8 ColorEditFlags = imgui.ColorEditFlagsUint8 // ColorEditFlagsFloat _display_ values formatted as 0.0f..1.0f floats instead of 0..255 integers. No round-trip of value via integers. ColorEditFlagsFloat ColorEditFlags = imgui.ColorEditFlagsFloat )
list of color edit flags.
type ColorEditWidget ¶
type ColorEditWidget struct {
// contains filtered or unexported fields
}
func (*ColorEditWidget) Build ¶
func (ce *ColorEditWidget) Build()
Build implements Widget interface.
func (*ColorEditWidget) Flags ¶
func (ce *ColorEditWidget) Flags(f ColorEditFlags) *ColorEditWidget
func (*ColorEditWidget) OnChange ¶
func (ce *ColorEditWidget) OnChange(cb func()) *ColorEditWidget
func (*ColorEditWidget) Size ¶
func (ce *ColorEditWidget) Size(width float32) *ColorEditWidget
type ColumnWidget ¶
type ColumnWidget struct {
// contains filtered or unexported fields
}
ColumnWidget will place all widgets one by one vertically.
type ComboCustomWidget ¶
type ComboCustomWidget struct {
// contains filtered or unexported fields
}
ComboCustomWidget represents a combo with custom layout when opened.
func ComboCustom ¶
func ComboCustom(label, previewValue string) *ComboCustomWidget
ComboCustom creates a new combo custom widget.
func (*ComboCustomWidget) Build ¶
func (cc *ComboCustomWidget) Build()
Build implements Widget interface.
func (*ComboCustomWidget) Flags ¶
func (cc *ComboCustomWidget) Flags(flags ComboFlags) *ComboCustomWidget
Flags allows to set combo flags (see Flags.go).
func (*ComboCustomWidget) Layout ¶
func (cc *ComboCustomWidget) Layout(widgets ...Widget) *ComboCustomWidget
Layout add combo's layout.
func (*ComboCustomWidget) Size ¶
func (cc *ComboCustomWidget) Size(width float32) *ComboCustomWidget
Size sets combo preiview width.
type ComboFlags ¶
type ComboFlags int
ComboFlags represents imgui.ComboFlags.
const ( // ComboFlagsNone default = 0. ComboFlagsNone ComboFlags = imgui.ComboFlagsNone // ComboFlagsPopupAlignLeft aligns the popup toward the left by default. ComboFlagsPopupAlignLeft ComboFlags = imgui.ComboFlagsPopupAlignLeft // ComboFlagsHeightSmall has max ~4 items visible. // Tip: If you want your combo popup to be a specific size you can use SetNextWindowSizeConstraints() prior to calling BeginCombo(). ComboFlagsHeightSmall ComboFlags = imgui.ComboFlagsHeightSmall // ComboFlagsHeightRegular has max ~8 items visible (default). ComboFlagsHeightRegular ComboFlags = imgui.ComboFlagsHeightRegular // ComboFlagsHeightLarge has max ~20 items visible. ComboFlagsHeightLarge ComboFlags = imgui.ComboFlagsHeightLarge // ComboFlagsHeightLargest has as many fitting items as possible. ComboFlagsHeightLargest ComboFlags = imgui.ComboFlagsHeightLargest // ComboFlagsNoArrowButton displays on the preview box without the square arrow button. ComboFlagsNoArrowButton ComboFlags = imgui.ComboFlagsNoArrowButton // ComboFlagsNoPreview displays only a square arrow button. ComboFlagsNoPreview ComboFlags = imgui.ComboFlagsNoPreview )
combo flags list.
type ComboWidget ¶
type ComboWidget struct {
// contains filtered or unexported fields
}
ComboWidget is a wrapper of ComboCustomWidget. It creates a combo of selectables. (it is the most frequently used).
func Combo ¶
func Combo(label, previewValue string, items []string, selected *int32) *ComboWidget
Combo creates a new ComboWidget.
func (*ComboWidget) Flags ¶
func (c *ComboWidget) Flags(flags ComboFlags) *ComboWidget
Flags allows to set combo flags (see Flags.go).
func (*ComboWidget) OnChange ¶
func (c *ComboWidget) OnChange(onChange func()) *ComboWidget
OnChange sets callback when combo value gets changed.
func (*ComboWidget) Size ¶
func (c *ComboWidget) Size(width float32) *ComboWidget
Size sets combo's width.
type ConditionWidget ¶
type ConditionWidget struct {
// contains filtered or unexported fields
}
func Condition ¶
func Condition(cond bool, layoutIf, layoutElse Layout) *ConditionWidget
func (*ConditionWidget) Build ¶
func (c *ConditionWidget) Build()
Build implements Widget interface.
type ContextMenuWidget ¶
type ContextMenuWidget struct {
// contains filtered or unexported fields
}
func ContextMenu ¶
func ContextMenu() *ContextMenuWidget
func (*ContextMenuWidget) Build ¶
func (c *ContextMenuWidget) Build()
Build implements Widget interface.
func (*ContextMenuWidget) ID ¶
func (c *ContextMenuWidget) ID(id string) *ContextMenuWidget
func (*ContextMenuWidget) Layout ¶
func (c *ContextMenuWidget) Layout(widgets ...Widget) *ContextMenuWidget
func (*ContextMenuWidget) MouseButton ¶
func (c *ContextMenuWidget) MouseButton(mouseButton MouseButton) *ContextMenuWidget
type CustomWidget ¶
type CustomWidget struct {
// contains filtered or unexported fields
}
func Custom ¶
func Custom(builder func()) *CustomWidget
type DatePickerWidget ¶
type DatePickerWidget struct {
// contains filtered or unexported fields
}
func DatePicker ¶
func DatePicker(id string, date *time.Time) *DatePickerWidget
func (*DatePickerWidget) Build ¶
func (d *DatePickerWidget) Build()
Build implements Widget interface.
func (*DatePickerWidget) Format ¶
func (d *DatePickerWidget) Format(format string) *DatePickerWidget
func (*DatePickerWidget) OnChange ¶
func (d *DatePickerWidget) OnChange(onChange func()) *DatePickerWidget
func (*DatePickerWidget) Size ¶
func (d *DatePickerWidget) Size(width float32) *DatePickerWidget
func (*DatePickerWidget) StartOfWeek ¶
func (d *DatePickerWidget) StartOfWeek(weekday time.Weekday) *DatePickerWidget
type DialogResult ¶
type DialogResult bool
DialogResult represents dialog result dialog resullt is bool. if OK/Yes it is true, else (Cancel/No) - false.
type DialogResultCallback ¶
type DialogResultCallback func(DialogResult)
DialogResultCallback is a callback for dialogs.
type Disposable ¶
type Disposable interface {
Dispose()
}
Disposable should be implemented by all states stored in context. Dispose method is called when state is removed from context.
type DragIntWidget ¶
type DragIntWidget struct {
// contains filtered or unexported fields
}
func (*DragIntWidget) Format ¶
func (d *DragIntWidget) Format(format string) *DragIntWidget
func (*DragIntWidget) Speed ¶
func (d *DragIntWidget) Speed(speed float32) *DragIntWidget
type DrawFlags ¶
type DrawFlags int
DrawFlags represents imgui.DrawFlags.
const ( DrawFlagsNone DrawFlags = 0 // PathStroke(), AddPolyline(): specify that shape should be closed (portant: this is always == 1 for legacy reason). DrawFlagsClosed DrawFlags = 1 << 0 // AddRect(), AddRectFilled(), PathRect(): enable rounding top-left corner only (when rounding > 0.0f, we default to all corners). // Was 0x01. DrawFlagsRoundCornersTopLeft DrawFlags = 1 << 4 // AddRect(), AddRectFilled(), PathRect(): enable rounding top-right corner only (when rounding > 0.0f, we default to all corners). // Was 0x02. DrawFlagsRoundCornersTopRight DrawFlags = 1 << 5 // AddRect(), AddRectFilled(), PathRect(): enable rounding bottom-left corner only (when rounding > 0.0f, we default to all corners). // Was 0x04. DrawFlagsRoundCornersBottomLeft DrawFlags = 1 << 6 // AddRect(), AddRectFilled(), PathRect(): enable rounding bottom-right corner only (when rounding > 0.0f, // we default to all corners). Wax 0x08. DrawFlagsRoundCornersBottomRight DrawFlags = 1 << 7 // AddRect(), AddRectFilled(), PathRect(): disable rounding on all corners (when rounding > 0.0f). This is NOT zero, NOT an implicit flag! DrawFlagsRoundCornersNone DrawFlags = 1 << 8 DrawFlagsRoundCornersTop DrawFlags = DrawFlagsRoundCornersTopLeft | DrawFlagsRoundCornersTopRight DrawFlagsRoundCornersBottom DrawFlags = DrawFlagsRoundCornersBottomLeft | DrawFlagsRoundCornersBottomRight DrawFlagsRoundCornersLeft DrawFlags = DrawFlagsRoundCornersBottomLeft | DrawFlagsRoundCornersTopLeft DrawFlagsRoundCornersRight DrawFlags = DrawFlagsRoundCornersBottomRight | DrawFlagsRoundCornersTopRight DrawFlagsRoundCornersAll DrawFlags = DrawFlagsRoundCornersTopLeft | DrawFlagsRoundCornersTopRight | DrawFlagsRoundCornersBottomLeft | DrawFlagsRoundCornersBottomRight // Default to ALL corners if none of the RoundCornersXX flags are specified. DrawFlagsRoundCornersDefault DrawFlags = DrawFlagsRoundCornersAll DrawFlagsRoundCornersMask DrawFlags = DrawFlagsRoundCornersAll | DrawFlagsRoundCornersNone )
draw flags enum:.
type DummyWidget ¶
type DummyWidget struct {
// contains filtered or unexported fields
}
func Dummy ¶
func Dummy(width, height float32) *DummyWidget
type EventHandler ¶
type EventHandler struct {
// contains filtered or unexported fields
}
EventHandler is a universal event handler for giu widgets. put giu.Event()... after any widget to handle any event.
func (*EventHandler) Build ¶
func (eh *EventHandler) Build()
Build implements Widget interface nolint:gocognit,gocyclo // will fix later
func (*EventHandler) OnActivate ¶
func (eh *EventHandler) OnActivate(cb func()) *EventHandler
OnActivate sets callback when item gets activated.
func (*EventHandler) OnActive ¶
func (eh *EventHandler) OnActive(cb func()) *EventHandler
OnActive sets a callback when ite IS ACTIVE (not activated).
func (*EventHandler) OnClick ¶
func (eh *EventHandler) OnClick(mouseButton MouseButton, callback func()) *EventHandler
OnClick sets callback when mouse button `mouseButton` is clicked.
func (*EventHandler) OnDClick ¶
func (eh *EventHandler) OnDClick(mouseButton MouseButton, callback func()) *EventHandler
OnDClick sets callback when mouse button `mouseButton` is double-clicked.
func (*EventHandler) OnDeactivate ¶
func (eh *EventHandler) OnDeactivate(cb func()) *EventHandler
OnDeactivate sets callback when item gets deactivated.
func (*EventHandler) OnHover ¶
func (eh *EventHandler) OnHover(onHover func()) *EventHandler
OnHover sets callback when item gets hovered.
func (*EventHandler) OnKeyDown ¶
func (eh *EventHandler) OnKeyDown(key Key, cb func()) *EventHandler
OnKeyDown sets callback when key `key` is down.
func (*EventHandler) OnKeyPressed ¶
func (eh *EventHandler) OnKeyPressed(key Key, cb func()) *EventHandler
OnKeyPressed sets callback when key `key` is pressed.
func (*EventHandler) OnKeyReleased ¶
func (eh *EventHandler) OnKeyReleased(key Key, cb func()) *EventHandler
OnKeyReleased sets callback when key `key` is released.
func (*EventHandler) OnMouseDown ¶
func (eh *EventHandler) OnMouseDown(mouseButton MouseButton, callback func()) *EventHandler
OnMouseDown sets callback when mouse button `mouseButton` is down.
func (*EventHandler) OnMouseReleased ¶
func (eh *EventHandler) OnMouseReleased(mouseButton MouseButton, callback func()) *EventHandler
OnMouseReleased sets callback when mouse button `mouseButton` is released.
type ExecCondition ¶
type ExecCondition imgui.Condition
ExecCondition represents imgui.Condition.
const ( ConditionAlways ExecCondition = ExecCondition(imgui.ConditionAlways) ConditionOnce ExecCondition = ExecCondition(imgui.ConditionOnce) ConditionFirstUseEver ExecCondition = ExecCondition(imgui.ConditionFirstUseEver) ConditionAppearing ExecCondition = ExecCondition(imgui.ConditionAppearing) )
imgui conditions.
type FontInfo ¶
type FontInfo struct {
// contains filtered or unexported fields
}
FontInfo represents a giu implementation of imgui font.
func AddFont ¶
AddFont adds font by name, if the font is found, return *FontInfo, otherwise return nil. To use added font, use giu.Style().SetFont(...).
func AddFontFromBytes ¶
AddFontFromBytes does similar to AddFont, but using data from memory.
func GetDefaultFonts ¶
func GetDefaultFonts() []FontInfo
type HSplitterWidget ¶
type HSplitterWidget struct {
// contains filtered or unexported fields
}
func HSplitter ¶
func HSplitter(delta *float32) *HSplitterWidget
func (*HSplitterWidget) Build ¶
func (h *HSplitterWidget) Build()
Build implements Widget interface nolint:dupl // will fix later
func (*HSplitterWidget) ID ¶
func (h *HSplitterWidget) ID(id string) *HSplitterWidget
func (*HSplitterWidget) Size ¶
func (h *HSplitterWidget) Size(width, height float32) *HSplitterWidget
type HoveredFlags ¶
type HoveredFlags int
HoveredFlags represents a hovered flags.
const ( // HoveredFlagsNone Return true if directly over the item/window, not obstructed by another window, // not obstructed by an active popup or modal blocking inputs under them. HoveredFlagsNone HoveredFlags = imgui.HoveredFlagsNone // HoveredFlagsChildWindows IsWindowHovered() only: Return true if any children of the window is hovered. HoveredFlagsChildWindows HoveredFlags = imgui.HoveredFlagsChildWindows // HoveredFlagsRootWindow IsWindowHovered() only: Test from root window (top most parent of the current hierarchy). HoveredFlagsRootWindow HoveredFlags = imgui.HoveredFlagsRootWindow // HoveredFlagsAnyWindow IsWindowHovered() only: Return true if any window is hovered. HoveredFlagsAnyWindow HoveredFlags = imgui.HoveredFlagsAnyWindow // HoveredFlagsAllowWhenBlockedByPopup Return true even if a popup window is normally blocking access to this item/window. HoveredFlagsAllowWhenBlockedByPopup HoveredFlags = imgui.HoveredFlagsAllowWhenBlockedByPopup // HoveredFlagsAllowWhenBlockedByActiveItem Return true even if an active item is blocking access to this item/window. // Useful for Drag and Drop patterns. HoveredFlagsAllowWhenBlockedByActiveItem HoveredFlags = imgui.HoveredFlagsAllowWhenBlockedByActiveItem // HoveredFlagsAllowWhenOverlapped Return true even if the position is overlapped by another window. HoveredFlagsAllowWhenOverlapped HoveredFlags = imgui.HoveredFlagsAllowWhenOverlapped // HoveredFlagsAllowWhenDisabled Return true even if the item is disabled. HoveredFlagsAllowWhenDisabled HoveredFlags = imgui.HoveredFlagsAllowWhenDisabled )
hovered flags list.
type ImPlotYAxis ¶
type ImPlotYAxis int
ImPlotYAxis represents y axis settings.
const ( ImPlotYAxisLeft ImPlotYAxis = 0 // left (default) ImPlotYAxisFirstOnRight ImPlotYAxis = 1 // first on right side ImPlotYAxisSecondOnRight ImPlotYAxis = 2 // second on right side )
ImPlotYAxis enum:.
type ImageButtonWidget ¶
type ImageButtonWidget struct {
// contains filtered or unexported fields
}
ImageButtonWidget is similar to ButtonWidget but with image texture instead of text label.
func ImageButton ¶
func ImageButton(texture *Texture) *ImageButtonWidget
ImageButton constructs image buton widget.
func (*ImageButtonWidget) BgColor ¶
func (b *ImageButtonWidget) BgColor(bgColor color.Color) *ImageButtonWidget
BgColor sets button's background color.
func (*ImageButtonWidget) Build ¶
func (b *ImageButtonWidget) Build()
Build implements Widget interface.
func (*ImageButtonWidget) FramePadding ¶
func (b *ImageButtonWidget) FramePadding(padding int) *ImageButtonWidget
FramePadding sets button's frame padding (set 0 to fit image to the frame).
func (*ImageButtonWidget) OnClick ¶
func (b *ImageButtonWidget) OnClick(onClick func()) *ImageButtonWidget
OnClick sets click event.
func (*ImageButtonWidget) Size ¶
func (b *ImageButtonWidget) Size(width, height float32) *ImageButtonWidget
Size sets BUTTONS size. NOTE: image size is button size - 2 * frame padding.
func (*ImageButtonWidget) TintColor ¶
func (b *ImageButtonWidget) TintColor(tintColor color.Color) *ImageButtonWidget
TintColor sets tit color for image.
func (*ImageButtonWidget) UV ¶
func (b *ImageButtonWidget) UV(uv0, uv1 image.Point) *ImageButtonWidget
UV sets image's uv.
type ImageButtonWithRgbaWidget ¶
type ImageButtonWithRgbaWidget struct { *ImageButtonWidget // contains filtered or unexported fields }
ImageButtonWithRgbaWidget does similar to ImageButtonWIdget, but implements image.Image instead of giu.Texture. It is probably more useful than the original ImageButtonWIdget.
func ImageButtonWithRgba ¶
func ImageButtonWithRgba(rgba image.Image) *ImageButtonWithRgbaWidget
ImageButtonWithRgba creates a new widget.
func (*ImageButtonWithRgbaWidget) BgColor ¶
func (b *ImageButtonWithRgbaWidget) BgColor(bgColor color.Color) *ImageButtonWithRgbaWidget
BgColor sets button's background color.
func (*ImageButtonWithRgbaWidget) Build ¶
func (b *ImageButtonWithRgbaWidget) Build()
Build implements Widget interface.
func (*ImageButtonWithRgbaWidget) FramePadding ¶
func (b *ImageButtonWithRgbaWidget) FramePadding(padding int) *ImageButtonWithRgbaWidget
FramePadding sets frame padding (see (*ImageButtonWidget).TintColor).
func (*ImageButtonWithRgbaWidget) OnClick ¶
func (b *ImageButtonWithRgbaWidget) OnClick(onClick func()) *ImageButtonWithRgbaWidget
OnClick sets click events.
func (*ImageButtonWithRgbaWidget) Size ¶
func (b *ImageButtonWithRgbaWidget) Size(width, height float32) *ImageButtonWithRgbaWidget
Size sets button's size.
func (*ImageButtonWithRgbaWidget) TintColor ¶
func (b *ImageButtonWithRgbaWidget) TintColor(tintColor color.Color) *ImageButtonWithRgbaWidget
TintColor sets image's tint color.
func (*ImageButtonWithRgbaWidget) UV ¶
func (b *ImageButtonWithRgbaWidget) UV(uv0, uv1 image.Point) *ImageButtonWithRgbaWidget
UV sets image's uv color.
type ImageWidget ¶
type ImageWidget struct {
// contains filtered or unexported fields
}
ImageWidget adds an image. NOTE: ImageWidget is going to be deprecated. ImageWithRGBAWidget should be used instead, however, because it is a native imgui's solution it is still there.
func (*ImageWidget) BorderCol ¶
func (i *ImageWidget) BorderCol(borderColor color.Color) *ImageWidget
BorderCol sets color of the border.
func (*ImageWidget) OnClick ¶
func (i *ImageWidget) OnClick(cb func()) *ImageWidget
OnClick adds on-click-callback.
func (*ImageWidget) Size ¶
func (i *ImageWidget) Size(width, height float32) *ImageWidget
Size sets image size.
func (*ImageWidget) TintColor ¶
func (i *ImageWidget) TintColor(tintColor color.Color) *ImageWidget
TintColor sets image's tint color.
func (*ImageWidget) Uv ¶
func (i *ImageWidget) Uv(uv0, uv1 image.Point) *ImageWidget
Uv allows to specify uv parameters.
type ImageWithFileWidget ¶
type ImageWithFileWidget struct {
// contains filtered or unexported fields
}
ImageWithFileWidget allows to display an image directly from .png file. NOTE: Be aware that project using this solution may not be portable because files are not included in executable binaries! You may want to use "embed" package and ImageWithRgba instead.
func ImageWithFile ¶
func ImageWithFile(imgPath string) *ImageWithFileWidget
ImageWithFile constructs a new ImageWithFileWidget.
func (*ImageWithFileWidget) Build ¶
func (i *ImageWithFileWidget) Build()
Build implements Widget interface.
func (*ImageWithFileWidget) OnClick ¶
func (i *ImageWithFileWidget) OnClick(cb func()) *ImageWithFileWidget
OnClick sets click callback.
func (*ImageWithFileWidget) Size ¶
func (i *ImageWithFileWidget) Size(width, height float32) *ImageWithFileWidget
Size sets image's size.
type ImageWithRgbaWidget ¶
type ImageWithRgbaWidget struct {
// contains filtered or unexported fields
}
ImageWithRgbaWidget wrapps ImageWidget. It is more useful because it doesn't make you to care about imgui textures. You can just pass golang-native image.Image and display it in giu.
func ImageWithRgba ¶
func ImageWithRgba(rgba image.Image) *ImageWithRgbaWidget
ImageWithRgba creates ImageWithRgbaWidget.
func (*ImageWithRgbaWidget) Build ¶
func (i *ImageWithRgbaWidget) Build()
Build implements Widget interface.
func (*ImageWithRgbaWidget) OnClick ¶
func (i *ImageWithRgbaWidget) OnClick(cb func()) *ImageWithRgbaWidget
OnClick sets click callback.
func (*ImageWithRgbaWidget) Size ¶
func (i *ImageWithRgbaWidget) Size(width, height float32) *ImageWithRgbaWidget
Size sets image's size.
type ImageWithURLWidget ¶
type ImageWithURLWidget struct {
// contains filtered or unexported fields
}
ImageWithURLWidget allows to display an image using an URL as image source.
func ImageWithURL ¶
func ImageWithURL(url string) *ImageWithURLWidget
ImageWithURL creates ImageWithURLWidget.
func (*ImageWithURLWidget) Build ¶
func (i *ImageWithURLWidget) Build()
Build implements Widget interface.
func (*ImageWithURLWidget) LayoutForFailure ¶
func (i *ImageWithURLWidget) LayoutForFailure(widgets ...Widget) *ImageWithURLWidget
LayoutForFailure allows to specify layout when image failed to download.
func (*ImageWithURLWidget) LayoutForLoading ¶
func (i *ImageWithURLWidget) LayoutForLoading(widgets ...Widget) *ImageWithURLWidget
LayoutForLoading allows to set layout rendered while loading an image.
func (*ImageWithURLWidget) OnClick ¶
func (i *ImageWithURLWidget) OnClick(cb func()) *ImageWithURLWidget
OnClick sets click callback.
func (*ImageWithURLWidget) OnFailure ¶
func (i *ImageWithURLWidget) OnFailure(onFailure func(error)) *ImageWithURLWidget
OnFailure sets event trigger when image failed to download/load.
func (*ImageWithURLWidget) OnReady ¶
func (i *ImageWithURLWidget) OnReady(onReady func()) *ImageWithURLWidget
OnReady sets event trigger when image is downloaded and ready to display.
func (*ImageWithURLWidget) Size ¶
func (i *ImageWithURLWidget) Size(width, height float32) *ImageWithURLWidget
Size sets image's size.
func (*ImageWithURLWidget) Timeout ¶
func (i *ImageWithURLWidget) Timeout(downloadTimeout time.Duration) *ImageWithURLWidget
Timeout sets download timeout.
type InputFloatWidget ¶
type InputFloatWidget struct {
// contains filtered or unexported fields
}
InputFloatWidget does similar to InputIntWIdget, but accepts float numbers.
func InputFloat ¶
func InputFloat(value *float32) *InputFloatWidget
InputFloat constructs InputFloatWidget.
func (*InputFloatWidget) Build ¶
func (i *InputFloatWidget) Build()
Build implements Widget interface.
func (*InputFloatWidget) Flags ¶
func (i *InputFloatWidget) Flags(flags InputTextFlags) *InputFloatWidget
Flags sets flags.
func (*InputFloatWidget) Format ¶
func (i *InputFloatWidget) Format(format string) *InputFloatWidget
Format sets data format (e.g. %.3f).
func (*InputFloatWidget) Label ¶
func (i *InputFloatWidget) Label(label string) *InputFloatWidget
Label sets label of input field.
func (*InputFloatWidget) Labelf ¶
func (i *InputFloatWidget) Labelf(format string, args ...any) *InputFloatWidget
Labelf sets formatted label.
func (*InputFloatWidget) OnChange ¶
func (i *InputFloatWidget) OnChange(onChange func()) *InputFloatWidget
OnChange sets callback called when text is changed.
func (*InputFloatWidget) Size ¶
func (i *InputFloatWidget) Size(width float32) *InputFloatWidget
Size sets input field's width.
type InputHandler ¶
type InputHandler interface { // RegisterKeyboardShortcuts adds a specified shortcuts into input handler RegisterKeyboardShortcuts(...Shortcut) // UnregisterKeyboardShortcuts removes iwndow shourtcuts from input handler UnregisterWindowShortcuts() // Handle handles a shortcut Handle(Key, Modifier, Action) }
InputHandler is an interface which needs to be implemented by user-definied input handlers.
type InputIntWidget ¶
type InputIntWidget struct {
// contains filtered or unexported fields
}
InputIntWidget is an input text field acceptiong intager values only.
func InputInt ¶
func InputInt(value *int32) *InputIntWidget
InputInt creates input int widget NOTE: value is int32, so its size is up to 10^32-1. to process greater values, you need to use InputTextWidget with InputTextFlagsCharsDecimal and strconv.ParseInt in OnChange callback.
func (*InputIntWidget) Flags ¶
func (i *InputIntWidget) Flags(flags InputTextFlags) *InputIntWidget
Flags sets flags.
func (*InputIntWidget) Label ¶
func (i *InputIntWidget) Label(label string) *InputIntWidget
Label sets label (id).
func (*InputIntWidget) Labelf ¶
func (i *InputIntWidget) Labelf(format string, args ...any) *InputIntWidget
Labelf sets formatted label.
func (*InputIntWidget) OnChange ¶
func (i *InputIntWidget) OnChange(onChange func()) *InputIntWidget
OnChange adds on change callback.
func (*InputIntWidget) Size ¶
func (i *InputIntWidget) Size(width float32) *InputIntWidget
Size sets input's width.
type InputTextFlags ¶
type InputTextFlags int
InputTextFlags represents input text flags.
const ( // InputTextFlagsNone sets everything default. InputTextFlagsNone InputTextFlags = imgui.InputTextFlagsNone // InputTextFlagsCharsDecimal allows 0123456789.+-. InputTextFlagsCharsDecimal InputTextFlags = imgui.InputTextFlagsCharsDecimal // InputTextFlagsCharsHexadecimal allow 0123456789ABCDEFabcdef. InputTextFlagsCharsHexadecimal InputTextFlags = imgui.InputTextFlagsCharsHexadecimal // InputTextFlagsCharsUppercase turns a..z into A..Z. InputTextFlagsCharsUppercase InputTextFlags = imgui.InputTextFlagsCharsUppercase // InputTextFlagsCharsNoBlank filters out spaces, tabs. InputTextFlagsCharsNoBlank InputTextFlags = imgui.InputTextFlagsCharsNoBlank // InputTextFlagsAutoSelectAll selects entire text when first taking mouse focus. InputTextFlagsAutoSelectAll InputTextFlags = imgui.InputTextFlagsAutoSelectAll // InputTextFlagsEnterReturnsTrue returns 'true' when Enter is pressed (as opposed to when the value was modified). InputTextFlagsEnterReturnsTrue InputTextFlags = imgui.InputTextFlagsEnterReturnsTrue // InputTextFlagsCallbackCompletion for callback on pressing TAB (for completion handling). InputTextFlagsCallbackCompletion InputTextFlags = imgui.InputTextFlagsCallbackCompletion // InputTextFlagsCallbackHistory for callback on pressing Up/Down arrows (for history handling). InputTextFlagsCallbackHistory InputTextFlags = imgui.InputTextFlagsCallbackHistory // InputTextFlagsCallbackAlways for callback on each iteration. User code may query cursor position, modify text buffer. InputTextFlagsCallbackAlways InputTextFlags = imgui.InputTextFlagsCallbackAlways // InputTextFlagsCallbackCharFilter for callback on character inputs to replace or discard them. // Modify 'EventChar' to replace or discard, or return 1 in callback to discard. InputTextFlagsCallbackCharFilter InputTextFlags = imgui.InputTextFlagsCallbackCharFilter // InputTextFlagsAllowTabInput when pressing TAB to input a '\t' character into the text field. InputTextFlagsAllowTabInput InputTextFlags = imgui.InputTextFlagsAllowTabInput // InputTextFlagsCtrlEnterForNewLine in multi-line mode, unfocus with Enter, add new line with Ctrl+Enter // (default is opposite: unfocus with Ctrl+Enter, add line with Enter). InputTextFlagsCtrlEnterForNewLine InputTextFlags = imgui.InputTextFlagsCtrlEnterForNewLine // InputTextFlagsNoHorizontalScroll disables following the cursor horizontally. InputTextFlagsNoHorizontalScroll InputTextFlags = imgui.InputTextFlagsNoHorizontalScroll // InputTextFlagsAlwaysInsertMode sets insert mode. InputTextFlagsAlwaysInsertMode InputTextFlags = imgui.InputTextFlagsAlwaysInsertMode // InputTextFlagsReadOnly sets read-only mode. InputTextFlagsReadOnly InputTextFlags = imgui.InputTextFlagsReadOnly // InputTextFlagsPassword sets password mode, display all characters as '*'. InputTextFlagsPassword InputTextFlags = imgui.InputTextFlagsPassword // InputTextFlagsNoUndoRedo disables undo/redo. Note that input text owns the text data while active, // if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID(). InputTextFlagsNoUndoRedo InputTextFlags = imgui.InputTextFlagsNoUndoRedo // InputTextFlagsCharsScientific allows 0123456789.+-*/eE (Scientific notation input). InputTextFlagsCharsScientific InputTextFlags = imgui.InputTextFlagsCharsScientific )
input text flags.
type InputTextMultilineWidget ¶
type InputTextMultilineWidget struct {
// contains filtered or unexported fields
}
InputTextMultilineWidget is a large (multiline) text input see examples/widgets/.
func InputTextMultiline ¶
func InputTextMultiline(text *string) *InputTextMultilineWidget
InputTextMultiline creates InputTextMultilineWidget.
func (*InputTextMultilineWidget) Build ¶
func (i *InputTextMultilineWidget) Build()
Build implements Widget interface.
func (*InputTextMultilineWidget) Callback ¶
func (i *InputTextMultilineWidget) Callback(cb imgui.InputTextCallback) *InputTextMultilineWidget
Callback sets imgui.InputTextCallback.
func (*InputTextMultilineWidget) Flags ¶
func (i *InputTextMultilineWidget) Flags(flags InputTextFlags) *InputTextMultilineWidget
Flags sets InputTextFlags (see Flags.go).
func (*InputTextMultilineWidget) Label ¶
func (i *InputTextMultilineWidget) Label(label string) *InputTextMultilineWidget
Label sets input field label.
func (*InputTextMultilineWidget) Labelf ¶
func (i *InputTextMultilineWidget) Labelf(format string, args ...any) *InputTextMultilineWidget
Labelf is formatting version of Label.
func (*InputTextMultilineWidget) OnChange ¶
func (i *InputTextMultilineWidget) OnChange(onChange func()) *InputTextMultilineWidget
OnChange set callback called when user action taken on input text field (when text was changed).
func (*InputTextMultilineWidget) Size ¶
func (i *InputTextMultilineWidget) Size(width, height float32) *InputTextMultilineWidget
Size sets input field size.
type InputTextWidget ¶
type InputTextWidget struct {
// contains filtered or unexported fields
}
InputTextWidget is a single-line text iinput.
func InputText ¶
func InputText(value *string) *InputTextWidget
InputText creates new input text widget.
func (*InputTextWidget) AutoComplete ¶
func (i *InputTextWidget) AutoComplete(candidates []string) *InputTextWidget
AutoComplete enables auto complete popup by using fuzzy search of current value against candidates Press enter to confirm the first candidate.
func (*InputTextWidget) Build ¶
func (i *InputTextWidget) Build()
Build implements Widget interface.
func (*InputTextWidget) Callback ¶
func (i *InputTextWidget) Callback(cb imgui.InputTextCallback) *InputTextWidget
Callback sets input text callback.
func (*InputTextWidget) Flags ¶
func (i *InputTextWidget) Flags(flags InputTextFlags) *InputTextWidget
Flags sets flags.
func (*InputTextWidget) Hint ¶
func (i *InputTextWidget) Hint(hint string) *InputTextWidget
Hint sets hint text.
func (*InputTextWidget) Label ¶
func (i *InputTextWidget) Label(label string) *InputTextWidget
Label adds label (alternatively you can use it to set widget's id).
func (*InputTextWidget) Labelf ¶
func (i *InputTextWidget) Labelf(format string, args ...any) *InputTextWidget
Labelf adds formatted label.
func (*InputTextWidget) OnChange ¶
func (i *InputTextWidget) OnChange(onChange func()) *InputTextWidget
OnChange sets callback when text was changed.
func (*InputTextWidget) Size ¶
func (i *InputTextWidget) Size(width float32) *InputTextWidget
Size sets field's width.
type InvisibleButtonWidget ¶
type InvisibleButtonWidget struct {
// contains filtered or unexported fields
}
InvisibleButtonWidget is a clickable region. NOTE: you may want to display other widgets on this button. to do so, you may move drawing cursor back by Get/SetCursor(Screen)Pos.
func InvisibleButton ¶
func InvisibleButton() *InvisibleButtonWidget
InvisibleButton constructs a new invisible button widget.
func (*InvisibleButtonWidget) Build ¶
func (b *InvisibleButtonWidget) Build()
Build implements Widget interface.
func (*InvisibleButtonWidget) ID ¶
func (b *InvisibleButtonWidget) ID(id string) *InvisibleButtonWidget
ID allows to manually set widget's id (no need to use in normal conditions).
func (*InvisibleButtonWidget) OnClick ¶
func (b *InvisibleButtonWidget) OnClick(onClick func()) *InvisibleButtonWidget
OnClick sets click event.
func (*InvisibleButtonWidget) Size ¶
func (b *InvisibleButtonWidget) Size(width, height float32) *InvisibleButtonWidget
Size sets button's size.
type Key ¶
Key represents a glfw key.
const ( KeyUnknown Key = Key(glfw.KeyUnknown) KeySpace Key = Key(glfw.KeySpace) KeyApostrophe Key = Key(glfw.KeyApostrophe) KeyComma Key = Key(glfw.KeyComma) KeyMinus Key = Key(glfw.KeyMinus) KeyPeriod Key = Key(glfw.KeyPeriod) KeySlash Key = Key(glfw.KeySlash) Key0 Key = Key(glfw.Key0) Key1 Key = Key(glfw.Key1) Key2 Key = Key(glfw.Key2) Key3 Key = Key(glfw.Key3) Key4 Key = Key(glfw.Key4) Key5 Key = Key(glfw.Key5) Key6 Key = Key(glfw.Key6) Key7 Key = Key(glfw.Key7) Key8 Key = Key(glfw.Key8) Key9 Key = Key(glfw.Key9) KeySemicolon Key = Key(glfw.KeySemicolon) KeyEqual Key = Key(glfw.KeyEqual) KeyA Key = Key(glfw.KeyA) KeyB Key = Key(glfw.KeyB) KeyC Key = Key(glfw.KeyC) KeyD Key = Key(glfw.KeyD) KeyE Key = Key(glfw.KeyE) KeyF Key = Key(glfw.KeyF) KeyG Key = Key(glfw.KeyG) KeyH Key = Key(glfw.KeyH) KeyI Key = Key(glfw.KeyI) KeyJ Key = Key(glfw.KeyJ) KeyK Key = Key(glfw.KeyK) KeyL Key = Key(glfw.KeyL) KeyM Key = Key(glfw.KeyM) KeyN Key = Key(glfw.KeyN) KeyO Key = Key(glfw.KeyO) KeyP Key = Key(glfw.KeyP) KeyQ Key = Key(glfw.KeyQ) KeyR Key = Key(glfw.KeyR) KeyS Key = Key(glfw.KeyS) KeyT Key = Key(glfw.KeyT) KeyU Key = Key(glfw.KeyU) KeyV Key = Key(glfw.KeyV) KeyW Key = Key(glfw.KeyW) KeyX Key = Key(glfw.KeyX) KeyY Key = Key(glfw.KeyY) KeyZ Key = Key(glfw.KeyZ) KeyLeftBracket Key = Key(glfw.KeyLeftBracket) KeyBackslash Key = Key(glfw.KeyBackslash) KeyRightBracket Key = Key(glfw.KeyRightBracket) KeyGraveAccent Key = Key(glfw.KeyGraveAccent) KeyWorld1 Key = Key(glfw.KeyWorld1) KeyWorld2 Key = Key(glfw.KeyWorld2) KeyEscape Key = Key(glfw.KeyEscape) KeyEnter Key = Key(glfw.KeyEnter) KeyTab Key = Key(glfw.KeyTab) KeyBackspace Key = Key(glfw.KeyBackspace) KeyInsert Key = Key(glfw.KeyInsert) KeyDelete Key = Key(glfw.KeyDelete) KeyRight Key = Key(glfw.KeyRight) KeyLeft Key = Key(glfw.KeyLeft) KeyDown Key = Key(glfw.KeyDown) KeyUp Key = Key(glfw.KeyUp) KeyPageUp Key = Key(glfw.KeyPageUp) KeyPageDown Key = Key(glfw.KeyPageDown) KeyHome Key = Key(glfw.KeyHome) KeyEnd Key = Key(glfw.KeyEnd) KeyCapsLock Key = Key(glfw.KeyCapsLock) KeyScrollLock Key = Key(glfw.KeyScrollLock) KeyNumLock Key = Key(glfw.KeyNumLock) KeyPrintScreen Key = Key(glfw.KeyPrintScreen) KeyPause Key = Key(glfw.KeyPause) KeyF1 Key = Key(glfw.KeyF1) KeyF2 Key = Key(glfw.KeyF2) KeyF3 Key = Key(glfw.KeyF3) KeyF4 Key = Key(glfw.KeyF4) KeyF5 Key = Key(glfw.KeyF5) KeyF6 Key = Key(glfw.KeyF6) KeyF7 Key = Key(glfw.KeyF7) KeyF8 Key = Key(glfw.KeyF8) KeyF9 Key = Key(glfw.KeyF9) KeyF10 Key = Key(glfw.KeyF10) KeyF11 Key = Key(glfw.KeyF11) KeyF12 Key = Key(glfw.KeyF12) KeyF13 Key = Key(glfw.KeyF13) KeyF14 Key = Key(glfw.KeyF14) KeyF15 Key = Key(glfw.KeyF15) KeyF16 Key = Key(glfw.KeyF16) KeyF17 Key = Key(glfw.KeyF17) KeyF18 Key = Key(glfw.KeyF18) KeyF19 Key = Key(glfw.KeyF19) KeyF20 Key = Key(glfw.KeyF20) KeyF21 Key = Key(glfw.KeyF21) KeyF22 Key = Key(glfw.KeyF22) KeyF23 Key = Key(glfw.KeyF23) KeyF24 Key = Key(glfw.KeyF24) KeyF25 Key = Key(glfw.KeyF25) KeyKP0 Key = Key(glfw.KeyKP0) KeyKP1 Key = Key(glfw.KeyKP1) KeyKP2 Key = Key(glfw.KeyKP2) KeyKP3 Key = Key(glfw.KeyKP3) KeyKP4 Key = Key(glfw.KeyKP4) KeyKP5 Key = Key(glfw.KeyKP5) KeyKP6 Key = Key(glfw.KeyKP6) KeyKP7 Key = Key(glfw.KeyKP7) KeyKP8 Key = Key(glfw.KeyKP8) KeyKP9 Key = Key(glfw.KeyKP9) KeyKPDecimal Key = Key(glfw.KeyKPDecimal) KeyKPDivide Key = Key(glfw.KeyKPDivide) KeyKPMultiply Key = Key(glfw.KeyKPMultiply) KeyKPSubtract Key = Key(glfw.KeyKPSubtract) KeyKPAdd Key = Key(glfw.KeyKPAdd) KeyKPEnter Key = Key(glfw.KeyKPEnter) KeyKPEqual Key = Key(glfw.KeyKPEqual) KeyLeftShift Key = Key(glfw.KeyLeftShift) KeyLeftControl Key = Key(glfw.KeyLeftControl) KeyLeftAlt Key = Key(glfw.KeyLeftAlt) KeyLeftSuper Key = Key(glfw.KeyLeftSuper) KeyRightShift Key = Key(glfw.KeyRightShift) KeyRightControl Key = Key(glfw.KeyRightControl) KeyRightAlt Key = Key(glfw.KeyRightAlt) KeyRightSuper Key = Key(glfw.KeyRightSuper) KeyMenu Key = Key(glfw.KeyMenu) KeyLast Key = Key(glfw.KeyLast) )
These key codes are inspired by the USB HID Usage Tables v1.12 (p. 53-60), but re-arranged to map to 7-bit ASCII for printable keys (function keys are put in the 256+ range).
type LabelWidget ¶
type LabelWidget struct {
// contains filtered or unexported fields
}
LabelWidget is a plain text label.
func Labelf ¶
func Labelf(format string, args ...any) *LabelWidget
Labelf allows to add formatted label.
func (*LabelWidget) Font ¶
func (l *LabelWidget) Font(font *FontInfo) *LabelWidget
Font sets specific font (does like Style().SetFont).
func (*LabelWidget) Wrapped ¶
func (l *LabelWidget) Wrapped(wrapped bool) *LabelWidget
Wrapped determinates if label is frapped.
type LanguageDefinition ¶
type LanguageDefinition byte
LanguageDefinition represents code editor's language definition.
const ( LanguageDefinitionSQL LanguageDefinition = iota LanguageDefinitionCPP LanguageDefinitionLua LanguageDefinitionC )
language definitions:.
type Layout ¶
type Layout []Widget
Layout is a set of widgets. It implements Widget interface so Layout can be used as a widget.
func PrepareMsgbox ¶
func PrepareMsgbox() Layout
PrepareMsgbox should be invoked in function in the same layout level where you call g.Msgbox. BUG: calling this more than 1 time per frame causes unexpected merging msgboxes layouts (see https://github.com/zoomasochist/giu/issues/290)
func RangeBuilder ¶
RangeBuilder batch create widgets and render only which is visible.
type ListBoxState ¶
type ListBoxState struct {
// contains filtered or unexported fields
}
func (*ListBoxState) Dispose ¶
func (s *ListBoxState) Dispose()
type ListBoxWidget ¶
type ListBoxWidget struct {
// contains filtered or unexported fields
}
func ListBox ¶
func ListBox(id string, items []string) *ListBoxWidget
func (*ListBoxWidget) Border ¶
func (l *ListBoxWidget) Border(b bool) *ListBoxWidget
func (*ListBoxWidget) Build ¶
func (l *ListBoxWidget) Build()
Build implements Widget interface nolint:gocognit // will fix later
func (*ListBoxWidget) ContextMenu ¶
func (l *ListBoxWidget) ContextMenu(menuItems []string) *ListBoxWidget
func (*ListBoxWidget) OnChange ¶
func (l *ListBoxWidget) OnChange(onChange func(selectedIndex int)) *ListBoxWidget
func (*ListBoxWidget) OnDClick ¶
func (l *ListBoxWidget) OnDClick(onDClick func(selectedIndex int)) *ListBoxWidget
func (*ListBoxWidget) OnMenu ¶
func (l *ListBoxWidget) OnMenu(onMenu func(selectedIndex int, menu string)) *ListBoxWidget
func (*ListBoxWidget) Size ¶
func (l *ListBoxWidget) Size(width, height float32) *ListBoxWidget
type ListClipperWrapper ¶
type ListClipperWrapper struct {
// contains filtered or unexported fields
}
ListClipperWrapper is a ImGuiListClipper implementation. it can be used to diplay a large, vertical list of items and avoid rendering them.
func (*ListClipperWrapper) Build ¶
func (l *ListClipperWrapper) Build()
Build implements widget interface.
func (*ListClipperWrapper) Layout ¶
func (l *ListClipperWrapper) Layout(layout ...Widget) *ListClipperWrapper
Layout sets layout for list clipper.
type MainMenuBarWidget ¶
type MainMenuBarWidget struct {
// contains filtered or unexported fields
}
func MainMenuBar ¶
func MainMenuBar() *MainMenuBarWidget
func (*MainMenuBarWidget) Build ¶
func (m *MainMenuBarWidget) Build()
Build implements Widget interface.
func (*MainMenuBarWidget) Layout ¶
func (m *MainMenuBarWidget) Layout(widgets ...Widget) *MainMenuBarWidget
type MarkdownWidget ¶
type MarkdownWidget struct {
// contains filtered or unexported fields
}
MarkdownWidget implements DearImGui markdown extension https://github.com/juliettef/imgui_markdown It is like LabelWidget but with md formatting.
func (*MarkdownWidget) Header ¶
func (m *MarkdownWidget) Header(level int, font *FontInfo, separator bool) *MarkdownWidget
Header sets header formatting NOTE: level (counting from 0!) is header level. (for instance, header `# H1` will have level 0).
func (*MarkdownWidget) OnLink ¶
func (m *MarkdownWidget) OnLink(cb func(url string)) *MarkdownWidget
OnLink sets another than default link callback.
type MasterWindow ¶
type MasterWindow struct {
// contains filtered or unexported fields
}
MasterWindow represents a glfw master window It is a base for a windows (see Window.go).
func NewMasterWindow ¶
func NewMasterWindow(title string, width, height int, flags MasterWindowFlags) *MasterWindow
NewMasterWindow creates a new master window and initializes GLFW. it should be called in main function. For more details and use cases, see examples/helloworld/.
func (*MasterWindow) Close ¶
func (w *MasterWindow) Close()
Close will savely close the master window.
func (*MasterWindow) GetPos ¶
func (w *MasterWindow) GetPos() (x, y int)
GetPos return position of master window.
func (*MasterWindow) GetSize ¶
func (w *MasterWindow) GetSize() (width, height int)
GetSize return size of master window.
func (*MasterWindow) RegisterKeyboardShortcuts ¶
func (w *MasterWindow) RegisterKeyboardShortcuts(s ...WindowShortcut) *MasterWindow
RegisterKeyboardShortcuts registers a global - master window - keyboard shortcuts.
func (*MasterWindow) Run ¶
func (w *MasterWindow) Run(loopFunc func())
Run runs the main loop. loopFunc will be used to construct the ui. Run should be called at the end of main function, after setting up the master window.
func (*MasterWindow) SetAdditionalInputHandlerCallback ¶
func (w *MasterWindow) SetAdditionalInputHandlerCallback(cb InputHandlerHandleCallback)
SetAdditionalInputHandlerCallback allows to set an input callback to handle more events (not only these from giu.inputHandler). See examples/issue-501.
func (*MasterWindow) SetBgColor ¶
func (w *MasterWindow) SetBgColor(bgColor color.Color)
SetBgColor sets background color of master window.
func (*MasterWindow) SetCloseCallback ¶
func (w *MasterWindow) SetCloseCallback(cb func() bool)
SetCloseCallback sets the close callback of the window, which is called when the user attempts to close the window, for example by clicking the close widget in the title bar.
The close flag is set before this callback is called, but you can modify it at any time with returned value of callback function.
Mac OS X: Selecting Quit from the application menu will trigger the close callback for all windows.
func (*MasterWindow) SetDropCallback ¶
func (w *MasterWindow) SetDropCallback(cb func([]string))
SetDropCallback sets callback when file was droppend into the window.
func (*MasterWindow) SetIcon ¶
func (w *MasterWindow) SetIcon(icons []image.Image)
SetIcon sets the icon of the specified window. If passed an array of candidate images, those of or closest to the sizes desired by the system are selected. If no images are specified, the window reverts to its default icon.
The image is ideally provided in the form of *image.NRGBA. The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits per channel with the red channel first. They are arranged canonically as packed sequential rows, starting from the top-left corner. If the image type is not *image.NRGBA, it will be converted to it.
The desired image sizes varies depending on platform and system settings. The selected images will be rescaled as needed. Good sizes include 16x16, 32x32 and 48x48.
func (*MasterWindow) SetInputHandler ¶
func (w *MasterWindow) SetInputHandler(handler InputHandler)
SetInputHandler allows to change default input handler. see InputHandler.go.
func (*MasterWindow) SetPos ¶
func (w *MasterWindow) SetPos(x, y int)
SetPos sets position of master window.
func (*MasterWindow) SetShouldClose ¶
func (w *MasterWindow) SetShouldClose(v bool)
SetShouldClose sets whether master window should be closed.
func (*MasterWindow) SetSize ¶
func (w *MasterWindow) SetSize(x, y int)
SetSize sets size of master window.
func (*MasterWindow) SetSizeLimits ¶
func (w *MasterWindow) SetSizeLimits(minw, minh, maxw, maxh int)
SetSizeLimits sets the size limits of the client area of the specified window. If the window is full screen or not resizable, this function does nothing.
The size limits are applied immediately and may cause the window to be resized. To specify only a minimum size or only a maximum one, set the other pair to giu.DontCare. To disable size limits for a window, set them all to giu.DontCare.
func (*MasterWindow) SetTitle ¶
func (w *MasterWindow) SetTitle(title string)
SetTitle updates master window's title.
type MasterWindowFlags ¶
type MasterWindowFlags imgui.GLFWWindowFlags
MasterWindowFlags wrapps imgui.GLFWWindowFlags.
const ( // Specifies the window will be fixed size. MasterWindowFlagsNotResizable MasterWindowFlags = MasterWindowFlags(imgui.GLFWWindowFlagsNotResizable) // Specifies whether the window is maximized. MasterWindowFlagsMaximized MasterWindowFlags = MasterWindowFlags(imgui.GLFWWindowFlagsMaximized) // Specifies whether the window will be always-on-top. MasterWindowFlagsFloating MasterWindowFlags = MasterWindowFlags(imgui.GLFWWindowFlagsFloating) // Specifies whether the window will be frameless. MasterWindowFlagsFrameless MasterWindowFlags = MasterWindowFlags(imgui.GLFWWindowFlagsFrameless) // Specifies whether the window will be transparent. MasterWindowFlagsTransparent MasterWindowFlags = MasterWindowFlags(imgui.GLFWWindowFlagsTransparent) )
master window flags.
type MemoryEditorWidget ¶
type MemoryEditorWidget struct {
// contains filtered or unexported fields
}
MemoryEditorWidget - Mini memory editor for Dear ImGui (to embed in your game/tools)
Right-click anywhere to access the Options menu! You can adjust the keyboard repeat delay/rate in ImGuiIO. The code assume a mono-space font for simplicity! If you don't use the default font, use ImGui::PushFont()/PopFont() to switch to a mono-space font before calling this.
func MemoryEditor ¶
func MemoryEditor() *MemoryEditorWidget
MemoryEditor creates nwe memory editor widget.
func (*MemoryEditorWidget) Build ¶
func (me *MemoryEditorWidget) Build()
Build implements widget inetrface.
func (*MemoryEditorWidget) Contents ¶
func (me *MemoryEditorWidget) Contents(contents []byte) *MemoryEditorWidget
Contents sets editor's conents.
type MenuBarWidget ¶
type MenuBarWidget struct {
// contains filtered or unexported fields
}
func MenuBar ¶
func MenuBar() *MenuBarWidget
func (*MenuBarWidget) Layout ¶
func (m *MenuBarWidget) Layout(widgets ...Widget) *MenuBarWidget
type MenuItemWidget ¶
type MenuItemWidget struct {
// contains filtered or unexported fields
}
func MenuItem ¶
func MenuItem(label string) *MenuItemWidget
func MenuItemf ¶
func MenuItemf(format string, args ...any) *MenuItemWidget
func (*MenuItemWidget) Enabled ¶
func (m *MenuItemWidget) Enabled(e bool) *MenuItemWidget
func (*MenuItemWidget) OnClick ¶
func (m *MenuItemWidget) OnClick(onClick func()) *MenuItemWidget
func (*MenuItemWidget) Selected ¶
func (m *MenuItemWidget) Selected(s bool) *MenuItemWidget
type MenuWidget ¶
type MenuWidget struct {
// contains filtered or unexported fields
}
func Menu ¶
func Menu(label string) *MenuWidget
func Menuf ¶
func Menuf(format string, args ...any) *MenuWidget
func (*MenuWidget) Enabled ¶
func (m *MenuWidget) Enabled(e bool) *MenuWidget
func (*MenuWidget) Layout ¶
func (m *MenuWidget) Layout(widgets ...Widget) *MenuWidget
type Modifier ¶
type Modifier glfw.ModifierKey
Modifier represents glfw.Modifier.
const ( ModNone Modifier = iota ModControl Modifier = Modifier(glfw.ModControl) ModAlt Modifier = Modifier(glfw.ModAlt) ModSuper Modifier = Modifier(glfw.ModSuper) ModShift Modifier = Modifier(glfw.ModShift) ModCapsLock Modifier = Modifier(glfw.ModCapsLock) ModNumLock Modifier = Modifier(glfw.ModNumLock) )
modifier keys.
type MouseButton ¶
type MouseButton int
MouseButton represents imgui.MoseButton.
const ( MouseButtonLeft MouseButton = 0 MouseButtonRight MouseButton = 1 MouseButtonMiddle MouseButton = 2 )
mouse buttons.
type MouseCursorType ¶
type MouseCursorType int
MouseCursorType represents a type (layout) of mouse cursor.
const ( // MouseCursorNone no mouse cursor. MouseCursorNone MouseCursorType = -1 // MouseCursorArrow standard arrow mouse cursor. MouseCursorArrow MouseCursorType = 0 // MouseCursorTextInput when hovering over InputText, etc. MouseCursorTextInput MouseCursorType = 1 // MouseCursorResizeAll (Unused by imgui functions). MouseCursorResizeAll MouseCursorType = 2 // MouseCursorResizeNS when hovering over an horizontal border. MouseCursorResizeNS MouseCursorType = 3 // MouseCursorResizeEW when hovering over a vertical border or a column. MouseCursorResizeEW MouseCursorType = 4 // MouseCursorResizeNESW when hovering over the bottom-left corner of a window. MouseCursorResizeNESW MouseCursorType = 5 // MouseCursorResizeNWSE when hovering over the bottom-right corner of a window. MouseCursorResizeNWSE MouseCursorType = 6 // MouseCursorHand (Unused by imgui functions. Use for e.g. hyperlinks). MouseCursorHand MouseCursorType = 7 MouseCursorCount MouseCursorType = 8 )
cursor types.
type MsgboxButtons ¶
type MsgboxButtons uint8
MsgboxButtons determines which buttons are in the dialog.
const ( // Yes-No question. MsgboxButtonsYesNo MsgboxButtons = 1 << iota // Ok / Cancel dialog. MsgboxButtonsOkCancel // info. MsgboxButtonsOk )
button sets.
type MsgboxWidget ¶
type MsgboxWidget struct{}
MsgboxWidget represents message dialog.
func Msgbox ¶
func Msgbox(title, content string) *MsgboxWidget
Msgbox opens message box. call it whenever you want to open popup with question / info.
func (*MsgboxWidget) Buttons ¶
func (m *MsgboxWidget) Buttons(buttons MsgboxButtons) *MsgboxWidget
Buttons sets which buttons should be possible.
func (*MsgboxWidget) ResultCallback ¶
func (m *MsgboxWidget) ResultCallback(cb DialogResultCallback) *MsgboxWidget
ResultCallback sets result callback.
type PlotAxisFlags ¶
type PlotAxisFlags int
PlotAxisFlags represents imgui.ImPlotAxisFlags.
const ( PlotAxisFlagsNone PlotAxisFlags = PlotAxisFlags(imgui.ImPlotAxisFlags_None) PlotAxisFlagsNoLabel PlotAxisFlags = PlotAxisFlags(imgui.ImPlotAxisFlags_NoLabel) PlotAxisFlagsNoGridLines PlotAxisFlags = PlotAxisFlags(imgui.ImPlotAxisFlags_NoGridLines) PlotAxisFlagsNoTickMarks PlotAxisFlags = PlotAxisFlags(imgui.ImPlotAxisFlags_NoTickMarks) PlotAxisFlagsNoTickLabels PlotAxisFlags = PlotAxisFlags(imgui.ImPlotAxisFlags_NoTickLabels) PlotAxisFlagsForeground PlotAxisFlags = PlotAxisFlags(imgui.ImPlotAxisFlags_Foreground) PlotAxisFlagsLogScale PlotAxisFlags = PlotAxisFlags(imgui.ImPlotAxisFlags_LogScale) PlotAxisFlagsTime PlotAxisFlags = PlotAxisFlags(imgui.ImPlotAxisFlags_Time) PlotAxisFlagsInvert PlotAxisFlags = PlotAxisFlags(imgui.ImPlotAxisFlags_Invert) PlotAxisFlagsNoInitialFit PlotAxisFlags = PlotAxisFlags(imgui.ImPlotAxisFlags_NoInitialFit) PlotAxisFlagsAutoFit PlotAxisFlags = PlotAxisFlags(imgui.ImPlotAxisFlags_AutoFit) PlotAxisFlagsRangeFit PlotAxisFlags = PlotAxisFlags(imgui.ImPlotAxisFlags_RangeFit) PlotAxisFlagsLockMin PlotAxisFlags = PlotAxisFlags(imgui.ImPlotAxisFlags_LockMin) PlotAxisFlagsLockMax PlotAxisFlags = PlotAxisFlags(imgui.ImPlotAxisFlags_LockMax) PlotAxisFlagsLock PlotAxisFlags = PlotAxisFlags(imgui.ImPlotAxisFlags_Lock) PlotAxisFlagsNoDecorations PlotAxisFlags = PlotAxisFlags(imgui.ImPlotAxisFlags_NoDecorations) )
plot axis flags.
type PlotBarHWidget ¶
type PlotBarHWidget struct {
// contains filtered or unexported fields
}
PlotBarHWidget represents a column chart on Y axis.
func PlotBarH ¶
func PlotBarH(title string, data []float64) *PlotBarHWidget
PlotBarH adds plot bars on y axis.
func (*PlotBarHWidget) Height ¶
func (p *PlotBarHWidget) Height(height float64) *PlotBarHWidget
Height sets bar height (in fact bars' width).
func (*PlotBarHWidget) Offset ¶
func (p *PlotBarHWidget) Offset(offset int) *PlotBarHWidget
Offset sets offset.
func (*PlotBarHWidget) Shift ¶
func (p *PlotBarHWidget) Shift(shift float64) *PlotBarHWidget
Shift sets shift.
type PlotBarWidget ¶
type PlotBarWidget struct {
// contains filtered or unexported fields
}
PlotBarWidget adds bar plot (column chart) to the canvas.
func PlotBar ¶
func PlotBar(title string, data []float64) *PlotBarWidget
PlotBar adds a plot bar (column chart).
func (*PlotBarWidget) Offset ¶
func (p *PlotBarWidget) Offset(offset int) *PlotBarWidget
Offset sets bar's offset.
func (*PlotBarWidget) Shift ¶
func (p *PlotBarWidget) Shift(shift float64) *PlotBarWidget
Shift sets shift of the bar.
func (*PlotBarWidget) Width ¶
func (p *PlotBarWidget) Width(width float64) *PlotBarWidget
Width sets bar width.
type PlotCanvasWidget ¶
type PlotCanvasWidget struct {
// contains filtered or unexported fields
}
PlotCanvasWidget represents a giu plot widget.
func (*PlotCanvasWidget) AxisLimits ¶
func (p *PlotCanvasWidget) AxisLimits(xmin, xmax, ymin, ymax float64, cond ExecCondition) *PlotCanvasWidget
AxisLimits sets X and Y axis limits.
func (*PlotCanvasWidget) Build ¶
func (p *PlotCanvasWidget) Build()
Build implements Widget interface.
func (*PlotCanvasWidget) Flags ¶
func (p *PlotCanvasWidget) Flags(flags PlotFlags) *PlotCanvasWidget
Flags sets plot canvas flags.
func (*PlotCanvasWidget) Plots ¶
func (p *PlotCanvasWidget) Plots(plots ...PlotWidget) *PlotCanvasWidget
Plots adds plots to plot canvas.
func (*PlotCanvasWidget) Size ¶
func (p *PlotCanvasWidget) Size(width, height int) *PlotCanvasWidget
Size set canvas size.
func (*PlotCanvasWidget) XAxeFlags ¶
func (p *PlotCanvasWidget) XAxeFlags(flags PlotAxisFlags) *PlotCanvasWidget
XAxeFlags sets x axis fags.
func (*PlotCanvasWidget) XTicks ¶
func (p *PlotCanvasWidget) XTicks(ticks []PlotTicker, showDefault bool) *PlotCanvasWidget
XTicks sets x axis ticks.
func (*PlotCanvasWidget) YAxeFlags ¶
func (p *PlotCanvasWidget) YAxeFlags(yFlags, y2Flags, y3Flags PlotAxisFlags) *PlotCanvasWidget
YAxeFlags sets y axis flags.
func (*PlotCanvasWidget) YTicks ¶
func (p *PlotCanvasWidget) YTicks(ticks []PlotTicker, showDefault bool, yAxis ImPlotYAxis) *PlotCanvasWidget
YTicks sets y axis ticks.
type PlotLineWidget ¶
type PlotLineWidget struct {
// contains filtered or unexported fields
}
PlotLineWidget represents a plot line (linear chart).
func PlotLine ¶
func PlotLine(title string, values []float64) *PlotLineWidget
PlotLine adds a new plot line to the canvas.
func (*PlotLineWidget) Offset ¶
func (p *PlotLineWidget) Offset(offset int) *PlotLineWidget
Offset sets chart offset.
func (*PlotLineWidget) SetPlotYAxis ¶
func (p *PlotLineWidget) SetPlotYAxis(yAxis ImPlotYAxis) *PlotLineWidget
SetPlotYAxis sets yAxis parameters.
func (*PlotLineWidget) X0 ¶
func (p *PlotLineWidget) X0(x0 float64) *PlotLineWidget
X0 sets a start position on x axis.
func (*PlotLineWidget) XScale ¶
func (p *PlotLineWidget) XScale(scale float64) *PlotLineWidget
XScale sets x-axis-scale.
type PlotLineXYWidget ¶
type PlotLineXYWidget struct {
// contains filtered or unexported fields
}
PlotLineXYWidget adds XY plot line.
func PlotLineXY ¶
func PlotLineXY(title string, xvalues, yvalues []float64) *PlotLineXYWidget
PlotLineXY adds XY plot line to canvas.
func (*PlotLineXYWidget) Offset ¶
func (p *PlotLineXYWidget) Offset(offset int) *PlotLineXYWidget
Offset sets chart's offset.
func (*PlotLineXYWidget) SetPlotYAxis ¶
func (p *PlotLineXYWidget) SetPlotYAxis(yAxis ImPlotYAxis) *PlotLineXYWidget
SetPlotYAxis sets yAxis parameters.
type PlotPieChartWidget ¶
type PlotPieChartWidget struct {
// contains filtered or unexported fields
}
PlotPieChartWidget represents a pie chart.
func PlotPieChart ¶
func PlotPieChart(labels []string, values []float64, x, y, radius float64) *PlotPieChartWidget
PlotPieChart adds pie chart to the canvas.
func (*PlotPieChartWidget) Angle0 ¶
func (p *PlotPieChartWidget) Angle0(a float64) *PlotPieChartWidget
func (*PlotPieChartWidget) LabelFormat ¶
func (p *PlotPieChartWidget) LabelFormat(fmtStr string) *PlotPieChartWidget
LabelFormat sets format of labels.
func (*PlotPieChartWidget) Normalize ¶
func (p *PlotPieChartWidget) Normalize(n bool) *PlotPieChartWidget
func (*PlotPieChartWidget) Plot ¶
func (p *PlotPieChartWidget) Plot()
type PlotScatterWidget ¶
type PlotScatterWidget struct {
// contains filtered or unexported fields
}
func PlotScatter ¶
func PlotScatter(label string, values []float64) *PlotScatterWidget
func (*PlotScatterWidget) Offset ¶
func (p *PlotScatterWidget) Offset(offset int) *PlotScatterWidget
func (*PlotScatterWidget) Plot ¶
func (p *PlotScatterWidget) Plot()
func (*PlotScatterWidget) X0 ¶
func (p *PlotScatterWidget) X0(x float64) *PlotScatterWidget
func (*PlotScatterWidget) XScale ¶
func (p *PlotScatterWidget) XScale(s float64) *PlotScatterWidget
type PlotScatterXYWidget ¶
type PlotScatterXYWidget struct {
// contains filtered or unexported fields
}
func PlotScatterXY ¶
func PlotScatterXY(label string, xs, ys []float64) *PlotScatterXYWidget
func (*PlotScatterXYWidget) Offset ¶
func (p *PlotScatterXYWidget) Offset(offset int) *PlotScatterXYWidget
func (*PlotScatterXYWidget) Plot ¶
func (p *PlotScatterXYWidget) Plot()
type PlotTicker ¶
PlotTicker represents axis ticks.
type PlotWidget ¶
type PlotWidget interface {
Plot()
}
PlotWidget is implemented by all the particular plots, which can be used in (*PlotCanvasWidget).Plots.
type PopupModalWidget ¶
type PopupModalWidget struct {
// contains filtered or unexported fields
}
PopupModalWidget is a popup window that block every interactions behind it, cannot be closed by user, adds a dimming background, has a title bar.
func PopupModal ¶
func PopupModal(name string) *PopupModalWidget
PopupModal creates new popup modal widget.
func (*PopupModalWidget) Build ¶
func (p *PopupModalWidget) Build()
Build implements Widget interface.
func (*PopupModalWidget) Flags ¶
func (p *PopupModalWidget) Flags(flags WindowFlags) *PopupModalWidget
Flags allows to specify popup's flags.
func (*PopupModalWidget) IsOpen ¶
func (p *PopupModalWidget) IsOpen(open *bool) *PopupModalWidget
IsOpen allows to control popup's state NOTE: changing opens' value will not result in changing popup's state if OpenPopup(...) wasn't called!
func (*PopupModalWidget) Layout ¶
func (p *PopupModalWidget) Layout(widgets ...Widget) *PopupModalWidget
Layout sets layout.
type PopupWidget ¶
type PopupWidget struct {
// contains filtered or unexported fields
}
PopupWidget is a window which appears next to the mouse cursor. For instance it is used to display color palette in ColorSelectWidget.
func (*PopupWidget) Flags ¶
func (p *PopupWidget) Flags(flags WindowFlags) *PopupWidget
Flags sets pupup's flags.
func (*PopupWidget) Layout ¶
func (p *PopupWidget) Layout(widgets ...Widget) *PopupWidget
Layout sets popup's layout.
type ProgressBarWidget ¶
type ProgressBarWidget struct {
// contains filtered or unexported fields
}
func ProgressBar ¶
func ProgressBar(fraction float32) *ProgressBarWidget
func (*ProgressBarWidget) Build ¶
func (p *ProgressBarWidget) Build()
Build implements Widget interface.
func (*ProgressBarWidget) Overlay ¶
func (p *ProgressBarWidget) Overlay(overlay string) *ProgressBarWidget
func (*ProgressBarWidget) Overlayf ¶
func (p *ProgressBarWidget) Overlayf(format string, args ...any) *ProgressBarWidget
func (*ProgressBarWidget) Size ¶
func (p *ProgressBarWidget) Size(width, height float32) *ProgressBarWidget
type ProgressIndicatorWidget ¶
type ProgressIndicatorWidget struct {
// contains filtered or unexported fields
}
ProgressIndicatorWidget represents progress indicator widget see examples/extrawidgets/.
func ProgressIndicator ¶
func ProgressIndicator(label string, width, height, radius float32) *ProgressIndicatorWidget
ProgressIndicator creates a new ProgressIndicatorWidget.
func (*ProgressIndicatorWidget) Build ¶
func (p *ProgressIndicatorWidget) Build()
Build implements Widget interface.
type RadioButtonWidget ¶
type RadioButtonWidget struct {
// contains filtered or unexported fields
}
RadioButtonWidget is a small, round button. It is common to use it for single-choice questions. see examples/widgets.
func RadioButton ¶
func RadioButton(text string, active bool) *RadioButtonWidget
RadioButton creates a radio buton.
func (*RadioButtonWidget) Build ¶
func (r *RadioButtonWidget) Build()
Build implements Widget interface.
func (*RadioButtonWidget) OnChange ¶
func (r *RadioButtonWidget) OnChange(onChange func()) *RadioButtonWidget
OnChange adds callback when button's state gets changed.
type RowWidget ¶
type RowWidget struct {
// contains filtered or unexported fields
}
RowWidget joins a layout into one line calls imgui.SameLine().
type SelectableFlags ¶
type SelectableFlags int
SelectableFlags represents imgui.SelectableFlags.
const ( // SelectableFlagsNone default = 0. SelectableFlagsNone SelectableFlags = imgui.SelectableFlagsNone // SelectableFlagsDontClosePopups makes clicking the selectable not close any parent popup windows. SelectableFlagsDontClosePopups SelectableFlags = imgui.SelectableFlagsDontClosePopups // SelectableFlagsSpanAllColumns allows the selectable frame to span all columns (text will still fit in current column). SelectableFlagsSpanAllColumns SelectableFlags = imgui.SelectableFlagsSpanAllColumns // SelectableFlagsAllowDoubleClick generates press events on double clicks too. SelectableFlagsAllowDoubleClick SelectableFlags = imgui.SelectableFlagsAllowDoubleClick // SelectableFlagsDisabled disallows selection and displays text in a greyed out color. SelectableFlagsDisabled SelectableFlags = imgui.SelectableFlagsDisabled )
selectable flags list.
type SelectableWidget ¶
type SelectableWidget struct {
// contains filtered or unexported fields
}
SelectableWidget is a window-width button with a label which can get selected (highlighted). useful for certain lists.
func Selectable ¶
func Selectable(label string) *SelectableWidget
Selectable constructs a selectable widget.
func Selectablef ¶
func Selectablef(format string, args ...any) *SelectableWidget
Selectablef creates a selectable widget with formated label.
func (*SelectableWidget) Build ¶
func (s *SelectableWidget) Build()
Build implements Widget interface.
func (*SelectableWidget) Flags ¶
func (s *SelectableWidget) Flags(flags SelectableFlags) *SelectableWidget
Flags add flags.
func (*SelectableWidget) OnClick ¶
func (s *SelectableWidget) OnClick(onClick func()) *SelectableWidget
OnClick sets on click event.
func (*SelectableWidget) OnDClick ¶
func (s *SelectableWidget) OnDClick(onDClick func()) *SelectableWidget
OnDClick handles mouse left button's double click event. SelectableFlagsAllowDoubleClick will set once tonDClick callback is notnull. NOTE: IT IS DEPRECATED and could be removed. Use EventHandler instead.
func (*SelectableWidget) Selected ¶
func (s *SelectableWidget) Selected(selected bool) *SelectableWidget
Selected sets if selectable widget is selected.
func (*SelectableWidget) Size ¶
func (s *SelectableWidget) Size(width, height float32) *SelectableWidget
Size sets selectable's size.
type SeparatorWidget ¶
type SeparatorWidget struct{}
func Separator ¶
func Separator() *SeparatorWidget
func (*SeparatorWidget) Build ¶
func (s *SeparatorWidget) Build()
Build implements Widget interface.
type Shortcut ¶
type Shortcut struct { Key Key Modifier Modifier Callback func() IsGlobal ShortcutType }
Shortcut represents a keyboard shortcut.
type ShortcutType ¶
type ShortcutType bool
ShortcutType represens a type of shortcut (global or local).
const ( // GlobalShortcut is registered for all the app. GlobalShortcut ShortcutType = true // LocalShortcut is registered for current window only. LocalShortcut ShortcutType = false )
type SliderFlags ¶
type SliderFlags int
SliderFlags represents imgui.SliderFlags TODO: Hard-reffer to these constants.
const ( SliderFlagsNone SliderFlags = 0 // Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds. SliderFlagsAlwaysClamp SliderFlags = 1 << 4 // Make the widget logarithmic (linear otherwise). Consider using ImGuiSliderFlagsNoRoundToFormat with this if using // a format-string with small amount of digits. SliderFlagsLogarithmic SliderFlags = 1 << 5 // Disable rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits). SliderFlagsNoRoundToFormat SliderFlags = 1 << 6 // Disable CTRL+Click or Enter key allowing to input text directly into the widget. SliderFlagsNoInput SliderFlags = 1 << 7 // [Internal] We treat using those bits as being potentially a 'float power' argument from the previous API that has got miscast // to this enum, and will trigger an assert if needed. SliderFlagsInvalidMask SliderFlags = 0x7000000F )
slider flags.
type SliderFloatWidget ¶
type SliderFloatWidget struct {
// contains filtered or unexported fields
}
SliderFloatWidget does similar to SliderIntWidget but slides around float32 values.
func SliderFloat ¶
func SliderFloat(value *float32, min, max float32) *SliderFloatWidget
SliderFloat creates new slider float widget.
func (*SliderFloatWidget) Build ¶
func (sf *SliderFloatWidget) Build()
Build implements Widget interface.
func (*SliderFloatWidget) Format ¶
func (sf *SliderFloatWidget) Format(format string) *SliderFloatWidget
Format sets format of text displayed on the slider. default is %.3f.
func (*SliderFloatWidget) Label ¶
func (sf *SliderFloatWidget) Label(label string) *SliderFloatWidget
Label sets slider's label (id).
func (*SliderFloatWidget) Labelf ¶
func (sf *SliderFloatWidget) Labelf(format string, args ...any) *SliderFloatWidget
Labelf sets formated label.
func (*SliderFloatWidget) OnChange ¶
func (sf *SliderFloatWidget) OnChange(onChange func()) *SliderFloatWidget
OnChange is callback called when slider's position gets changed.
func (*SliderFloatWidget) Size ¶
func (sf *SliderFloatWidget) Size(width float32) *SliderFloatWidget
Size sets slider's width.
type SliderIntWidget ¶
type SliderIntWidget struct {
// contains filtered or unexported fields
}
SliderIntWidget is a slider around int32 values.
func SliderInt ¶
func SliderInt(value *int32, min, max int32) *SliderIntWidget
SliderInt constructs new SliderIntWidget.
func (*SliderIntWidget) Build ¶
func (s *SliderIntWidget) Build()
Build implements Widget interface.
func (*SliderIntWidget) Format ¶
func (s *SliderIntWidget) Format(format string) *SliderIntWidget
Format sets data format displayed on the slider NOTE: on C side of imgui, it will be processed like: fmt.Sprintf(format, currentValue) so you can do e.g. SLiderInt(...).Format("My age is %d") and %d will be replaced with current value.
func (*SliderIntWidget) Label ¶
func (s *SliderIntWidget) Label(label string) *SliderIntWidget
Label sets slider label (id).
func (*SliderIntWidget) Labelf ¶
func (s *SliderIntWidget) Labelf(format string, args ...any) *SliderIntWidget
Labelf sets formated label.
func (*SliderIntWidget) OnChange ¶
func (s *SliderIntWidget) OnChange(onChange func()) *SliderIntWidget
OnChange sets callback when slider's position gets changed.
func (*SliderIntWidget) Size ¶
func (s *SliderIntWidget) Size(width float32) *SliderIntWidget
Size sets slider's width.
type SmallButtonWidget ¶
type SmallButtonWidget struct {
// contains filtered or unexported fields
}
SmallButtonWidget is like a button but without frame padding.
func SmallButton ¶
func SmallButton(id string) *SmallButtonWidget
SmallButton constructs a new small button widget.
func SmallButtonf ¶
func SmallButtonf(format string, args ...any) *SmallButtonWidget
SmallButtonf allows to set formated label for small button. It calls SmallButton(fmt.Sprintf(label, args...)).
func (*SmallButtonWidget) Build ¶
func (b *SmallButtonWidget) Build()
Build implements Widget interface.
func (*SmallButtonWidget) OnClick ¶
func (b *SmallButtonWidget) OnClick(onClick func()) *SmallButtonWidget
OnClick adds OnClick event.
type SplitDirection ¶
type SplitDirection uint8
SplitDirection represents a direction (vertical/horizontal) of splitting layout.
const ( // DirectionHorizontal is a horizontal line. DirectionHorizontal SplitDirection = 1 << iota // DirectionVertical is a vertical line. DirectionVertical )
type SplitLayoutWidget ¶
type SplitLayoutWidget struct {
// contains filtered or unexported fields
}
SplitLayoutWidget creates two childs with a line between them. This line can be moved by the user to adjust child sizes.
func SplitLayout ¶
func SplitLayout(direction SplitDirection, sashPos *float32, layout1, layout2 Widget) *SplitLayoutWidget
SplitLayout creates split layout widget.
func (*SplitLayoutWidget) Border ¶
func (s *SplitLayoutWidget) Border(b bool) *SplitLayoutWidget
Border sets if childs should have borders.
func (*SplitLayoutWidget) Build ¶
func (s *SplitLayoutWidget) Build()
Build implements widget interface.
func (*SplitLayoutWidget) ID ¶
func (s *SplitLayoutWidget) ID(id string) *SplitLayoutWidget
ID allows to manually set splitter's id.
type Splitable ¶
type Splitable interface {
Range(func(w Widget))
}
Splitable is implemented by widgets, which can be split (ranged) Layout implements Splitable.
type StackWidget ¶
type StackWidget struct {
// contains filtered or unexported fields
}
StackWidget is used to ensure, that the build methods of all the widgets (layouts field) was called, but only the selected (visible field) layout is rendered (visible) in app.
func Stack ¶
func Stack(visible int32, layouts ...Widget) *StackWidget
Stack creates a new StackWidget.
type StyleColorID ¶
type StyleColorID imgui.StyleColorID
StyleColorID identifies a color in the UI style.
const ( StyleColorText StyleColorID = StyleColorID(imgui.StyleColorText) StyleColorTextDisabled StyleColorID = StyleColorID(imgui.StyleColorTextDisabled) StyleColorWindowBg StyleColorID = StyleColorID(imgui.StyleColorWindowBg) StyleColorChildBg StyleColorID = StyleColorID(imgui.StyleColorChildBg) StyleColorPopupBg StyleColorID = StyleColorID(imgui.StyleColorPopupBg) StyleColorBorder StyleColorID = StyleColorID(imgui.StyleColorBorder) StyleColorBorderShadow StyleColorID = StyleColorID(imgui.StyleColorBorderShadow) StyleColorFrameBg StyleColorID = StyleColorID(imgui.StyleColorFrameBg) StyleColorFrameBgHovered StyleColorID = StyleColorID(imgui.StyleColorFrameBgHovered) StyleColorFrameBgActive StyleColorID = StyleColorID(imgui.StyleColorFrameBgActive) StyleColorTitleBg StyleColorID = StyleColorID(imgui.StyleColorTitleBg) StyleColorTitleBgActive StyleColorID = StyleColorID(imgui.StyleColorTitleBgActive) StyleColorTitleBgCollapsed StyleColorID = StyleColorID(imgui.StyleColorTitleBgCollapsed) StyleColorMenuBarBg StyleColorID = StyleColorID(imgui.StyleColorMenuBarBg) StyleColorScrollbarBg StyleColorID = StyleColorID(imgui.StyleColorScrollbarBg) StyleColorScrollbarGrab StyleColorID = StyleColorID(imgui.StyleColorScrollbarGrab) StyleColorScrollbarGrabHovered StyleColorID = StyleColorID(imgui.StyleColorScrollbarGrabHovered) StyleColorScrollbarGrabActive StyleColorID = StyleColorID(imgui.StyleColorScrollbarGrabActive) StyleColorCheckMark StyleColorID = StyleColorID(imgui.StyleColorCheckMark) StyleColorSliderGrab StyleColorID = StyleColorID(imgui.StyleColorSliderGrab) StyleColorSliderGrabActive StyleColorID = StyleColorID(imgui.StyleColorSliderGrabActive) StyleColorButton StyleColorID = StyleColorID(imgui.StyleColorButton) StyleColorButtonHovered StyleColorID = StyleColorID(imgui.StyleColorButtonHovered) StyleColorButtonActive StyleColorID = StyleColorID(imgui.StyleColorButtonActive) StyleColorHeader StyleColorID = StyleColorID(imgui.StyleColorHeader) StyleColorHeaderHovered StyleColorID = StyleColorID(imgui.StyleColorHeaderHovered) StyleColorHeaderActive StyleColorID = StyleColorID(imgui.StyleColorHeaderActive) StyleColorSeparator StyleColorID = StyleColorID(imgui.StyleColorSeparator) StyleColorSeparatorHovered StyleColorID = StyleColorID(imgui.StyleColorSeparatorHovered) StyleColorSeparatorActive StyleColorID = StyleColorID(imgui.StyleColorSeparatorActive) StyleColorResizeGrip StyleColorID = StyleColorID(imgui.StyleColorResizeGrip) StyleColorResizeGripHovered StyleColorID = StyleColorID(imgui.StyleColorResizeGripHovered) StyleColorResizeGripActive StyleColorID = StyleColorID(imgui.StyleColorResizeGripActive) StyleColorTab StyleColorID = StyleColorID(imgui.StyleColorTab) StyleColorTabHovered StyleColorID = StyleColorID(imgui.StyleColorTabHovered) StyleColorTabActive StyleColorID = StyleColorID(imgui.StyleColorTabActive) StyleColorTabUnfocused StyleColorID = StyleColorID(imgui.StyleColorTabUnfocused) StyleColorTabUnfocusedActive StyleColorID = StyleColorID(imgui.StyleColorTabUnfocusedActive) StyleColorPlotLines StyleColorID = StyleColorID(imgui.StyleColorPlotLines) StyleColorPlotLinesHovered StyleColorID = StyleColorID(imgui.StyleColorPlotLinesHovered) StyleColorProgressBarActive StyleColorID = StyleColorPlotLinesHovered StyleColorPlotHistogram StyleColorID = StyleColorID(imgui.StyleColorPlotHistogram) StyleColorPlotHistogramHovered StyleColorID = StyleColorID(imgui.StyleColorPlotHistogramHovered) StyleColorTableHeaderBg StyleColorID = StyleColorID(imgui.StyleColorTableHeaderBg) StyleColorTableBorderStrong StyleColorID = StyleColorID(imgui.StyleColorTableBorderStrong) StyleColorTableBorderLight StyleColorID = StyleColorID(imgui.StyleColorTableBorderLight) StyleColorTableRowBg StyleColorID = StyleColorID(imgui.StyleColorTableRowBg) StyleColorTableRowBgAlt StyleColorID = StyleColorID(imgui.StyleColorTableRowBgAlt) StyleColorTextSelectedBg StyleColorID = StyleColorID(imgui.StyleColorTextSelectedBg) StyleColorDragDropTarget StyleColorID = StyleColorID(imgui.StyleColorDragDropTarget) StyleColorModalWindowDimBg StyleColorID = StyleColorID(imgui.StyleColorModalWindowDimBg) )
StyleColor identifier.
type StyleSetter ¶
type StyleSetter struct {
// contains filtered or unexported fields
}
StyleSetter is a user-friendly way to manage imgui styles.
func (*StyleSetter) SetColor ¶
func (ss *StyleSetter) SetColor(colorID StyleColorID, col color.Color) *StyleSetter
SetColor sets colorID's color.
func (*StyleSetter) SetDisabled ¶
func (ss *StyleSetter) SetDisabled(d bool) *StyleSetter
SetDisabled sets if items are disabled.
func (*StyleSetter) SetFont ¶
func (ss *StyleSetter) SetFont(font *FontInfo) *StyleSetter
SetFont sets font.
func (*StyleSetter) SetFontSize ¶
func (ss *StyleSetter) SetFontSize(size float32) *StyleSetter
SetFontSize sets size of the font. NOTE: Be aware, that StyleSetter needs to add a new font to font atlas for each font's size.
func (*StyleSetter) SetStyle ¶
func (ss *StyleSetter) SetStyle(varID StyleVarID, width, height float32) *StyleSetter
SetStyle sets styleVarID to width and height.
func (*StyleSetter) SetStyleFloat ¶
func (ss *StyleSetter) SetStyleFloat(varID StyleVarID, value float32) *StyleSetter
SetStyleFloat sets styleVarID to float value. NOTE: for float typed values see above in comments over StyleVarID's comments.
func (*StyleSetter) To ¶
func (ss *StyleSetter) To(widgets ...Widget) *StyleSetter
To allows to specify a layout, StyleSetter should apply style for.
type StyleVarID ¶
type StyleVarID imgui.StyleVarID
StyleVarID identifies a style variable in the UI style.
const ( // StyleVarAlpha is a float. StyleVarAlpha StyleVarID = StyleVarID(imgui.StyleVarAlpha) // float DisabledAlpha. StyleVarDisabledAlpha StyleVarID = StyleVarID(imgui.StyleVarDisabledAlpha) // StyleVarWindowPadding is a Vec2. StyleVarWindowPadding StyleVarID = StyleVarID(imgui.StyleVarWindowPadding) // StyleVarWindowRounding is a float. StyleVarWindowRounding StyleVarID = StyleVarID(imgui.StyleVarWindowRounding) // StyleVarWindowBorderSize is a float. StyleVarWindowBorderSize StyleVarID = StyleVarID(imgui.StyleVarWindowBorderSize) // StyleVarWindowMinSize is a Vec2. StyleVarWindowMinSize StyleVarID = StyleVarID(imgui.StyleVarWindowMinSize) // StyleVarWindowTitleAlign is a Vec2. StyleVarWindowTitleAlign StyleVarID = StyleVarID(imgui.StyleVarWindowTitleAlign) // StyleVarChildRounding is a float. StyleVarChildRounding StyleVarID = StyleVarID(imgui.StyleVarChildRounding) // StyleVarChildBorderSize is a float. StyleVarChildBorderSize StyleVarID = StyleVarID(imgui.StyleVarChildBorderSize) // StyleVarPopupRounding is a float. StyleVarPopupRounding StyleVarID = StyleVarID(imgui.StyleVarPopupRounding) // StyleVarPopupBorderSize is a float. StyleVarPopupBorderSize StyleVarID = StyleVarID(imgui.StyleVarPopupBorderSize) // StyleVarFramePadding is a Vec2. StyleVarFramePadding StyleVarID = StyleVarID(imgui.StyleVarFramePadding) // StyleVarFrameRounding is a float. StyleVarFrameRounding StyleVarID = StyleVarID(imgui.StyleVarFrameRounding) // StyleVarFrameBorderSize is a float. StyleVarFrameBorderSize StyleVarID = StyleVarID(imgui.StyleVarFrameBorderSize) // StyleVarItemSpacing is a Vec2. StyleVarItemSpacing StyleVarID = StyleVarID(imgui.StyleVarItemSpacing) // StyleVarItemInnerSpacing is a Vec2. StyleVarItemInnerSpacing StyleVarID = StyleVarID(imgui.StyleVarItemInnerSpacing) // StyleVarIndentSpacing is a float. StyleVarIndentSpacing StyleVarID = StyleVarID(imgui.StyleVarIndentSpacing) // StyleVarScrollbarSize is a float. StyleVarScrollbarSize StyleVarID = StyleVarID(imgui.StyleVarScrollbarSize) // StyleVarScrollbarRounding is a float. StyleVarScrollbarRounding StyleVarID = StyleVarID(imgui.StyleVarScrollbarRounding) // StyleVarGrabMinSize is a float. StyleVarGrabMinSize StyleVarID = StyleVarID(imgui.StyleVarGrabMinSize) // StyleVarGrabRounding is a float. StyleVarGrabRounding StyleVarID = StyleVarID(imgui.StyleVarGrabRounding) // StyleVarTabRounding is a float. StyleVarTabRounding StyleVarID = StyleVarID(imgui.StyleVarTabRounding) // StyleVarButtonTextAlign is a Vec2. StyleVarButtonTextAlign StyleVarID = StyleVarID(imgui.StyleVarButtonTextAlign) // StyleVarSelectableTextAlign is a Vec2. StyleVarSelectableTextAlign StyleVarID = StyleVarID(imgui.StyleVarSelectableTextAlign) )
Style IDs.
func (StyleVarID) IsVec2 ¶
func (s StyleVarID) IsVec2() bool
IsVec2 returns true if the style var id should be processed as imgui.Vec2 if not, it is interpreted as float32.
type TabBarFlags ¶
type TabBarFlags int
TabBarFlags represents imgui.TabBarFlags.
const ( // TabBarFlagsNone default = 0. TabBarFlagsNone TabBarFlags = imgui.TabBarFlagsNone // TabBarFlagsReorderable Allow manually dragging tabs to re-order them + New tabs are appended at the end of list. TabBarFlagsReorderable TabBarFlags = imgui.TabBarFlagsReorderable // TabBarFlagsAutoSelectNewTabs Automatically select new tabs when they appear. TabBarFlagsAutoSelectNewTabs TabBarFlags = imgui.TabBarFlagsAutoSelectNewTabs // TabBarFlagsTabListPopupButton Disable buttons to open the tab list popup. TabBarFlagsTabListPopupButton TabBarFlags = imgui.TabBarFlagsTabListPopupButton // TabBarFlagsNoCloseWithMiddleMouseButton Disable behavior of closing tabs (that are submitted with p_open != NULL) // with middle mouse button. You can still repro this behavior on user's side with if // (IsItemHovered() && IsMouseClicked(2)) *p_open = false. TabBarFlagsNoCloseWithMiddleMouseButton TabBarFlags = imgui.TabBarFlagsNoCloseWithMiddleMouseButton // TabBarFlagsNoTabListScrollingButtons Disable scrolling buttons (apply when fitting policy is // TabBarFlagsFittingPolicyScroll). TabBarFlagsNoTabListScrollingButtons TabBarFlags = imgui.TabBarFlagsNoTabListScrollingButtons // TabBarFlagsNoTooltip Disable tooltips when hovering a tab. TabBarFlagsNoTooltip TabBarFlags = imgui.TabBarFlagsNoTooltip // TabBarFlagsFittingPolicyResizeDown Resize tabs when they don't fit. TabBarFlagsFittingPolicyResizeDown TabBarFlags = imgui.TabBarFlagsFittingPolicyResizeDown // TabBarFlagsFittingPolicyScroll Add scroll buttons when tabs don't fit. TabBarFlagsFittingPolicyScroll TabBarFlags = imgui.TabBarFlagsFittingPolicyScroll // TabBarFlagsFittingPolicyMask combines // TabBarFlagsFittingPolicyResizeDown and TabBarFlagsFittingPolicyScroll. TabBarFlagsFittingPolicyMask TabBarFlags = imgui.TabBarFlagsFittingPolicyMask // TabBarFlagsFittingPolicyDefault alias for TabBarFlagsFittingPolicyResizeDown. TabBarFlagsFittingPolicyDefault TabBarFlags = imgui.TabBarFlagsFittingPolicyDefault )
tab bar flags list.
type TabBarWidget ¶
type TabBarWidget struct {
// contains filtered or unexported fields
}
func TabBar ¶
func TabBar() *TabBarWidget
func (*TabBarWidget) Flags ¶
func (t *TabBarWidget) Flags(flags TabBarFlags) *TabBarWidget
func (*TabBarWidget) ID ¶
func (t *TabBarWidget) ID(id string) *TabBarWidget
func (*TabBarWidget) TabItems ¶
func (t *TabBarWidget) TabItems(items ...*TabItemWidget) *TabBarWidget
type TabItemFlags ¶
type TabItemFlags int
TabItemFlags represents tab item flags.
const ( // TabItemFlagsNone default = 0. TabItemFlagsNone TabItemFlags = imgui.TabItemFlagsNone // TabItemFlagsUnsavedDocument Append '*' to title without affecting the ID, as a convenience to avoid using the // ### operator. Also: tab is selected on closure and closure is deferred by one frame to allow code to undo it // without flicker. TabItemFlagsUnsavedDocument TabItemFlags = imgui.TabItemFlagsUnsavedDocument // TabItemFlagsSetSelected Trigger flag to programmatically make the tab selected when calling BeginTabItem(). TabItemFlagsSetSelected TabItemFlags = imgui.TabItemFlagsSetSelected // TabItemFlagsNoCloseWithMiddleMouseButton Disable behavior of closing tabs (that are submitted with // p_open != NULL) with middle mouse button. You can still repro this behavior on user's side with if // (IsItemHovered() && IsMouseClicked(2)) *p_open = false. TabItemFlagsNoCloseWithMiddleMouseButton TabItemFlags = imgui.TabItemFlagsNoCloseWithMiddleMouseButton // TabItemFlagsNoPushID Don't call PushID(tab->ID)/PopID() on BeginTabItem()/EndTabItem(). TabItemFlagsNoPushID TabItemFlags = imgui.TabItemFlagsNoPushID )
tab item flags list.
type TabItemWidget ¶
type TabItemWidget struct {
// contains filtered or unexported fields
}
func TabItem ¶
func TabItem(label string) *TabItemWidget
func TabItemf ¶
func TabItemf(format string, args ...any) *TabItemWidget
func (*TabItemWidget) BuildTabItem ¶
func (t *TabItemWidget) BuildTabItem()
BuildTabItem executes tab item build steps.
func (*TabItemWidget) Flags ¶
func (t *TabItemWidget) Flags(flags TabItemFlags) *TabItemWidget
func (*TabItemWidget) IsOpen ¶
func (t *TabItemWidget) IsOpen(open *bool) *TabItemWidget
func (*TabItemWidget) Layout ¶
func (t *TabItemWidget) Layout(widgets ...Widget) *TabItemWidget
type TableColumnFlags ¶
type TableColumnFlags int
TableColumnFlags represents a flags for table column (see (*TableColumnWidget).Flags()).
const ( // Input configuration flags. TableColumnFlagsNone TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_None) TableColumnFlagsDefaultHide TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_DefaultHide) TableColumnFlagsDefaultSort TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_DefaultSort) TableColumnFlagsWidthStretch TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_WidthStretch) TableColumnFlagsWidthFixed TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_WidthFixed) TableColumnFlagsNoResize TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_NoResize) TableColumnFlagsNoReorder TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_NoReorder) TableColumnFlagsNoHide TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_NoHide) TableColumnFlagsNoClip TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_NoClip) TableColumnFlagsNoSort TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_NoSort) TableColumnFlagsNoSortAscending TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_NoSortAscending) TableColumnFlagsNoSortDescending TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_NoSortDescending) TableColumnFlagsNoHeaderWidth TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_NoHeaderWidth) TableColumnFlagsPreferSortAscending TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_PreferSortAscending) TableColumnFlagsPreferSortDescending TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_PreferSortDescending) TableColumnFlagsIndentEnable TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_IndentEnable) TableColumnFlagsIndentDisable TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_IndentDisable) // Output status flags read-only via TableGetColumnFlags(). TableColumnFlagsIsEnabled TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_IsEnabled) TableColumnFlagsIsVisible TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_IsVisible) TableColumnFlagsIsSorted TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_IsSorted) TableColumnFlagsIsHovered TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_IsHovered) // [Internal] Combinations and masks. TableColumnFlagsWidthMask TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_WidthMask_) TableColumnFlagsIndentMask TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_IndentMask_) TableColumnFlagsStatusMask TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_StatusMask_) TableColumnFlagsNoDirectResize TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_NoDirectResize_) )
table column flags list.
type TableColumnWidget ¶
type TableColumnWidget struct {
// contains filtered or unexported fields
}
func TableColumn ¶
func TableColumn(label string) *TableColumnWidget
func (*TableColumnWidget) BuildTableColumn ¶
func (c *TableColumnWidget) BuildTableColumn()
BuildTableColumn executes table column build steps.
func (*TableColumnWidget) Flags ¶
func (c *TableColumnWidget) Flags(flags TableColumnFlags) *TableColumnWidget
func (*TableColumnWidget) InnerWidthOrWeight ¶
func (c *TableColumnWidget) InnerWidthOrWeight(w float32) *TableColumnWidget
func (*TableColumnWidget) UserID ¶
func (c *TableColumnWidget) UserID(id uint32) *TableColumnWidget
type TableFlags ¶
type TableFlags int
TableFlags represents table flags.
const ( TableFlagsNone TableFlags = TableFlags(imgui.TableFlags_None) TableFlagsResizable TableFlags = TableFlags(imgui.TableFlags_Resizable) TableFlagsReorderable TableFlags = TableFlags(imgui.TableFlags_Reorderable) TableFlagsHideable TableFlags = TableFlags(imgui.TableFlags_Hideable) TableFlagsSortable TableFlags = TableFlags(imgui.TableFlags_Sortable) TableFlagsNoSavedSettings TableFlags = TableFlags(imgui.TableFlags_NoSavedSettings) TableFlagsContextMenuInBody TableFlags = TableFlags(imgui.TableFlags_ContextMenuInBody) TableFlagsRowBg TableFlags = TableFlags(imgui.TableFlags_RowBg) TableFlagsBordersInnerH TableFlags = TableFlags(imgui.TableFlags_BordersInnerH) TableFlagsBordersOuterH TableFlags = TableFlags(imgui.TableFlags_BordersOuterH) TableFlagsBordersInnerV TableFlags = TableFlags(imgui.TableFlags_BordersInnerV) TableFlagsBordersOuterV TableFlags = TableFlags(imgui.TableFlags_BordersOuterV) TableFlagsBordersH TableFlags = TableFlags(imgui.TableFlags_BordersH) TableFlagsBordersV TableFlags = TableFlags(imgui.TableFlags_BordersV) TableFlagsBordersInner TableFlags = TableFlags(imgui.TableFlags_BordersInner) TableFlagsBordersOuter TableFlags = TableFlags(imgui.TableFlags_BordersOuter) TableFlagsBorders TableFlags = TableFlags(imgui.TableFlags_Borders) TableFlagsNoBordersInBody TableFlags = TableFlags(imgui.TableFlags_NoBordersInBody) TableFlagsNoBordersInBodyUntilResize TableFlags = TableFlags(imgui.TableFlags_NoBordersInBodyUntilResizeTableFlags) TableFlagsSizingFixedFit TableFlags = TableFlags(imgui.TableFlags_SizingFixedFit) TableFlagsSizingFixedSame TableFlags = TableFlags(imgui.TableFlags_SizingFixedSame) TableFlagsSizingStretchProp TableFlags = TableFlags(imgui.TableFlags_SizingStretchProp) TableFlagsSizingStretchSame TableFlags = TableFlags(imgui.TableFlags_SizingStretchSame) TableFlagsNoHostExtendX TableFlags = TableFlags(imgui.TableFlags_NoHostExtendX) TableFlagsNoHostExtendY TableFlags = TableFlags(imgui.TableFlags_NoHostExtendY) TableFlagsNoKeepColumnsVisible TableFlags = TableFlags(imgui.TableFlags_NoKeepColumnsVisible) TableFlagsPreciseWidths TableFlags = TableFlags(imgui.TableFlags_PreciseWidths) TableFlagsNoClip TableFlags = TableFlags(imgui.TableFlags_NoClip) TableFlagsPadOuterX TableFlags = TableFlags(imgui.TableFlags_PadOuterX) TableFlagsNoPadOuterX TableFlags = TableFlags(imgui.TableFlags_NoPadOuterX) TableFlagsNoPadInnerX TableFlags = TableFlags(imgui.TableFlags_NoPadInnerX) TableFlagsScrollX TableFlags = TableFlags(imgui.TableFlags_ScrollX) TableFlagsScrollY TableFlags = TableFlags(imgui.TableFlags_ScrollY) TableFlagsSortMulti TableFlags = TableFlags(imgui.TableFlags_SortMulti) TableFlagsSortTristate TableFlags = TableFlags(imgui.TableFlags_SortTristate) TableFlagsSizingMask TableFlags = TableFlags(imgui.TableFlags_SizingMask_) )
Table flags enum:.
type TableRowFlags ¶
type TableRowFlags int
TableRowFlags represents table row flags.
const ( TableRowFlagsNone TableRowFlags = TableRowFlags(imgui.TableRowFlags_None) // Identify header row (set default background color + width of its contents accounted different for auto column width). TableRowFlagsHeaders TableRowFlags = TableRowFlags(imgui.TableRowFlags_Headers) )
table row flags:.
type TableRowWidget ¶
type TableRowWidget struct {
// contains filtered or unexported fields
}
func TableRow ¶
func TableRow(widgets ...Widget) *TableRowWidget
func (*TableRowWidget) BgColor ¶
func (r *TableRowWidget) BgColor(c color.Color) *TableRowWidget
func (*TableRowWidget) BuildTableRow ¶
func (r *TableRowWidget) BuildTableRow()
BuildTableRow executes table row build steps.
func (*TableRowWidget) Flags ¶
func (r *TableRowWidget) Flags(flags TableRowFlags) *TableRowWidget
func (*TableRowWidget) MinHeight ¶
func (r *TableRowWidget) MinHeight(height float64) *TableRowWidget
type TableWidget ¶
type TableWidget struct {
// contains filtered or unexported fields
}
func Table ¶
func Table() *TableWidget
func (*TableWidget) Columns ¶
func (t *TableWidget) Columns(cols ...*TableColumnWidget) *TableWidget
func (*TableWidget) FastMode ¶
func (t *TableWidget) FastMode(b bool) *TableWidget
FastMode Displays visible rows only to boost performance.
func (*TableWidget) Flags ¶
func (t *TableWidget) Flags(flags TableFlags) *TableWidget
func (*TableWidget) Freeze ¶
func (t *TableWidget) Freeze(col, row int) *TableWidget
Freeze columns/rows so they stay visible when scrolled.
func (*TableWidget) ID ¶
func (t *TableWidget) ID(id string) *TableWidget
ID sets the internal id of table widget.
func (*TableWidget) InnerWidth ¶
func (t *TableWidget) InnerWidth(width float64) *TableWidget
func (*TableWidget) Rows ¶
func (t *TableWidget) Rows(rows ...*TableRowWidget) *TableWidget
func (*TableWidget) Size ¶
func (t *TableWidget) Size(width, height float32) *TableWidget
type Texture ¶
type Texture struct {
// contains filtered or unexported fields
}
Texture represents imgui.TextureID. It is base unit of images in imgui.
type TooltipWidget ¶
type TooltipWidget struct {
// contains filtered or unexported fields
}
func Tooltip ¶
func Tooltip(tip string) *TooltipWidget
func Tooltipf ¶
func Tooltipf(format string, args ...any) *TooltipWidget
func (*TooltipWidget) Layout ¶
func (t *TooltipWidget) Layout(widgets ...Widget) *TooltipWidget
type TreeNodeFlags ¶
type TreeNodeFlags int
TreeNodeFlags represents tree node widget flags.
const ( // TreeNodeFlagsNone default = 0. TreeNodeFlagsNone TreeNodeFlags = imgui.TreeNodeFlagsNone // TreeNodeFlagsSelected draws as selected. TreeNodeFlagsSelected TreeNodeFlags = imgui.TreeNodeFlagsSelected // TreeNodeFlagsFramed draws full colored frame (e.g. for CollapsingHeader). TreeNodeFlagsFramed TreeNodeFlags = imgui.TreeNodeFlagsFramed // TreeNodeFlagsAllowItemOverlap hit testing to allow subsequent widgets to overlap this one. TreeNodeFlagsAllowItemOverlap TreeNodeFlags = imgui.TreeNodeFlagsAllowItemOverlap // TreeNodeFlagsNoTreePushOnOpen doesn't do a TreePush() when open // (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack. TreeNodeFlagsNoTreePushOnOpen TreeNodeFlags = imgui.TreeNodeFlagsNoTreePushOnOpen // TreeNodeFlagsNoAutoOpenOnLog doesn't automatically and temporarily open node when Logging is active // (by default logging will automatically open tree nodes). TreeNodeFlagsNoAutoOpenOnLog TreeNodeFlags = imgui.TreeNodeFlagsNoAutoOpenOnLog // TreeNodeFlagsDefaultOpen defaults node to be open. TreeNodeFlagsDefaultOpen TreeNodeFlags = imgui.TreeNodeFlagsDefaultOpen // TreeNodeFlagsOpenOnDoubleClick needs double-click to open node. TreeNodeFlagsOpenOnDoubleClick TreeNodeFlags = imgui.TreeNodeFlagsOpenOnDoubleClick // TreeNodeFlagsOpenOnArrow opens only when clicking on the arrow part. // If TreeNodeFlagsOpenOnDoubleClick is also set, single-click arrow or double-click all box to open. TreeNodeFlagsOpenOnArrow TreeNodeFlags = imgui.TreeNodeFlagsOpenOnArrow // TreeNodeFlagsLeaf allows no collapsing, no arrow (use as a convenience for leaf nodes). TreeNodeFlagsLeaf TreeNodeFlags = imgui.TreeNodeFlagsLeaf // TreeNodeFlagsBullet displays a bullet instead of an arrow. TreeNodeFlagsBullet TreeNodeFlags = imgui.TreeNodeFlagsBullet // TreeNodeFlagsFramePadding uses FramePadding (even for an unframed text node) to // vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding(). TreeNodeFlagsFramePadding TreeNodeFlags = imgui.TreeNodeFlagsFramePadding // TreeNodeFlagsSpanAvailWidth extends hit box to the right-most edge, even if not framed. // This is not the default in order to allow adding other items on the same line. // In the future we may refactor the hit system to be front-to-back, allowing natural overlaps // and then this can become the default. TreeNodeFlagsSpanAvailWidth TreeNodeFlags = imgui.TreeNodeFlagsSpanAvailWidth // TreeNodeFlagsSpanFullWidth extends hit box to the left-most and right-most edges (bypass the indented area). TreeNodeFlagsSpanFullWidth TreeNodeFlags = imgui.TreeNodeFlagsSpanFullWidth // (items submitted between TreeNode and TreePop). TreeNodeFlagsNavLeftJumpsBackHere TreeNodeFlags = imgui.TreeNodeFlagsNavLeftJumpsBackHere // TreeNodeFlagsCollapsingHeader combines TreeNodeFlagsFramed and TreeNodeFlagsNoAutoOpenOnLog. TreeNodeFlagsCollapsingHeader TreeNodeFlags = imgui.TreeNodeFlagsCollapsingHeader )
tree node flags list.
type TreeNodeWidget ¶
type TreeNodeWidget struct {
// contains filtered or unexported fields
}
TreeNodeWidget is a a wide button with open/close state. if is opened, the `layout` is displayed below the widget. It can be used to create certain lists, advanced settings sections e.t.c.
func TreeNode ¶
func TreeNode(label string) *TreeNodeWidget
TreeNode creates a new tree node widget.
func TreeNodef ¶
func TreeNodef(format string, args ...any) *TreeNodeWidget
TreeNodef adds TreeNode with formatted label.
func (*TreeNodeWidget) Event ¶
func (t *TreeNodeWidget) Event(handler func()) *TreeNodeWidget
Event create TreeNode with eventHandler You could detect events (e.g. IsItemClicked IsMouseDoubleClicked etc...) and handle them for TreeNode inside eventHandler. Deprecated: Use EventHandler instead!
func (*TreeNodeWidget) Flags ¶
func (t *TreeNodeWidget) Flags(flags TreeNodeFlags) *TreeNodeWidget
Flags sets flags.
func (*TreeNodeWidget) Layout ¶
func (t *TreeNodeWidget) Layout(widgets ...Widget) *TreeNodeWidget
Layout sets layout to be displayed when tree node is opened.
type TreeTableRowWidget ¶
type TreeTableRowWidget struct {
// contains filtered or unexported fields
}
func TreeTableRow ¶
func TreeTableRow(label string, widgets ...Widget) *TreeTableRowWidget
func (*TreeTableRowWidget) BuildTreeTableRow ¶
func (ttr *TreeTableRowWidget) BuildTreeTableRow()
BuildTreeTableRow executes table row building steps.
func (*TreeTableRowWidget) Children ¶
func (ttr *TreeTableRowWidget) Children(rows ...*TreeTableRowWidget) *TreeTableRowWidget
func (*TreeTableRowWidget) Flags ¶
func (ttr *TreeTableRowWidget) Flags(flags TreeNodeFlags) *TreeTableRowWidget
type TreeTableWidget ¶
type TreeTableWidget struct {
// contains filtered or unexported fields
}
func TreeTable ¶
func TreeTable() *TreeTableWidget
func (*TreeTableWidget) Build ¶
func (tt *TreeTableWidget) Build()
Build implements Widget interface.
func (*TreeTableWidget) Columns ¶
func (tt *TreeTableWidget) Columns(cols ...*TableColumnWidget) *TreeTableWidget
func (*TreeTableWidget) Flags ¶
func (tt *TreeTableWidget) Flags(flags TableFlags) *TreeTableWidget
func (*TreeTableWidget) Freeze ¶
func (tt *TreeTableWidget) Freeze(col, row int) *TreeTableWidget
Freeze columns/rows so they stay visible when scrolled.
func (*TreeTableWidget) Rows ¶
func (tt *TreeTableWidget) Rows(rows ...*TreeTableRowWidget) *TreeTableWidget
func (*TreeTableWidget) Size ¶
func (tt *TreeTableWidget) Size(width, height float32) *TreeTableWidget
type VSliderIntWidget ¶
type VSliderIntWidget struct {
// contains filtered or unexported fields
}
VSliderIntWidget stands from Vertical SliderIntWidget.
func VSliderInt ¶
func VSliderInt(value *int32, min, max int32) *VSliderIntWidget
VSliderInt creates new vslider int.
func (*VSliderIntWidget) Build ¶
func (vs *VSliderIntWidget) Build()
Build implements Widget interface.
func (*VSliderIntWidget) Flags ¶
func (vs *VSliderIntWidget) Flags(flags SliderFlags) *VSliderIntWidget
Flags sets flags.
func (*VSliderIntWidget) Format ¶
func (vs *VSliderIntWidget) Format(format string) *VSliderIntWidget
Format sets format (see comment on (*SliderIntWidget).Format).
func (*VSliderIntWidget) Label ¶
func (vs *VSliderIntWidget) Label(label string) *VSliderIntWidget
Label sets slider's label (id).
func (*VSliderIntWidget) Labelf ¶
func (vs *VSliderIntWidget) Labelf(format string, args ...any) *VSliderIntWidget
Labelf sets formated label.
func (*VSliderIntWidget) OnChange ¶
func (vs *VSliderIntWidget) OnChange(onChange func()) *VSliderIntWidget
OnChange sets callback called when slider's position gets changed.
func (*VSliderIntWidget) Size ¶
func (vs *VSliderIntWidget) Size(width, height float32) *VSliderIntWidget
Size sets slider's size.
type VSplitterWidget ¶
type VSplitterWidget struct {
// contains filtered or unexported fields
}
func VSplitter ¶
func VSplitter(delta *float32) *VSplitterWidget
func (*VSplitterWidget) Build ¶
func (v *VSplitterWidget) Build()
Build implements Widget interface nolint:dupl // will fix later
func (*VSplitterWidget) ID ¶
func (v *VSplitterWidget) ID(id string) *VSplitterWidget
func (*VSplitterWidget) Size ¶
func (v *VSplitterWidget) Size(width, height float32) *VSplitterWidget
type Widget ¶
type Widget interface {
Build()
}
Widget is a base unit of giu rendering system. each widget just needs to implement Build method which is called, when widget needs to be rendered.
func AlignManually ¶
func AlignManually(alignmentType AlignmentType, widget Widget, widgetWidth float32, forceApplyWidth bool) Widget
AlignManually allows to apply alignment manually. As long as AlignSetter is really EXPERIMENTAL feature and may fail randomly, the following method is supposed to always work, as long as you set it up correctly. To use it just pass a single widget with its exact width. be sure to apply widget's size by using "Size" method! forceApplyWidth argument allows you to ask giu to force-set width of `widget` NOTE that forcing width doesn't work for each widget type! For example Button won't work because its size is set by argument to imgui call not PushWidth api.
type WindowFlags ¶
type WindowFlags int
WindowFlags represents a window flags (see (*WindowWidget).Flags.
const ( // WindowFlagsNone default = 0. WindowFlagsNone WindowFlags = imgui.WindowFlagsNone // WindowFlagsNoTitleBar disables title-bar. WindowFlagsNoTitleBar WindowFlags = imgui.WindowFlagsNoTitleBar // WindowFlagsNoResize disables user resizing with the lower-right grip. WindowFlagsNoResize WindowFlags = imgui.WindowFlagsNoResize // WindowFlagsNoMove disables user moving the window. WindowFlagsNoMove WindowFlags = imgui.WindowFlagsNoMove // WindowFlagsNoScrollbar disables scrollbars. Window can still scroll with mouse or programmatically. WindowFlagsNoScrollbar WindowFlags = imgui.WindowFlagsNoScrollbar // WindowFlagsNoScrollWithMouse disables user vertically scrolling with mouse wheel. On child window, mouse wheel // will be forwarded to the parent unless NoScrollbar is also set. WindowFlagsNoScrollWithMouse WindowFlags = imgui.WindowFlagsNoScrollWithMouse // WindowFlagsNoCollapse disables user collapsing window by double-clicking on it. WindowFlagsNoCollapse WindowFlags = imgui.WindowFlagsNoCollapse // WindowFlagsAlwaysAutoResize resizes every window to its content every frame. WindowFlagsAlwaysAutoResize WindowFlags = imgui.WindowFlagsAlwaysAutoResize // WindowFlagsNoBackground disables drawing background color (WindowBg, etc.) and outside border. Similar as using // SetNextWindowBgAlpha(0.0f). WindowFlagsNoBackground WindowFlags = imgui.WindowFlagsNoBackground // WindowFlagsNoSavedSettings will never load/save settings in .ini file. WindowFlagsNoSavedSettings WindowFlags = imgui.WindowFlagsNoSavedSettings // WindowFlagsNoMouseInputs disables catching mouse, hovering test with pass through. WindowFlagsNoMouseInputs WindowFlags = imgui.WindowFlagsNoMouseInputs // WindowFlagsMenuBar has a menu-bar. WindowFlagsMenuBar WindowFlags = imgui.WindowFlagsMenuBar // WindowFlagsHorizontalScrollbar allows horizontal scrollbar to appear (off by default). You may use // SetNextWindowContentSize(ImVec2(width,0.0f)); prior to calling Begin() to specify width. Read code in imgui_demo // in the "Horizontal Scrolling" section. WindowFlagsHorizontalScrollbar WindowFlags = imgui.WindowFlagsHorizontalScrollbar // WindowFlagsNoFocusOnAppearing disables taking focus when transitioning from hidden to visible state. WindowFlagsNoFocusOnAppearing WindowFlags = imgui.WindowFlagsNoFocusOnAppearing // WindowFlagsNoBringToFrontOnFocus disables bringing window to front when taking focus. e.g. clicking on it or // programmatically giving it focus. WindowFlagsNoBringToFrontOnFocus WindowFlags = imgui.WindowFlagsNoBringToFrontOnFocus // WindowFlagsAlwaysVerticalScrollbar always shows vertical scrollbar, even if ContentSize.y < Size.y . WindowFlagsAlwaysVerticalScrollbar WindowFlags = imgui.WindowFlagsAlwaysVerticalScrollbar // WindowFlagsAlwaysHorizontalScrollbar always shows horizontal scrollbar, even if ContentSize.x < Size.x . WindowFlagsAlwaysHorizontalScrollbar WindowFlags = imgui.WindowFlagsAlwaysHorizontalScrollbar // WindowFlagsAlwaysUseWindowPadding ensures child windows without border uses style.WindowPadding (ignored by // default for non-bordered child windows, because more convenient). WindowFlagsAlwaysUseWindowPadding WindowFlags = imgui.WindowFlagsAlwaysUseWindowPadding WindowFlagsNoNavInputs WindowFlags = imgui.WindowFlagsNoNavInputs // (e.g. skipped by CTRL+TAB). WindowFlagsNoNavFocus WindowFlags = imgui.WindowFlagsNoNavFocus // WindowFlagsUnsavedDocument appends '*' to title without affecting the ID, as a convenience to avoid using the // ### operator. When used in a tab/docking context, tab is selected on closure and closure is deferred by one // frame to allow code to cancel the closure (with a confirmation popup, etc.) without flicker. WindowFlagsUnsavedDocument WindowFlags = imgui.WindowFlagsUnsavedDocument WindowFlagsNoNav WindowFlags = imgui.WindowFlagsNoNav // WindowFlagsNoDecoration combines WindowFlagsNoTitleBar, WindowFlagsNoResize, WindowFlagsNoScrollbar and // WindowFlagsNoCollapse. WindowFlagsNoDecoration WindowFlags = imgui.WindowFlagsNoDecoration // WindowFlagsNoInputs combines WindowFlagsNoMouseInputs, WindowFlagsNoNavInputs and WindowFlagsNoNavFocus. WindowFlagsNoInputs WindowFlags = imgui.WindowFlagsNoInputs )
window flags.
type WindowShortcut ¶
WindowShortcut represents a window-level shortcut could be used as an argument to (*Window).RegisterKeyboardShortcuts.
type WindowWidget ¶
type WindowWidget struct {
// contains filtered or unexported fields
}
WindowWidget represents imgui.Window Windows are used to display ui widgets. They are in second place in the giu hierarchy (after the MasterWindow) NOTE: to disable multiple window, use SingleWindow.
func SingleWindow ¶
func SingleWindow() *WindowWidget
SingleWindow creates one window filling all available space in MasterWindow. If SingleWindow is set up, no other windows can't be definied.
func SingleWindowWithMenuBar ¶
func SingleWindowWithMenuBar() *WindowWidget
SingleWindowWithMenuBar creates a SingleWindow and allows to add menubar on its top.
func (*WindowWidget) BringToFront ¶
func (w *WindowWidget) BringToFront()
BringToFront sets window focused.
func (*WindowWidget) CurrentPosition ¶
func (w *WindowWidget) CurrentPosition() (x, y float32)
CurrentPosition returns a current position of the window.
func (*WindowWidget) CurrentSize ¶
func (w *WindowWidget) CurrentSize() (width, height float32)
CurrentSize returns current size of the window.
func (*WindowWidget) Flags ¶
func (w *WindowWidget) Flags(flags WindowFlags) *WindowWidget
Flags sets window flags.
func (*WindowWidget) HasFocus ¶
func (w *WindowWidget) HasFocus() bool
HasFocus returns true if window is focused.
func (*WindowWidget) IsOpen ¶
func (w *WindowWidget) IsOpen(open *bool) *WindowWidget
IsOpen sets if window widget is `opened` (minimalized).
func (*WindowWidget) Layout ¶
func (w *WindowWidget) Layout(widgets ...Widget)
Layout is a final step of the window setup. it should be called to add a layout to the window and build it.
func (*WindowWidget) Pos ¶
func (w *WindowWidget) Pos(x, y float32) *WindowWidget
Pos sets the window start position NOTE: The position could be changed by user later. To prevent user from changin window position use WIndowFlagsNoMove.
func (*WindowWidget) RegisterKeyboardShortcuts ¶
func (w *WindowWidget) RegisterKeyboardShortcuts(s ...WindowShortcut) *WindowWidget
RegisterKeyboardShortcuts adds local (window-level) keyboard shortcuts see InputHandler.go.
func (*WindowWidget) Size ¶
func (w *WindowWidget) Size(width, height float32) *WindowWidget
Size sets window size NOTE: size can be changed by user, if you want to prevent user from changing window size, use NoResize flag.
Source Files ¶
- Alignment.go
- Canvas.go
- ClickableWidgets.go
- CodeEditor.go
- Context.go
- Direction.go
- EventHandler.go
- Events.go
- ExtraWidgets.go
- Flags.go
- FontAtlasProsessor.go
- ImageWidgets.go
- InputHandler.go
- Keycode.go
- Layout.go
- ListClipper.go
- Markdown.go
- MasterWindow.go
- MemoryEditor.go
- Msgbox.go
- Plot.go
- Popups.go
- ProgressIndicator.go
- SliderWidgets.go
- SplitLayout.go
- StackWidget.go
- Style.go
- TableWidgets.go
- TextWidgets.go
- Texture.go
- TextureFilters.go
- Utils.go
- Widgets.go
- Window.go
- doc.go