giu

package module
v0.0.0-...-5771b35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 18 Imported by: 0

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

View Source
const (
	DialogResultOK     DialogResult = true
	DialogResultCancel DialogResult = false

	DialogResultYes = DialogResultOK
	DialogResultNo  = DialogResultCancel
)

dialog results

View Source
const (
	TextureFilterNearest = iota
	TextureFilterLinear
	TextureFilterNearestMipmapNearest
	TextureFilterLinearMipmapNearest
	TextureFilterNearestMipmapLinear
	TextureFilterLinearMipmapLinear
)

Texture filtering types.

View Source
const (
	// Auto is used to widget.Size to indicate height or width to occupy available spaces
	Auto float32 = -0.0000001
)

Variables

View Source
var Context context
View Source
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

func CalcTextSize(text string) (width, height float32)

CalcTextSize calls CalcTextSizeV(text, false, -1)

func CalcTextSizeV

func CalcTextSizeV(text string, hideAfterDoubleHash bool, wrapWidth float32) (w, h float32)

CalcTextSizeV calculates text dimensions

func CloseCurrentPopup

func CloseCurrentPopup()

func FixDPI

func FixDPI()

func GenAutoID

func GenAutoID(id string) string

GenAutoID automatically generates fidget's id

func GetAvailableRegion

func GetAvailableRegion() (width, height float32)

func GetCursorPos

func GetCursorPos() image.Point

GetCursorPos gets imgui drawing cursor inside of current window

func GetCursorScreenPos

func GetCursorScreenPos() image.Point

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 GetMousePos

func GetMousePos() image.Point

GetMousePos returns mouse position

func GetWidgetWidth

func GetWidgetWidth(w Widget) (result float32)

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: Custom widgets are skipped, so if user put some widgets inside of CustomWidget, its sizes will not be returned

if you find anything else, please report it on https://github.com/HACKERALERT/giu Any contribution is appreciated!

func GetWindowPadding

func GetWindowPadding() (x, y float32)

GetWindowPadding returns window padding

func ImageToRgba

func ImageToRgba(img image.Image) *image.RGBA

ImageToRgba converts image.Image to *image.RGBA

func IsItemActive

func IsItemActive() bool

IsItemActive returns true if item is active

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

func IsKeyDown

func IsKeyDown(key Key) bool

IsKeyDown returns true if key `key` is down

func IsKeyPressed

func IsKeyPressed(key Key) bool

IsKeyPressed returns true if key `key` is pressed

func IsKeyReleased

func IsKeyReleased(key Key) bool

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 LoadImage

func LoadImage(imgPath string) (*image.RGBA, error)

LoadImage loads image from file and returns *image.RGBA

func NewTextureFromRgba

func NewTextureFromRgba(rgba image.Image, loadCallback func(*Texture))

NewTextureFromRgba creates a new texture from image.Image and, when it is done, calls loadCallback(loadedTexture).

func OpenPopup

func OpenPopup(name string)

func PopClipRect

func PopClipRect()

func PopFont

func PopFont()

PopFont pops the font (should be called after PushFont)

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()

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

func PushClipRect(clipRectMin, clipRectMax image.Point, intersectWithClipRect bool)

func PushColorButton

func PushColorButton(col color.RGBA)

PushColorButton calls PushStyleColor(StyleColorButton,...) NOTE: don't forget to call PopStyleColor()!

func PushColorButtonActive

func PushColorButtonActive(col color.RGBA)

PushColorButtonActive calls PushStyleColor(StyleColorButtonActive,...) NOTE: don't forget to call PopStyleColor()!

func PushColorButtonHovered

func PushColorButtonHovered(col color.RGBA)

PushColorButtonHovered calls PushStyleColor(StyleColorButtonHovered,...) NOTE: don't forget to call PopStyleColor()!

func PushColorFrameBg

func PushColorFrameBg(col color.RGBA)

PushColorFrameBg calls PushStyleColor(StyleColorFrameBg,...) NOTE: don't forget to call PopStyleColor()!

func PushColorText

func PushColorText(col color.RGBA)

PushColorText calls PushStyleColor(StyleColorText,...) NOTE: don't forget to call PopStyleColor()!

func PushColorTextDisabled

func PushColorTextDisabled(col color.RGBA)

PushColorTextDisabled calls PushStyleColor(StyleColorTextDisabled,...) NOTE: don't forget to call PopStyleColor()!

func PushColorWindowBg

func PushColorWindowBg(col color.RGBA)

PushColorWindowBg calls PushStyleColor(StyleColorWindowBg,...) NOTE: don't forget to call PopStyleColor()!

func PushFont

func PushFont(font *FontInfo) bool

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.RGBA)

PushStyleColor wrapps imgui.PushStyleColor NOTE: don't forget to call PopStyleColor()!

func PushTextWrapPos

func PushTextWrapPos()

func PushWindowPadding

func PushWindowPadding(width, height float32)

PushWindowPadding calls PushStyleVar(StyleWindowPadding,...)

func RegisterKeyboardShortcuts

func RegisterKeyboardShortcuts(s ...Shortcut)

func SameLine

func SameLine()

SameLine wrapps imgui.SomeLine Don't use if you don't have to (use RowWidget instead)

func SetCursorPos

func SetCursorPos(pos image.Point)

SetCursorPos sets imgui drawing cursor inside of current window

func SetCursorScreenPos

func SetCursorScreenPos(pos image.Point)

SetCursorScreenPos sets imgui drawing cursor on the screen

func SetDefaultFontFromBytes

func SetDefaultFontFromBytes(fontBytes []byte, size float32)

SetDefaultFontFromBytes changes default font by bytes of the font file.

func SetItemDefaultFocus

func SetItemDefaultFocus()

SetItemDefaultFocus set the item focused by default

func SetKeyboardFocusHere

func SetKeyboardFocusHere()

SetKeyboardFocusHere sets keyboard focus at the widget

func SetKeyboardFocusHereV

func SetKeyboardFocusHereV(i int)

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 ToVec2

func ToVec2(pt image.Point) imgui.Vec2

ToVec2 converts image.Point to imgui.Vec2

func ToVec4Color

func ToVec4Color(col color.RGBA) imgui.Vec4

ToVec4Color converts rgba color to imgui.Vec4

func Update

func Update()

Update updates giu app it is done by default after each frame. Hoeever because frames stops rendering, when no user action is done, it may be necessary to Update ui manually at some point.

func Vec4ToRGBA

func Vec4ToRGBA(vec4 imgui.Vec4) color.RGBA

Vec4ToRGBA converts imgui's Vec4 to golang rgba color

Types

type AlignmentSetter

type AlignmentSetter struct {
	// contains filtered or unexported fields
}

func Align

func Align(at AlignmentType) *AlignmentSetter

Align sets widgets alignment. usage: see examples/align

- 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()

func (*AlignmentSetter) ID

ID allows to manually set AlignmentSetter ID (it shouldn't be used in a 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
const (
	AlignLeft AlignmentType = iota
	AlignCenter
	AlignRight
)

type ArrowButtonWidget

type ArrowButtonWidget struct {
	// contains filtered or unexported fields
}

func ArrowButton

func ArrowButton(dir Direction) *ArrowButtonWidget

func (*ArrowButtonWidget) Build

func (b *ArrowButtonWidget) Build()

Build implements Widget interface

func (*ArrowButtonWidget) ID

func (*ArrowButtonWidget) OnClick

func (b *ArrowButtonWidget) OnClick(onClick func()) *ArrowButtonWidget

type BulletTextWidget

type BulletTextWidget struct {
	// contains filtered or unexported fields
}

func BulletText

func BulletText(text string) *BulletTextWidget

func BulletTextf

func BulletTextf(format string, args ...interface{}) *BulletTextWidget

func (*BulletTextWidget) Build

func (bt *BulletTextWidget) Build()

Build implements Widget interface

type BulletWidget

type BulletWidget struct{}

func Bullet

func Bullet() *BulletWidget

func (*BulletWidget) Build

func (b *BulletWidget) Build()

Build implements Widget interface

type ButtonWidget

type ButtonWidget struct {
	// contains filtered or unexported fields
}

func Button

func Button(id string) *ButtonWidget

func Buttonf

func Buttonf(format string, args ...interface{}) *ButtonWidget

func (*ButtonWidget) Build

func (b *ButtonWidget) Build()

Build implements Widget interface

func (*ButtonWidget) Disabled

func (b *ButtonWidget) Disabled(d bool) *ButtonWidget

func (*ButtonWidget) OnClick

func (b *ButtonWidget) OnClick(onClick func()) *ButtonWidget

func (*ButtonWidget) Size

func (b *ButtonWidget) Size(width, height float32) *ButtonWidget

type Canvas

type Canvas struct {
	// contains filtered or unexported fields
}

Canvas represents imgui.DrawList for more details see examples/canvas

func GetCanvas

func GetCanvas() *Canvas

GetCanvas creates new Canvas

func (*Canvas) AddBezierCubic

func (c *Canvas) AddBezierCubic(pos0, cp0, cp1, pos1 image.Point, col color.RGBA, thickness float32, numSegments int)

AddBezierCubic draws bezier cubic

func (*Canvas) AddCircle

func (c *Canvas) AddCircle(center image.Point, radius float32, col color.RGBA, segments int, thickness float32)

AddCircle draws a circle

func (*Canvas) AddCircleFilled

func (c *Canvas) AddCircleFilled(center image.Point, radius float32, col color.RGBA)

AddCircleFilled draws a filled circle

func (*Canvas) AddImage

func (c *Canvas) AddImage(texture *Texture, pMin, pMax image.Point)

func (*Canvas) AddImageV

func (c *Canvas) AddImageV(texture *Texture, pMin, pMax, uvMin, uvMax image.Point, col color.RGBA)

func (*Canvas) AddLine

func (c *Canvas) AddLine(p1, p2 image.Point, col color.RGBA, thickness float32)

AddLine draws a line (from p1 to p2)

func (*Canvas) AddQuad

func (c *Canvas) AddQuad(p1, p2, p3, p4 image.Point, col color.RGBA, thickness float32)

AddQuad draws a quad

func (*Canvas) AddQuadFilled

func (c *Canvas) AddQuadFilled(p1, p2, p3, p4 image.Point, col color.RGBA)

AddQuadFilled draws a filled quad

func (*Canvas) AddRect

func (c *Canvas) AddRect(pMin, pMax image.Point, col color.RGBA, rounding float32, roundingCorners DrawFlags, thickness float32)

AddRect draws a rectangle

func (*Canvas) AddRectFilled

func (c *Canvas) AddRectFilled(pMin, pMax image.Point, col color.RGBA, rounding float32, roundingCorners DrawFlags)

AddRectFilled draws a rectangle filled with `col`

func (*Canvas) AddText

func (c *Canvas) AddText(pos image.Point, col color.RGBA, text string)

AddText draws text

func (*Canvas) AddTriangle

func (c *Canvas) AddTriangle(p1, p2, p3 image.Point, col color.RGBA, thickness float32)

AddTriangle draws a triangle

func (*Canvas) AddTriangleFilled

func (c *Canvas) AddTriangleFilled(p1, p2, p3 image.Point, col color.RGBA)

AddTriangleFilled draws a filled triangle

func (*Canvas) PathArcTo

func (c *Canvas) PathArcTo(center image.Point, radius, min, max float32, numSegments int)

func (*Canvas) PathArcToFast

func (c *Canvas) PathArcToFast(center image.Point, radius float32, min12, max12 int)

func (*Canvas) PathBezierCubicCurveTo

func (c *Canvas) PathBezierCubicCurveTo(p1, p2, p3 image.Point, numSegments int)

func (*Canvas) PathClear

func (c *Canvas) PathClear()

func (*Canvas) PathFillConvex

func (c *Canvas) PathFillConvex(col color.RGBA)

func (*Canvas) PathLineTo

func (c *Canvas) PathLineTo(pos image.Point)

func (*Canvas) PathLineToMergeDuplicate

func (c *Canvas) PathLineToMergeDuplicate(pos image.Point)

func (*Canvas) PathStroke

func (c *Canvas) PathStroke(col color.RGBA, closed bool, thickness float32)

type CheckboxWidget

type CheckboxWidget struct {
	// contains filtered or unexported fields
}

func Checkbox

func Checkbox(text string, selected *bool) *CheckboxWidget

func (*CheckboxWidget) Build

func (c *CheckboxWidget) Build()

Build implements Widget interface

func (*CheckboxWidget) OnChange

func (c *CheckboxWidget) OnChange(onChange func()) *CheckboxWidget

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) Build

func (c *ChildWidget) Build()

Build implements Widget interface

func (*ChildWidget) Flags

func (c *ChildWidget) Flags(flags WindowFlags) *ChildWidget

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 CodeEditor

func CodeEditor() *CodeEditorWidget

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) Copy

func (ce *CodeEditorWidget) Copy()

Copy copies selection

func (*CodeEditorWidget) Cut

func (ce *CodeEditorWidget) Cut()

Cut cuts selection

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

func (*CodeEditorWidget) GetScreenCursorPos

func (ce *CodeEditorWidget) GetScreenCursorPos() (x, y int)

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

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

func (*CodeEditorWidget) LanguageDefinition

func (ce *CodeEditorWidget) LanguageDefinition(definition LanguageDefinition) *CodeEditorWidget

LanguageDefinition sets code editor language definition

func (*CodeEditorWidget) Paste

func (ce *CodeEditorWidget) Paste()

Paste does the same as Ctrl+V

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 = 0
	// ColorEditFlagsNoAlpha ignores Alpha component (read 3 components from the input pointer).
	ColorEditFlagsNoAlpha ColorEditFlags = 1 << 1
	// ColorEditFlagsNoPicker disables picker when clicking on colored square.
	ColorEditFlagsNoPicker ColorEditFlags = 1 << 2
	// ColorEditFlagsNoOptions disables toggling options menu when right-clicking on inputs/small preview.
	ColorEditFlagsNoOptions ColorEditFlags = 1 << 3
	// ColorEditFlagsNoSmallPreview disables colored square preview next to the inputs. (e.g. to show only the inputs).
	ColorEditFlagsNoSmallPreview ColorEditFlags = 1 << 4
	// ColorEditFlagsNoInputs disables inputs sliders/text widgets (e.g. to show only the small preview colored square).
	ColorEditFlagsNoInputs ColorEditFlags = 1 << 5
	// ColorEditFlagsNoTooltip disables tooltip when hovering the preview.
	ColorEditFlagsNoTooltip ColorEditFlags = 1 << 6
	// ColorEditFlagsNoLabel disables display of inline text label (the label is still forwarded to the tooltip and picker).
	ColorEditFlagsNoLabel ColorEditFlags = 1 << 7
	// ColorEditFlagsNoSidePreview disables bigger color preview on right side of the picker, use small colored square preview instead.
	ColorEditFlagsNoSidePreview ColorEditFlags = 1 << 8
	// ColorEditFlagsNoDragDrop disables drag and drop target. ColorButton: disable drag and drop source.
	ColorEditFlagsNoDragDrop ColorEditFlags = 1 << 9
	// ColorEditFlagsNoBorder disables border (which is enforced by default).
	ColorEditFlagsNoBorder ColorEditFlags = 1 << 10

	// ColorEditFlagsAlphaBar shows vertical alpha bar/gradient in picker.
	ColorEditFlagsAlphaBar ColorEditFlags = 1 << 16
	// ColorEditFlagsAlphaPreview displays preview as a transparent color over a checkerboard, instead of opaque.
	ColorEditFlagsAlphaPreview ColorEditFlags = 1 << 17
	// ColorEditFlagsAlphaPreviewHalf displays half opaque / half checkerboard, instead of opaque.
	ColorEditFlagsAlphaPreviewHalf ColorEditFlags = 1 << 18
	// 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 = 1 << 19
	// ColorEditFlagsRGB sets the format as RGB.
	ColorEditFlagsRGB ColorEditFlags = 1 << 20
	// ColorEditFlagsHSV sets the format as HSV.
	ColorEditFlagsHSV ColorEditFlags = 1 << 21
	// ColorEditFlagsHEX sets the format as HEX.
	ColorEditFlagsHEX ColorEditFlags = 1 << 22
	// ColorEditFlagsUint8 _display_ values formatted as 0..255.
	ColorEditFlagsUint8 ColorEditFlags = 1 << 23
	// ColorEditFlagsFloat _display_ values formatted as 0.0f..1.0f floats instead of 0..255 integers. No round-trip of value via integers.
	ColorEditFlagsFloat ColorEditFlags = 1 << 24

	// ColorEditFlagsPickerHueBar shows bar for Hue, rectangle for Sat/Value.
	ColorEditFlagsPickerHueBar ColorEditFlags = 1 << 25
	// ColorEditFlagsPickerHueWheel shows wheel for Hue, triangle for Sat/Value.
	ColorEditFlagsPickerHueWheel ColorEditFlags = 1 << 26
	// ColorEditFlagsInputRGB enables input and output data in RGB format.
	ColorEditFlagsInputRGB ColorEditFlags = 1 << 27
	// ColorEditFlagsInputHSV enables input and output data in HSV format.
	ColorEditFlagsInputHSV ColorEditFlags = 1 << 28
)

type ColorEditWidget

type ColorEditWidget struct {
	// contains filtered or unexported fields
}

func ColorEdit

func ColorEdit(label string, c *color.RGBA) *ColorEditWidget

func (*ColorEditWidget) Build

func (ce *ColorEditWidget) Build()

Build implements Widget interface

func (*ColorEditWidget) Flags

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
}

func Column

func Column(widgets ...Widget) *ColumnWidget

Column layout will place all widgets one by one vertically.

func (*ColumnWidget) Build

func (g *ColumnWidget) Build()

Build implements Widget interface

type ComboCustomWidget

type ComboCustomWidget struct {
	// contains filtered or unexported fields
}

func ComboCustom

func ComboCustom(label, previewValue string) *ComboCustomWidget

func (*ComboCustomWidget) Build

func (cc *ComboCustomWidget) Build()

Build implements Widget interface

func (*ComboCustomWidget) Flags

func (*ComboCustomWidget) Layout

func (cc *ComboCustomWidget) Layout(widgets ...Widget) *ComboCustomWidget

func (*ComboCustomWidget) Size

func (cc *ComboCustomWidget) Size(width float32) *ComboCustomWidget

type ComboFlags

type ComboFlags int
const (
	// ComboFlagNone default ComboFlags = 0
	ComboFlagNone ComboFlags = 0
	// ComboFlagPopupAlignLeft aligns the popup toward the left by default.
	ComboFlagPopupAlignLeft ComboFlags = 1 << 0
	// ComboFlagHeightSmall 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().
	ComboFlagHeightSmall ComboFlags = 1 << 1
	// ComboFlagHeightRegular has max ~8 items visible (default).
	ComboFlagHeightRegular ComboFlags = 1 << 2
	// ComboFlagHeightLarge has max ~20 items visible.
	ComboFlagHeightLarge ComboFlags = 1 << 3
	// ComboFlagHeightLargest has as many fitting items as possible.
	ComboFlagHeightLargest ComboFlags = 1 << 4
	// ComboFlagNoArrowButton displays on the preview box without the square arrow button.
	ComboFlagNoArrowButton ComboFlags = 1 << 5
	// ComboFlagNoPreview displays only a square arrow button.
	ComboFlagNoPreview ComboFlags = 1 << 6
)

type ComboWidget

type ComboWidget struct {
	// contains filtered or unexported fields
}

func Combo

func Combo(label, previewValue string, items []string, selected *int32) *ComboWidget

func (*ComboWidget) Build

func (c *ComboWidget) Build()

Build implements Widget interface

func (*ComboWidget) Flags

func (c *ComboWidget) Flags(flags ComboFlags) *ComboWidget

func (*ComboWidget) OnChange

func (c *ComboWidget) OnChange(onChange func()) *ComboWidget

func (*ComboWidget) Size

func (c *ComboWidget) Size(width float32) *ComboWidget

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 (*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

func (*CustomWidget) Build

func (c *CustomWidget) Build()

Build implements Widget interface

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) OnChange

func (d *DatePickerWidget) OnChange(onChange func()) *DatePickerWidget

func (*DatePickerWidget) Size

func (d *DatePickerWidget) Size(width float32) *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 Direction

type Direction uint8

Direction represents a ArrowButton direction

const (
	DirectionLeft Direction = iota
	DirectionRight
	DirectionUp
	DirectionDown
)

directions

type Disposable

type Disposable interface {
	Dispose()
}

type DragIntWidget

type DragIntWidget struct {
	// contains filtered or unexported fields
}

func DragInt

func DragInt(label string, value *int32, min, max int32) *DragIntWidget

func (*DragIntWidget) Build

func (d *DragIntWidget) Build()

Build implements Widget interface

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

func (*DummyWidget) Build

func (d *DummyWidget) Build()

Build implements Widget interface

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 Event

func Event() *EventHandler

Event adds a new event to widget above

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) 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 FocusedFlags

type FocusedFlags int

FocusedFlags represents imgui.FocusedFlags

const (
	// FocusedFlagsNone default FocusedFlags = 0
	FocusedFlagsNone FocusedFlags = 0
	// FocusedFlagsChildWindows matches if any children of the window is focused
	FocusedFlagsChildWindows FocusedFlags = 1 << 0
	// FocusedFlagsRootWindow tests from root window (top most parent of the current hierarchy)
	FocusedFlagsRootWindow FocusedFlags = 1 << 1
	// FocusedFlagsAnyWindow matches if any window is focused.
	FocusedFlagsAnyWindow FocusedFlags = 1 << 2
	// FocusedFlagsRootAndChildWindows combines FocusedFlagsRootWindow and FocusedFlagsChildWindows.
	FocusedFlagsRootAndChildWindows = FocusedFlagsRootWindow | FocusedFlagsChildWindows
)

type FontInfo

type FontInfo struct {
	// contains filtered or unexported fields
}

FontInfo represents a the font.

func (*FontInfo) String

func (f *FontInfo) String() string

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 (*HSplitterWidget) Size

func (h *HSplitterWidget) Size(width, height float32) *HSplitterWidget

type HoveredFlags

type HoveredFlags int

HoveredFlags represents a hovered flags

const (
	// HoveredFlagsNone is the default and matches 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 = 0
	// HoveredFlagsChildWindows is for IsWindowHovered() and matches if any children of the window is hovered
	HoveredFlagsChildWindows HoveredFlags = 1 << 0
	// HoveredFlagsRootWindow is for IsWindowHovered() and tests from root window (top most parent of the current hierarchy)
	HoveredFlagsRootWindow HoveredFlags = 1 << 1
	// HoveredFlagsAnyWindow is for IsWindowHovered() and matches if any window is hovered
	HoveredFlagsAnyWindow HoveredFlags = 1 << 2
	// HoveredFlagsAllowWhenBlockedByPopup matches even if a popup window is normally blocking access to this item/window
	HoveredFlagsAllowWhenBlockedByPopup HoveredFlags = 1 << 3
	// HoveredFlagsAllowWhenBlockedByModal matches even if a modal popup window is normally blocking access to this item/window.
	// UNIMPLEMENTED in imgui.
	// HoveredFlagsAllowWhenBlockedByModal  HoveredFlags   = 1 << 4
	// HoveredFlagsAllowWhenBlockedByActiveItem matches true even if an active item is blocking access to this item/window.
	// Useful for Drag and Drop patterns.
	HoveredFlagsAllowWhenBlockedByActiveItem HoveredFlags = 1 << 5
	// HoveredFlagsAllowWhenOverlapped matches even if the position is obstructed or overlapped by another window
	HoveredFlagsAllowWhenOverlapped HoveredFlags = 1 << 6
	// HoveredFlagsAllowWhenDisabled matches even if the item is disabled
	HoveredFlagsAllowWhenDisabled HoveredFlags = 1 << 7
	// HoveredFlagsRectOnly combines HoveredFlagsAllowWhenBlockedByPopup,
	// HoveredFlagsAllowWhenBlockedByActiveItem, and HoveredFlagsAllowWhenOverlapped.
	HoveredFlagsRectOnly HoveredFlags = HoveredFlagsAllowWhenBlockedByPopup |
		HoveredFlagsAllowWhenBlockedByActiveItem | HoveredFlagsAllowWhenOverlapped
	// HoveredFlagsRootAndChildWindows combines HoveredFlagsRootWindow and HoveredFlagsChildWindows.
	HoveredFlagsRootAndChildWindows HoveredFlags = HoveredFlagsRootWindow | HoveredFlagsChildWindows
)

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
}

func ImageButton

func ImageButton(texture *Texture) *ImageButtonWidget

func (*ImageButtonWidget) BgColor

func (b *ImageButtonWidget) BgColor(bgColor color.RGBA) *ImageButtonWidget

func (*ImageButtonWidget) Build

func (b *ImageButtonWidget) Build()

Build implements Widget interface

func (*ImageButtonWidget) FramePadding

func (b *ImageButtonWidget) FramePadding(padding int) *ImageButtonWidget

func (*ImageButtonWidget) OnClick

func (b *ImageButtonWidget) OnClick(onClick func()) *ImageButtonWidget

func (*ImageButtonWidget) Size

func (b *ImageButtonWidget) Size(width, height float32) *ImageButtonWidget

func (*ImageButtonWidget) TintColor

func (b *ImageButtonWidget) TintColor(tintColor color.RGBA) *ImageButtonWidget

func (*ImageButtonWidget) UV

type ImageButtonWithRgbaWidget

type ImageButtonWithRgbaWidget struct {
	*ImageButtonWidget
	// contains filtered or unexported fields
}

func ImageButtonWithRgba

func ImageButtonWithRgba(rgba image.Image) *ImageButtonWithRgbaWidget

func (*ImageButtonWithRgbaWidget) BgColor

func (*ImageButtonWithRgbaWidget) Build

func (b *ImageButtonWithRgbaWidget) Build()

Build implements Widget interface

func (*ImageButtonWithRgbaWidget) FramePadding

func (b *ImageButtonWithRgbaWidget) FramePadding(padding int) *ImageButtonWithRgbaWidget

func (*ImageButtonWithRgbaWidget) OnClick

func (b *ImageButtonWithRgbaWidget) OnClick(onClick func()) *ImageButtonWithRgbaWidget

func (*ImageButtonWithRgbaWidget) Size

func (*ImageButtonWithRgbaWidget) TintColor

func (*ImageButtonWithRgbaWidget) UV

type ImageState

type ImageState struct {
	// contains filtered or unexported fields
}

func (*ImageState) Dispose

func (is *ImageState) Dispose()

type ImageWidget

type ImageWidget struct {
	// contains filtered or unexported fields
}

func Image

func Image(texture *Texture) *ImageWidget

func (*ImageWidget) BorderCol

func (i *ImageWidget) BorderCol(borderColor color.RGBA) *ImageWidget

func (*ImageWidget) Build

func (i *ImageWidget) Build()

Build implements Widget interface

func (*ImageWidget) OnClick

func (i *ImageWidget) OnClick(cb func()) *ImageWidget

func (*ImageWidget) Size

func (i *ImageWidget) Size(width, height float32) *ImageWidget

func (*ImageWidget) TintColor

func (i *ImageWidget) TintColor(tintColor color.RGBA) *ImageWidget

func (*ImageWidget) Uv

func (i *ImageWidget) Uv(uv0, uv1 image.Point) *ImageWidget

type ImageWithFileWidget

type ImageWithFileWidget struct {
	// contains filtered or unexported fields
}

func ImageWithFile

func ImageWithFile(imgPath string) *ImageWithFileWidget

func (*ImageWithFileWidget) Build

func (i *ImageWithFileWidget) Build()

Build implements Widget interface

func (*ImageWithFileWidget) OnClick

func (i *ImageWithFileWidget) OnClick(cb func()) *ImageWithFileWidget

func (*ImageWithFileWidget) Size

func (i *ImageWithFileWidget) Size(width, height float32) *ImageWithFileWidget

type ImageWithRgbaWidget

type ImageWithRgbaWidget struct {
	// contains filtered or unexported fields
}

func ImageWithRgba

func ImageWithRgba(rgba image.Image) *ImageWithRgbaWidget

func (*ImageWithRgbaWidget) Build

func (i *ImageWithRgbaWidget) Build()

Build implements Widget interface

func (*ImageWithRgbaWidget) OnClick

func (i *ImageWithRgbaWidget) OnClick(cb func()) *ImageWithRgbaWidget

func (*ImageWithRgbaWidget) Size

func (i *ImageWithRgbaWidget) Size(width, height float32) *ImageWithRgbaWidget

type ImageWithURLWidget

type ImageWithURLWidget struct {
	// contains filtered or unexported fields
}

func ImageWithURL

func ImageWithURL(url string) *ImageWithURLWidget

func (*ImageWithURLWidget) Build

func (i *ImageWithURLWidget) Build()

Build implements Widget interface

func (*ImageWithURLWidget) LayoutForFailure

func (i *ImageWithURLWidget) LayoutForFailure(widgets ...Widget) *ImageWithURLWidget

func (*ImageWithURLWidget) LayoutForLoading

func (i *ImageWithURLWidget) LayoutForLoading(widgets ...Widget) *ImageWithURLWidget

func (*ImageWithURLWidget) OnClick

func (i *ImageWithURLWidget) OnClick(cb func()) *ImageWithURLWidget

func (*ImageWithURLWidget) OnFailure

func (i *ImageWithURLWidget) OnFailure(onFailure func(error)) *ImageWithURLWidget

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

func (*ImageWithURLWidget) Timeout

func (i *ImageWithURLWidget) Timeout(downloadTimeout time.Duration) *ImageWithURLWidget

type InputFloatWidget

type InputFloatWidget struct {
	// contains filtered or unexported fields
}

func InputFloat

func InputFloat(value *float32) *InputFloatWidget

func (*InputFloatWidget) Build

func (i *InputFloatWidget) Build()

Build implements Widget interface

func (*InputFloatWidget) Flags

func (*InputFloatWidget) Format

func (i *InputFloatWidget) Format(format string) *InputFloatWidget

func (*InputFloatWidget) Label

func (i *InputFloatWidget) Label(label string) *InputFloatWidget

func (*InputFloatWidget) Labelf

func (i *InputFloatWidget) Labelf(format string, args ...interface{}) *InputFloatWidget

func (*InputFloatWidget) OnChange

func (i *InputFloatWidget) OnChange(onChange func()) *InputFloatWidget

func (*InputFloatWidget) Size

func (i *InputFloatWidget) Size(width float32) *InputFloatWidget

type InputIntWidget

type InputIntWidget struct {
	// contains filtered or unexported fields
}

func InputInt

func InputInt(value *int32) *InputIntWidget

func (*InputIntWidget) Build

func (i *InputIntWidget) Build()

Build implements Widget interface

func (*InputIntWidget) Flags

func (i *InputIntWidget) Flags(flags InputTextFlags) *InputIntWidget

func (*InputIntWidget) Label

func (i *InputIntWidget) Label(label string) *InputIntWidget

func (*InputIntWidget) Labelf

func (i *InputIntWidget) Labelf(format string, args ...interface{}) *InputIntWidget

func (*InputIntWidget) OnChange

func (i *InputIntWidget) OnChange(onChange func()) *InputIntWidget

func (*InputIntWidget) Size

func (i *InputIntWidget) Size(width float32) *InputIntWidget

type InputTextFlags

type InputTextFlags int
const (
	InputTextFlagsNone InputTextFlags = 0
	// Allow 0123456789.+-*/
	InputTextFlagsCharsDecimal InputTextFlags = 1 << 0
	// Allow 0123456789ABCDEFabcdef
	InputTextFlagsCharsHexadecimal InputTextFlags = 1 << 1
	// Turn a..z into A..Z
	InputTextFlagsCharsUppercase InputTextFlags = 1 << 2
	// Filter out spaces, tabs
	InputTextFlagsCharsNoBlank InputTextFlags = 1 << 3
	// Select entire text when first taking mouse focus
	InputTextFlagsAutoSelectAll InputTextFlags = 1 << 4
	// Return 'true' when Enter is pressed (as opposed to every time the value was modified).
	// Consider looking at the IsItemDeactivatedAfterEdit() function.
	InputTextFlagsEnterReturnsTrue InputTextFlags = 1 << 5
	// Callback on pressing TAB (for completion handling)
	InputTextFlagsCallbackCompletion InputTextFlags = 1 << 6
	// Callback on pressing Up/Down arrows (for history handling)
	InputTextFlagsCallbackHistory InputTextFlags = 1 << 7
	// Callback on each iteration. User code may query cursor position, modify text buffer.
	InputTextFlagsCallbackAlways InputTextFlags = 1 << 8
	// Callback on character inputs to replace or discard them. Modify 'EventChar' to replace or discard, or return 1 in callback to discard.
	InputTextFlagsCallbackCharFilter InputTextFlags = 1 << 9
	// Pressing TAB input a '\t' character into the text field
	InputTextFlagsAllowTabInput InputTextFlags = 1 << 10
	// 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 = 1 << 11
	// Disable following the cursor horizontally
	InputTextFlagsNoHorizontalScroll InputTextFlags = 1 << 12
	// Overwrite mode
	InputTextFlagsAlwaysOverwrite InputTextFlags = 1 << 13
	// Read-only mode
	InputTextFlagsReadOnly InputTextFlags = 1 << 14
	// Password mode, display all characters as '*'
	InputTextFlagsPassword InputTextFlags = 1 << 15
	// Disable 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 = 1 << 16
	// Allow 0123456789.+-*/eE (Scientific notation input)
	InputTextFlagsCharsScientific InputTextFlags = 1 << 17
	// Callback on buffer capacity changes request (beyond 'bufsize' parameter value), allowing the string to grow.
	// Notify when the string wants to be resized (for string types which hold a cache of their Size).
	// You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imguistdlib.h for an example of using this)
	InputTextFlagsCallbackResize InputTextFlags = 1 << 18
	// Callback on any edit (note that InputText() already returns true on edit,
	// the callback is useful mainly to manipulate the underlying buffer while focus is active)
	InputTextFlagsCallbackEdit InputTextFlags = 1 << 19
)

type InputTextMultilineWidget

type InputTextMultilineWidget struct {
	// contains filtered or unexported fields
}

InputTextMultilineWidget represents multiline text input widget 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

func (*InputTextMultilineWidget) Flags

func (*InputTextMultilineWidget) Label

Label sets input field label

func (*InputTextMultilineWidget) Labelf

func (i *InputTextMultilineWidget) Labelf(format string, args ...interface{}) *InputTextMultilineWidget

Labelf is formatting version of Label

func (*InputTextMultilineWidget) OnChange

func (i *InputTextMultilineWidget) OnChange(onChange func()) *InputTextMultilineWidget

func (*InputTextMultilineWidget) Size

type InputTextWidget

type InputTextWidget struct {
	// contains filtered or unexported fields
}

func InputText

func InputText(value *string) *InputTextWidget

func (*InputTextWidget) AutoComplete

func (i *InputTextWidget) AutoComplete(candidates []string) *InputTextWidget

AutoComplete enables auto complete popup by using _ 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

func (*InputTextWidget) Flags

func (*InputTextWidget) Hint

func (i *InputTextWidget) Hint(hint string) *InputTextWidget

func (*InputTextWidget) Label

func (i *InputTextWidget) Label(label string) *InputTextWidget

func (*InputTextWidget) Labelf

func (i *InputTextWidget) Labelf(format string, args ...interface{}) *InputTextWidget

func (*InputTextWidget) OnChange

func (i *InputTextWidget) OnChange(onChange func()) *InputTextWidget

func (*InputTextWidget) Size

func (i *InputTextWidget) Size(width float32) *InputTextWidget

type InvisibleButtonWidget

type InvisibleButtonWidget struct {
	// contains filtered or unexported fields
}

func InvisibleButton

func InvisibleButton() *InvisibleButtonWidget

func (*InvisibleButtonWidget) Build

func (b *InvisibleButtonWidget) Build()

Build implements Widget interface

func (*InvisibleButtonWidget) ID

func (*InvisibleButtonWidget) OnClick

func (b *InvisibleButtonWidget) OnClick(onClick func()) *InvisibleButtonWidget

func (*InvisibleButtonWidget) Size

func (b *InvisibleButtonWidget) Size(width, height float32) *InvisibleButtonWidget

type Key

type Key glfw.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
}

func Label

func Label(label string) *LabelWidget

func Labelf

func Labelf(format string, args ...interface{}) *LabelWidget

func (*LabelWidget) Build

func (l *LabelWidget) Build()

Build implements Widget interface

func (*LabelWidget) Font

func (l *LabelWidget) Font(font *FontInfo) *LabelWidget

func (*LabelWidget) Wrapped

func (l *LabelWidget) Wrapped(wrapped bool) *LabelWidget

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/HACKERALERT/giu/issues/290)

func RangeBuilder

func RangeBuilder(id string, values []interface{}, builder func(int, interface{}) Widget) Layout

RangeBuilder batch create widgets and render only which is visible.

func (Layout) Build

func (l Layout) Build()

Build implements Widget interface

func (Layout) Range

func (l Layout) Range(rangeFunc func(Widget))

Range ranges ofer the Layout, calling rangeFunc on each loop iteration.

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 MainMenuBarWidget struct {
	// contains filtered or unexported fields
}
func MainMenuBar() *MainMenuBarWidget
func (m *MainMenuBarWidget) Build()

Build implements Widget interface

func (m *MainMenuBarWidget) Layout(widgets ...Widget) *MainMenuBarWidget

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) SetBgColor

func (w *MasterWindow) SetBgColor(bgColor color.RGBA)

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))

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) 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)
)

type Match

type Match struct {
	// The matched string.
	Str string
	// The index of the matched string in the supplied slice.
	Index int
	// The indexes of matched characters. Useful for highlighting matches.
	MatchedIndexes []int
	// Score used to rank matches
	Score int
}
type MenuBarWidget struct {
	// contains filtered or unexported fields
}
func MenuBar() *MenuBarWidget
func (m *MenuBarWidget) Build()

Build implements Widget interface

func (m *MenuBarWidget) Layout(widgets ...Widget) *MenuBarWidget
type MenuItemWidget struct {
	// contains filtered or unexported fields
}
func MenuItem(label string) *MenuItemWidget
func MenuItemf(format string, args ...interface{}) *MenuItemWidget
func (m *MenuItemWidget) Build()

Build implements Widget interface

func (m *MenuItemWidget) Enabled(e bool) *MenuItemWidget
func (m *MenuItemWidget) OnClick(onClick func()) *MenuItemWidget
func (m *MenuItemWidget) Selected(s bool) *MenuItemWidget
type MenuWidget struct {
	// contains filtered or unexported fields
}
func Menu(label string) *MenuWidget
func Menuf(format string, args ...interface{}) *MenuWidget
func (m *MenuWidget) Build()

Build implements Widget interface

func (m *MenuWidget) Enabled(e bool) *MenuWidget
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
const (
	MouseButtonLeft   MouseButton = 0
	MouseButtonRight  MouseButton = 1
	MouseButtonMiddle MouseButton = 2
)

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
)

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
const (
	// default
	PlotAxisFlagsNone PlotAxisFlags = 0
	// the axis label will not be displayed (axis labels also hidden if the supplied string name is NULL)
	PlotAxisFlagsNoLabel PlotAxisFlags = 1 << 0
	// the axis grid lines will not be displayed
	PlotAxisFlagsNoGridLines PlotAxisFlags = 1 << 1
	// the axis tick marks will not be displayed
	PlotAxisFlagsNoTickMarks PlotAxisFlags = 1 << 2
	// the axis tick labels will not be displayed
	PlotAxisFlagsNoTickLabels PlotAxisFlags = 1 << 3
	// a logartithmic (base 10) axis scale will be used (mutually exclusive with PlotAxisFlagsTime)
	PlotAxisFlagsLogScale PlotAxisFlags = 1 << 4
	// axis will display date/time formatted labels (mutually exclusive with PlotAxisFlagsLogScale)
	PlotAxisFlagsTime PlotAxisFlags = 1 << 5
	// the axis will be inverted
	PlotAxisFlagsInvert PlotAxisFlags = 1 << 6
	// the axis minimum value will be locked when panning/zooming
	PlotAxisFlagsLockMin PlotAxisFlags = 1 << 7
	// the axis maximum value will be locked when panning/zooming
	PlotAxisFlagsLockMax       PlotAxisFlags = 1 << 8
	PlotAxisFlagsLock          PlotAxisFlags = PlotAxisFlagsLockMin | PlotAxisFlagsLockMax
	PlotAxisFlagsNoDecorations PlotAxisFlags = PlotAxisFlagsNoLabel | PlotAxisFlagsNoGridLines |
		PlotAxisFlagsNoTickMarks | PlotAxisFlagsNoTickLabels
)

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) Plot

func (p *PlotBarHWidget) Plot()

Plot implements plot interface

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) Plot

func (p *PlotBarWidget) Plot()

Plot implements Plot interface

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 Plot

func Plot(title string) *PlotCanvasWidget

Plot adds creates a new 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 PlotFlags

type PlotFlags int
const (
	// default
	PlotFlagsNone PlotFlags = 0
	// the plot title will not be displayed (titles are also hidden if preceded by double hashes, e.g. "##MyPlot")
	PlotFlagsNoTitle PlotFlags = 1 << 0
	// the legend will not be displayed
	PlotFlagsNoLegend PlotFlags = 1 << 1
	// the user will not be able to open context menus with right-click
	PlotFlagsNoMenus PlotFlags = 1 << 2
	// the user will not be able to box-select with right-click drag
	PlotFlagsNoBoxSelect PlotFlags = 1 << 3
	// the mouse position, in plot coordinates, will not be displayed inside of the plot
	PlotFlagsNoMousePos PlotFlags = 1 << 4
	// plot items will not be highlighted when their legend entry is hovered
	PlotFlagsNoHighlight PlotFlags = 1 << 5
	// a child window region will not be used to capture mouse scroll (can boost performance for single Gui window applications)
	PlotFlagsNoChild PlotFlags = 1 << 6
	// primary x and y axes will be constrained to have the same units/pixel (does not apply to auxiliary y-axes)
	PlotFlagsEqual PlotFlags = 1 << 7
	// enable a 2nd y-axis on the right side
	PlotFlagsYAxis2 PlotFlags = 1 << 8
	// enable a 3rd y-axis on the right side
	PlotFlagsYAxis3 PlotFlags = 1 << 9
	// the user will be able to draw query rects with middle-mouse or CTRL + right-click drag
	PlotFlagsQuery PlotFlags = 1 << 10
	// the default mouse cursor will be replaced with a crosshair when hovered
	PlotFlagsCrosshairs PlotFlags = 1 << 11
	// plot lines will be software anti-aliased (not recommended for high density plots, prefer MSAA)
	PlotFlagsAntiAliased PlotFlags = 1 << 12
	PlotFlagsCanvasOnly  PlotFlags = PlotFlagsNoTitle | PlotFlagsNoLegend | PlotFlagsNoMenus | PlotFlagsNoBoxSelect | PlotFlagsNoMousePos
)

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) Plot

func (p *PlotLineWidget) Plot()

Plot implements Plot interface

func (*PlotLineWidget) SetPlotYAxis

func (p *PlotLineWidget) SetPlotYAxis(yAxis ImPlotYAxis) *PlotLineWidget

SetPlotYAxis sets yAxis parameters

func (*PlotLineWidget) X0

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) Plot

func (p *PlotLineXYWidget) Plot()

Plot implements Plot interface

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 (*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 (*PlotScatterWidget) XScale

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

type PlotTicker struct {
	Position float64
	Label    string
}

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
}

func PopupModal

func PopupModal(name string) *PopupModalWidget

func (*PopupModalWidget) Build

func (p *PopupModalWidget) Build()

Build implements Widget interface

func (*PopupModalWidget) Flags

func (*PopupModalWidget) IsOpen

func (p *PopupModalWidget) IsOpen(open *bool) *PopupModalWidget

func (*PopupModalWidget) Layout

func (p *PopupModalWidget) Layout(widgets ...Widget) *PopupModalWidget

type PopupWidget

type PopupWidget struct {
	// contains filtered or unexported fields
}
func Popup(name string) *PopupWidget

func (*PopupWidget) Build

func (p *PopupWidget) Build()

Build implements Widget interface

func (*PopupWidget) Flags

func (p *PopupWidget) Flags(flags WindowFlags) *PopupWidget

func (*PopupWidget) Layout

func (p *PopupWidget) Layout(widgets ...Widget) *PopupWidget

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 ...interface{}) *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
}

func RadioButton

func RadioButton(text string, active bool) *RadioButtonWidget

func (*RadioButtonWidget) Build

func (r *RadioButtonWidget) Build()

Build implements Widget interface

func (*RadioButtonWidget) OnChange

func (r *RadioButtonWidget) OnChange(onChange func()) *RadioButtonWidget

type RowWidget

type RowWidget struct {
	// contains filtered or unexported fields
}

RowWidget joins a layout into one line calls imgui.SameLine()

func Row

func Row(widgets ...Widget) *RowWidget

Row creates RowWidget

func (*RowWidget) Build

func (l *RowWidget) Build()

Build implements Widget interface

type SelectableFlags

type SelectableFlags int

SelectableFlags represents imgui.SelectableFlags

const (
	// SelectableFlagsNone default SelectableFlags = 0
	SelectableFlagsNone SelectableFlags = 0
	// SelectableFlagsDontClosePopups makes clicking the selectable not close any parent popup windows.
	SelectableFlagsDontClosePopups SelectableFlags = 1 << 0
	// SelectableFlagsSpanAllColumns allows the selectable frame to span all columns (text will still fit in current column).
	SelectableFlagsSpanAllColumns SelectableFlags = 1 << 1
	// SelectableFlagsAllowDoubleClick generates press events on double clicks too.
	SelectableFlagsAllowDoubleClick SelectableFlags = 1 << 2
	// SelectableFlagsDisabled disallows selection and displays text in a greyed out color.
	SelectableFlagsDisabled SelectableFlags = 1 << 3
)

type SelectableWidget

type SelectableWidget struct {
	// contains filtered or unexported fields
}

func Selectable

func Selectable(label string) *SelectableWidget

func Selectablef

func Selectablef(format string, args ...interface{}) *SelectableWidget

func (*SelectableWidget) Build

func (s *SelectableWidget) Build()

Build implements Widget interface

func (*SelectableWidget) Flags

func (*SelectableWidget) OnClick

func (s *SelectableWidget) OnClick(onClick func()) *SelectableWidget

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

func (*SelectableWidget) Selected

func (s *SelectableWidget) Selected(selected bool) *SelectableWidget

func (*SelectableWidget) Size

func (s *SelectableWidget) Size(width, height float32) *SelectableWidget

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
}

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

	// LocLShortcut is registered for current window only
	LocalShortcut ShortcutType = false
)

type SliderFlags

type SliderFlags int
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
)

type SliderFloatWidget

type SliderFloatWidget struct {
	// contains filtered or unexported fields
}

func SliderFloat

func SliderFloat(value *float32, min, max float32) *SliderFloatWidget

func (*SliderFloatWidget) Build

func (sf *SliderFloatWidget) Build()

Build implements Widget interface

func (*SliderFloatWidget) Format

func (sf *SliderFloatWidget) Format(format string) *SliderFloatWidget

func (*SliderFloatWidget) Label

func (sf *SliderFloatWidget) Label(label string) *SliderFloatWidget

func (*SliderFloatWidget) Labelf

func (sf *SliderFloatWidget) Labelf(format string, args ...interface{}) *SliderFloatWidget

func (*SliderFloatWidget) OnChange

func (sf *SliderFloatWidget) OnChange(onChange func()) *SliderFloatWidget

func (*SliderFloatWidget) Size

func (sf *SliderFloatWidget) Size(width float32) *SliderFloatWidget

type SliderIntWidget

type SliderIntWidget struct {
	// contains filtered or unexported fields
}

func SliderInt

func SliderInt(value *int32, min, max int32) *SliderIntWidget

func (*SliderIntWidget) Build

func (s *SliderIntWidget) Build()

Build implements Widget interface

func (*SliderIntWidget) Format

func (s *SliderIntWidget) Format(format string) *SliderIntWidget

func (*SliderIntWidget) Label

func (s *SliderIntWidget) Label(label string) *SliderIntWidget

func (*SliderIntWidget) Labelf

func (s *SliderIntWidget) Labelf(format string, args ...interface{}) *SliderIntWidget

func (*SliderIntWidget) OnChange

func (s *SliderIntWidget) OnChange(onChange func()) *SliderIntWidget

func (*SliderIntWidget) Size

func (s *SliderIntWidget) Size(width float32) *SliderIntWidget

type SmallButtonWidget

type SmallButtonWidget struct {
	// contains filtered or unexported fields
}

func SmallButton

func SmallButton(id string) *SmallButtonWidget

func SmallButtonf

func SmallButtonf(format string, args ...interface{}) *SmallButtonWidget

func (*SmallButtonWidget) Build

func (b *SmallButtonWidget) Build()

Build implements Widget interface

func (*SmallButtonWidget) OnClick

func (b *SmallButtonWidget) OnClick(onClick func()) *SmallButtonWidget

type SpacingWidget

type SpacingWidget struct{}

func Spacing

func Spacing() *SpacingWidget

func (*SpacingWidget) Build

func (s *SpacingWidget) Build()

Build implements Widget interface

type SplitDirection

type SplitDirection uint8
const (
	DirectionHorizontal SplitDirection = 1 << iota
	DirectionVertical
)

type SplitLayoutState

type SplitLayoutState struct {
	// contains filtered or unexported fields
}

func (*SplitLayoutState) Dispose

func (s *SplitLayoutState) Dispose()

Dispose implements Disposable interface

type SplitLayoutWidget

type SplitLayoutWidget struct {
	// contains filtered or unexported fields
}

func SplitLayout

func SplitLayout(direction SplitDirection, border bool, sashPos float32, layout1, layout2 Widget) *SplitLayoutWidget

func (*SplitLayoutWidget) Build

func (s *SplitLayoutWidget) Build()

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.

func (*StackWidget) Build

func (s *StackWidget) Build()

type StyleColorID

type StyleColorID int

StyleColorID identifies a color in the UI style.

const (
	StyleColorText                  StyleColorID = 0
	StyleColorTextDisabled          StyleColorID = 1
	StyleColorWindowBg              StyleColorID = 2
	StyleColorChildBg               StyleColorID = 3
	StyleColorPopupBg               StyleColorID = 4
	StyleColorBorder                StyleColorID = 5
	StyleColorBorderShadow          StyleColorID = 6
	StyleColorFrameBg               StyleColorID = 7
	StyleColorFrameBgHovered        StyleColorID = 8
	StyleColorFrameBgActive         StyleColorID = 9
	StyleColorTitleBg               StyleColorID = 10
	StyleColorTitleBgActive         StyleColorID = 11
	StyleColorTitleBgCollapsed      StyleColorID = 12
	StyleColorMenuBarBg             StyleColorID = 13
	StyleColorScrollbarBg           StyleColorID = 14
	StyleColorScrollbarGrab         StyleColorID = 15
	StyleColorScrollbarGrabHovered  StyleColorID = 16
	StyleColorScrollbarGrabActive   StyleColorID = 17
	StyleColorCheckMark             StyleColorID = 18
	StyleColorSliderGrab            StyleColorID = 19
	StyleColorSliderGrabActive      StyleColorID = 20
	StyleColorButton                StyleColorID = 21
	StyleColorButtonHovered         StyleColorID = 22
	StyleColorButtonActive          StyleColorID = 23
	StyleColorHeader                StyleColorID = 24
	StyleColorHeaderHovered         StyleColorID = 25
	StyleColorHeaderActive          StyleColorID = 26
	StyleColorSeparator             StyleColorID = 27
	StyleColorSeparatorHovered      StyleColorID = 28
	StyleColorSeparatorActive       StyleColorID = 29
	StyleColorResizeGrip            StyleColorID = 30
	StyleColorResizeGripHovered     StyleColorID = 31
	StyleColorResizeGripActive      StyleColorID = 32
	StyleColorTab                   StyleColorID = 33
	StyleColorTabHovered            StyleColorID = 34
	StyleColorTabActive             StyleColorID = 35
	StyleColorTabUnfocused          StyleColorID = 36
	StyleColorTabUnfocusedActive    StyleColorID = 37
	StyleColorPlotLines             StyleColorID = 38
	StyleColorPlotLinesHovered      StyleColorID = 39
	StyleColorProgressBarActive     StyleColorID = 40
	StyleColorPlotHistogram         StyleColorID = 40
	StyleColorPlotHistogramHovered  StyleColorID = 41
	StyleColorTableHeaderBg         StyleColorID = 42
	StyleColorTableBorderStrong     StyleColorID = 43
	StyleColorTableBorderLight      StyleColorID = 44
	StyleColorTableRowBg            StyleColorID = 45
	StyleColorTableRowBgAlt         StyleColorID = 46
	StyleColorTextSelectedBg        StyleColorID = 47
	StyleColorDragDropTarget        StyleColorID = 48
	StyleColorNavHighlight          StyleColorID = 49
	StyleColorNavWindowingHighlight StyleColorID = 50
	StyleColorNavWindowingDimBg     StyleColorID = 51
	StyleColorModalWindowDimBg      StyleColorID = 52
)

StyleColor identifier

type StyleSetter

type StyleSetter struct {
	// contains filtered or unexported fields
}

StyleSetter is a user-friendly way to manage imgui styles

func Style

func Style() *StyleSetter

Style initializes a style setter (see examples/setstyle)

func (*StyleSetter) Build

func (ss *StyleSetter) Build()

Build implements Widget

func (*StyleSetter) SetColor

func (ss *StyleSetter) SetColor(colorID StyleColorID, col color.RGBA) *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) SetStyle

func (ss *StyleSetter) SetStyle(varID StyleVarID, width, height float32) *StyleSetter

SetStyle sets styleVarID to width and height

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 int

StyleVarID identifies a style variable in the UI style.

const (
	// StyleVarAlpha is a float
	StyleVarAlpha StyleVarID = iota
	// float     DisabledAlpha
	StyleVarDisabledAlpha
	// StyleVarWindowPadding is a Vec2
	StyleVarWindowPadding
	// StyleVarWindowRounding is a float
	StyleVarWindowRounding
	// StyleVarWindowBorderSize is a float
	StyleVarWindowBorderSize
	// StyleVarWindowMinSize is a Vec2
	StyleVarWindowMinSize
	// StyleVarWindowTitleAlign is a Vec2
	StyleVarWindowTitleAlign
	// StyleVarChildRounding is a float
	StyleVarChildRounding
	// StyleVarChildBorderSize is a float
	StyleVarChildBorderSize
	// StyleVarPopupRounding is a float
	StyleVarPopupRounding
	// StyleVarPopupBorderSize is a float
	StyleVarPopupBorderSize
	// StyleVarFramePadding is a Vec2
	StyleVarFramePadding
	// StyleVarFrameRounding is a float
	StyleVarFrameRounding
	// StyleVarFrameBorderSize is a float
	StyleVarFrameBorderSize
	// StyleVarItemSpacing is a Vec2
	StyleVarItemSpacing
	// StyleVarItemInnerSpacing is a Vec2
	StyleVarItemInnerSpacing
	// StyleVarIndentSpacing is a float
	StyleVarIndentSpacing
	// StyleVarScrollbarSize is a float
	StyleVarScrollbarSize
	// StyleVarScrollbarRounding is a float
	StyleVarScrollbarRounding
	// StyleVarGrabMinSize is a float
	StyleVarGrabMinSize
	// StyleVarGrabRounding is a float
	StyleVarGrabRounding
	// StyleVarTabRounding is a float
	StyleVarTabRounding
	// StyleVarButtonTextAlign is a Vec2
	StyleVarButtonTextAlign
	// StyleVarSelectableTextAlign is a Vec2
	StyleVarSelectableTextAlign
)

Style IDs

type TabBarFlags

type TabBarFlags int
const (
	// TabBarFlagsNone default TabBarFlags = 0.
	TabBarFlagsNone TabBarFlags = 0
	// TabBarFlagsReorderable Allow manually dragging tabs to re-order them + New tabs are appended at the end of list
	TabBarFlagsReorderable TabBarFlags = 1 << 0
	// TabBarFlagsAutoSelectNewTabs Automatically select new tabs when they appear
	TabBarFlagsAutoSelectNewTabs TabBarFlags = 1 << 1
	// TabBarFlagsTabListPopupButton Disable buttons to open the tab list popup
	TabBarFlagsTabListPopupButton TabBarFlags = 1 << 2
	// 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 TabBarFlags = false.
	TabBarFlagsNoCloseWithMiddleMouseButton TabBarFlags = 1 << 3
	// TabBarFlagsNoTabListScrollingButtons Disable scrolling buttons (apply when fitting policy is
	// TabBarFlagsFittingPolicyScroll)
	TabBarFlagsNoTabListScrollingButtons TabBarFlags = 1 << 4
	// TabBarFlagsNoTooltip Disable tooltips when hovering a tab
	TabBarFlagsNoTooltip TabBarFlags = 1 << 5
	// TabBarFlagsFittingPolicyResizeDown Resize tabs when they don't fit
	TabBarFlagsFittingPolicyResizeDown TabBarFlags = 1 << 6
	// TabBarFlagsFittingPolicyScroll Add scroll buttons when tabs don't fit
	TabBarFlagsFittingPolicyScroll TabBarFlags = 1 << 7
	// TabBarFlagsFittingPolicyMask combines
	// TabBarFlagsFittingPolicyResizeDown and TabBarFlagsFittingPolicyScroll
	TabBarFlagsFittingPolicyMask TabBarFlags = TabBarFlagsFittingPolicyResizeDown | TabBarFlagsFittingPolicyScroll
	// TabBarFlagsFittingPolicyDefault alias for TabBarFlagsFittingPolicyResizeDown
	TabBarFlagsFittingPolicyDefault TabBarFlags = TabBarFlagsFittingPolicyResizeDown
)

type TabBarWidget

type TabBarWidget struct {
	// contains filtered or unexported fields
}

func TabBar

func TabBar() *TabBarWidget

func (*TabBarWidget) Build

func (t *TabBarWidget) Build()

Build implements Widget interface

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 TabItemFlags = 0
	TabItemFlagsNone TabItemFlags = 0
	// 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 = 1 << 0
	// TabItemFlagsSetSelected Trigger flag to programmatically make the tab selected when calling BeginTabItem()
	TabItemFlagsSetSelected TabItemFlags = 1 << 1
	// 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 TabItemFlags = false.
	TabItemFlagsNoCloseWithMiddleMouseButton TabItemFlags = 1 << 2
	// TabItemFlagsNoPushID Don't call PushID(tab->ID)/PopID() on BeginTabItem()/EndTabItem()
	TabItemFlagsNoPushID TabItemFlags = 1 << 3
)

type TabItemWidget

type TabItemWidget struct {
	// contains filtered or unexported fields
}

func TabItem

func TabItem(label string) *TabItemWidget

func TabItemf

func TabItemf(format string, args ...interface{}) *TabItemWidget

func (*TabItemWidget) Build

func (t *TabItemWidget) Build()

Build implements Widget interface

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
const (
	// Input configuration flags
	TableColumnFlagsNone TableColumnFlags = 0
	// Default as a hidden/disabled column.
	TableColumnFlagsDefaultHide TableColumnFlags = 1 << 0
	// Default as a sorting column.
	TableColumnFlagsDefaultSort TableColumnFlags = 1 << 1
	// Column will stretch. Preferable with horizontal scrolling disabled
	// (default if table sizing policy is SizingStretchSame or SizingStretchProp).
	TableColumnFlagsWidthStretch TableColumnFlags = 1 << 2
	// Column will not stretch. Preferable with horizontal scrolling enabled
	// (default if table sizing policy is SizingFixedFit and table is resizable).
	TableColumnFlagsWidthFixed TableColumnFlags = 1 << 3
	// Disable manual resizing.
	TableColumnFlagsNoResize TableColumnFlags = 1 << 4
	// Disable manual reordering this column, this will also prevent other columns from crossing over this column.
	TableColumnFlagsNoReorder TableColumnFlags = 1 << 5
	// Disable ability to hide/disable this column.
	TableColumnFlagsNoHide TableColumnFlags = 1 << 6
	// Disable clipping for this column (all NoClip columns will render in a same draw command).
	TableColumnFlagsNoClip TableColumnFlags = 1 << 7
	// Disable ability to sort on this field (even if TableFlagsSortable is set on the table).
	TableColumnFlagsNoSort TableColumnFlags = 1 << 8
	// Disable ability to sort in the ascending direction.
	TableColumnFlagsNoSortAscending TableColumnFlags = 1 << 9
	// Disable ability to sort in the descending direction.
	TableColumnFlagsNoSortDescending TableColumnFlags = 1 << 10
	// Disable header text width contribution to automatic column width.
	TableColumnFlagsNoHeaderWidth TableColumnFlags = 1 << 11
	// Make the initial sort direction Ascending when first sorting on this column (default).
	TableColumnFlagsPreferSortAscending TableColumnFlags = 1 << 12
	// Make the initial sort direction Descending when first sorting on this column.
	TableColumnFlagsPreferSortDescending TableColumnFlags = 1 << 13
	// Use current Indent value when entering cell (default for column 0).
	TableColumnFlagsIndentEnable TableColumnFlags = 1 << 14
	// Ignore current Indent value when entering cell (default for columns > 0). Indentation changes within the cell will still be honored.
	TableColumnFlagsIndentDisable TableColumnFlags = 1 << 15

	// Output status flags read-only via TableGetColumnFlags()
	// Status: is enabled == not hidden by user/api (referred to as "Hide" in DefaultHide and NoHide) flags.
	TableColumnFlagsIsEnabled TableColumnFlags = 1 << 20
	// Status: is visible == is enabled AND not clipped by scrolling.
	TableColumnFlagsIsVisible TableColumnFlags = 1 << 21
	// Status: is currently part of the sort specs
	TableColumnFlagsIsSorted TableColumnFlags = 1 << 22
	// Status: is hovered by mouse
	TableColumnFlagsIsHovered TableColumnFlags = 1 << 23

	// [Internal] Combinations and masks
	TableColumnFlagsWidthMask  TableColumnFlags = TableColumnFlagsWidthStretch | TableColumnFlagsWidthFixed
	TableColumnFlagsIndentMask TableColumnFlags = TableColumnFlagsIndentEnable | TableColumnFlagsIndentDisable
	TableColumnFlagsStatusMask TableColumnFlags = TableColumnFlagsIsEnabled |
		TableColumnFlagsIsVisible | TableColumnFlagsIsSorted | TableColumnFlagsIsHovered
	// [Internal] Disable user resizing this column directly (it may however we resized indirectly from its left edge)
	TableColumnFlagsNoDirectResize TableColumnFlags = 1 << 30
)

type TableColumnWidget

type TableColumnWidget struct {
	// contains filtered or unexported fields
}

func TableColumn

func TableColumn(label string) *TableColumnWidget

func (*TableColumnWidget) Build

func (c *TableColumnWidget) Build()

Build implements Widget interface

func (*TableColumnWidget) Flags

func (*TableColumnWidget) InnerWidthOrWeight

func (c *TableColumnWidget) InnerWidthOrWeight(w float32) *TableColumnWidget

func (*TableColumnWidget) UserID

type TableFlags

type TableFlags int

TableFlags represents table flags

const (
	TableFlagsNone TableFlags = 0
	// Enable resizing columns.
	TableFlagsResizable TableFlags = 1 << 0
	// Enable reordering columns in header row (need calling TableSetupColumn() + TableHeadersRow() to display headers)
	TableFlagsReorderable TableFlags = 1 << 1
	// Enable hiding/disabling columns in context menu.
	TableFlagsHideable TableFlags = 1 << 2
	// Enable sorting. Call TableGetSortSpecs() to obtain sort specs. Also see TableFlagsSortMulti and TableFlagsSortTristate.
	TableFlagsSortable TableFlags = 1 << 3
	// Disable persisting columns order, width and sort settings in the .ini file.
	TableFlagsNoSavedSettings TableFlags = 1 << 4
	// Right-click on columns body/contents will display table context menu. By default it is available in TableHeadersRow().
	TableFlagsContextMenuInBody TableFlags = 1 << 5

	// Set each RowBg color with ColTableRowBg or ColTableRowBgAlt
	// (equivalent of calling TableSetBgColor with TableBgFlagsRowBg0 on each row manually)
	TableFlagsRowBg TableFlags = 1 << 6
	// Draw horizontal borders between rows.
	TableFlagsBordersInnerH TableFlags = 1 << 7
	// Draw horizontal borders at the top and bottom.
	TableFlagsBordersOuterH TableFlags = 1 << 8
	// Draw vertical borders between columns.
	TableFlagsBordersInnerV TableFlags = 1 << 9
	// Draw vertical borders on the left and right sides.
	TableFlagsBordersOuterV TableFlags = 1 << 10
	// Draw horizontal borders.
	TableFlagsBordersH TableFlags = TableFlagsBordersInnerH | TableFlagsBordersOuterH
	// Draw vertical borders.
	TableFlagsBordersV TableFlags = TableFlagsBordersInnerV | TableFlagsBordersOuterV
	// Draw inner borders.
	TableFlagsBordersInner TableFlags = TableFlagsBordersInnerV | TableFlagsBordersInnerH
	// Draw outer borders.
	TableFlagsBordersOuter TableFlags = TableFlagsBordersOuterV | TableFlagsBordersOuterH
	// Draw all borders.
	TableFlagsBorders TableFlags = TableFlagsBordersInner | TableFlagsBordersOuter
	// [ALPHA] Disable vertical borders in columns Body (borders will always appears in Headers). -> May move to style
	TableFlagsNoBordersInBody TableFlags = 1 << 11
	// [ALPHA] Disable vertical borders in columns Body until hovered for resize (borders will always appears in Headers). -> May move to style
	TableFlagsNoBordersInBodyUntilResizeTableFlags TableFlags = 1 << 12

	// Columns default to WidthFixed or WidthAuto (if resizable or not resizable), matching contents width.
	TableFlagsSizingFixedFit TableFlags = 1 << 13
	// Columns default to WidthFixed or WidthAuto (if resizable or not resizable), matching the maximum contents width of all columns.
	// Implicitly enable TableFlagsNoKeepColumnsVisible.
	TableFlagsSizingFixedSame TableFlags = 2 << 13
	// Columns default to WidthStretch with default weights proportional to each columns contents widths.
	TableFlagsSizingStretchProp TableFlags = 3 << 13
	// Columns default to WidthStretch with default weights all equal, unless overridden by TableSetupColumn().
	TableFlagsSizingStretchSame TableFlags = 4 << 13

	// Make outer width auto-fit to columns, overriding outersize.x value.
	// Only available when ScrollX/ScrollY are disabled and Stretch columns are not used.
	TableFlagsNoHostExtendX TableFlags = 1 << 16
	// Make outer height stop exactly at outersize.y (prevent auto-extending table past the limit).
	// Only available when ScrollX/ScrollY are disabled.
	// Data below the limit will be clipped and not visible.
	TableFlagsNoHostExtendY TableFlags = 1 << 17
	// Disable keeping column always minimally visible when ScrollX is off and table gets too small. Not recommended if columns are resizable.
	TableFlagsNoKeepColumnsVisible TableFlags = 1 << 18
	// Disable distributing remainder width to stretched columns
	// (width allocation on a 100-wide table with 3 columns: Without this flag: 33,33,34. With this flag: 33,33,33).
	// With larger number of columns, resizing will appear to be less smooth.
	TableFlagsPreciseWidths TableFlags = 1 << 19

	// Disable clipping rectangle for every individual columns (reduce draw command count,
	// items will be able to overflow into other columns). Generally incompatible with TableSetupScrollFreeze().
	TableFlagsNoClip TableFlags = 1 << 20

	// Default if BordersOuterV is on. Enable outer-most padding. Generally desirable if you have headers.
	TableFlagsPadOuterX TableFlags = 1 << 21
	// Default if BordersOuterV is off. Disable outer-most padding.
	TableFlagsNoPadOuterX TableFlags = 1 << 22
	// Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off).
	TableFlagsNoPadInnerX TableFlags = 1 << 23

	// Enable horizontal scrolling. Require 'outersize' parameter of BeginTable() to specify the container size.
	// Changes default sizing policy. Because this create a child window, ScrollY is currently generally recommended when using ScrollX.
	TableFlagsScrollX TableFlags = 1 << 24
	// Enable vertical scrolling. Require 'outersize' parameter of BeginTable() to specify the container size.
	TableFlagsScrollY TableFlags = 1 << 25

	// Hold shift when clicking headers to sort on multiple column. TableGetSortSpecs() may return specs where (SpecsCount > 1).
	TableFlagsSortMulti TableFlags = 1 << 26
	// Allow no sorting, disable default sorting. TableGetSortSpecs() may return specs where (SpecsCount == 0).
	TableFlagsSortTristate TableFlags = 1 << 27

	// [Internal] Combinations and masks
	TableFlagsSizingMask TableFlags = TableFlagsSizingFixedFit | TableFlagsSizingFixedSame |
		TableFlagsSizingStretchProp | TableFlagsSizingStretchSame
)

Table flags enum:

type TableRowFlags

type TableRowFlags int
const (
	TableRowFlagsNone TableRowFlags = 0
	// Identify header row (set default background color + width of its contents accounted different for auto column width)
	TableRowFlagsHeaders TableRowFlags = 1 << 0
)

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.RGBA) *TableRowWidget

func (*TableRowWidget) Build

func (r *TableRowWidget) Build()

Build implements Widget interface

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) Build

func (t *TableWidget) Build()

Build implements Widget interface

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) 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
}

func ToTexture

func ToTexture(textureID imgui.TextureID) *Texture

ToTexture converts imgui.TextureID to Texture.

type TooltipWidget

type TooltipWidget struct {
	// contains filtered or unexported fields
}

func Tooltip

func Tooltip(tip string) *TooltipWidget

func Tooltipf

func Tooltipf(format string, args ...interface{}) *TooltipWidget

func (*TooltipWidget) Build

func (t *TooltipWidget) Build()

Build implements Widget interface

func (*TooltipWidget) Layout

func (t *TooltipWidget) Layout(widgets ...Widget) *TooltipWidget

type TreeNodeFlags

type TreeNodeFlags int

TreeNodeFlags represents tree node widget flags

const (
	// TreeNodeFlagsNone default TreeNodeFlags = 0
	TreeNodeFlagsNone TreeNodeFlags = 0
	// TreeNodeFlagsSelected draws as selected.
	TreeNodeFlagsSelected TreeNodeFlags = 1 << 0
	// TreeNodeFlagsFramed draws full colored frame (e.g. for CollapsingHeader).
	TreeNodeFlagsFramed TreeNodeFlags = 1 << 1
	// TreeNodeFlagsAllowItemOverlap hit testing to allow subsequent widgets to overlap this one.
	TreeNodeFlagsAllowItemOverlap TreeNodeFlags = 1 << 2
	// TreeNodeFlagsNoTreePushOnOpen doesn't do a TreePush() when open
	// (e.g. for CollapsingHeader) TreeNodeFlags = no extra indent nor pushing on ID stack.
	TreeNodeFlagsNoTreePushOnOpen TreeNodeFlags = 1 << 3
	// TreeNodeFlagsNoAutoOpenOnLog doesn't automatically and temporarily open node when Logging is active
	// (by default logging will automatically open tree nodes).
	TreeNodeFlagsNoAutoOpenOnLog TreeNodeFlags = 1 << 4
	// TreeNodeFlagsDefaultOpen defaults node to be open.
	TreeNodeFlagsDefaultOpen TreeNodeFlags = 1 << 5
	// TreeNodeFlagsOpenOnDoubleClick needs double-click to open node.
	TreeNodeFlagsOpenOnDoubleClick TreeNodeFlags = 1 << 6
	// 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 = 1 << 7
	// TreeNodeFlagsLeaf allows no collapsing, no arrow (use as a convenience for leaf nodes).
	TreeNodeFlagsLeaf TreeNodeFlags = 1 << 8
	// TreeNodeFlagsBullet displays a bullet instead of an arrow.
	TreeNodeFlagsBullet TreeNodeFlags = 1 << 9
	// TreeNodeFlagsFramePadding uses FramePadding (even for an unframed text node) to
	// vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding().
	TreeNodeFlagsFramePadding TreeNodeFlags = 1 << 10
	// 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 = 1 << 11
	// TreeNodeFlagsSpanFullWidth extends hit box to the left-most and right-most edges (bypass the indented area).
	TreeNodeFlagsSpanFullWidth TreeNodeFlags = 1 << 12
	// TreeNodeFlagsNavLeftJumpsBackHere (WIP) Nav: left direction may move to this TreeNode() from any of its child
	// (items submitted between TreeNode and TreePop)
	TreeNodeFlagsNavLeftJumpsBackHere TreeNodeFlags = 1 << 13
	// TreeNodeFlagsCollapsingHeader combines TreeNodeFlagsFramed and TreeNodeFlagsNoAutoOpenOnLog.
	TreeNodeFlagsCollapsingHeader TreeNodeFlags = TreeNodeFlagsFramed | TreeNodeFlagsNoTreePushOnOpen | TreeNodeFlagsNoAutoOpenOnLog
)

type TreeNodeWidget

type TreeNodeWidget struct {
	// contains filtered or unexported fields
}

func TreeNode

func TreeNode(label string) *TreeNodeWidget

func TreeNodef

func TreeNodef(format string, args ...interface{}) *TreeNodeWidget

func (*TreeNodeWidget) Build

func (t *TreeNodeWidget) Build()

Build implements Widget interface

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

func (*TreeNodeWidget) Flags

func (t *TreeNodeWidget) Flags(flags TreeNodeFlags) *TreeNodeWidget

func (*TreeNodeWidget) Layout

func (t *TreeNodeWidget) Layout(widgets ...Widget) *TreeNodeWidget

type TreeTableRowWidget

type TreeTableRowWidget struct {
	// contains filtered or unexported fields
}

func TreeTableRow

func TreeTableRow(label string, widgets ...Widget) *TreeTableRowWidget

func (*TreeTableRowWidget) Build

func (ttr *TreeTableRowWidget) Build()

Build implements Widget interface

func (*TreeTableRowWidget) Children

func (ttr *TreeTableRowWidget) Children(rows ...*TreeTableRowWidget) *TreeTableRowWidget

func (*TreeTableRowWidget) Flags

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 (*TreeTableWidget) Size

func (tt *TreeTableWidget) Size(width, height float32) *TreeTableWidget

type VSliderIntWidget

type VSliderIntWidget struct {
	// contains filtered or unexported fields
}

func VSliderInt

func VSliderInt(value *int32, min, max int32) *VSliderIntWidget

func (*VSliderIntWidget) Build

func (vs *VSliderIntWidget) Build()

Build implements Widget interface

func (*VSliderIntWidget) Flags

func (vs *VSliderIntWidget) Flags(flags SliderFlags) *VSliderIntWidget

func (*VSliderIntWidget) Format

func (vs *VSliderIntWidget) Format(format string) *VSliderIntWidget

func (*VSliderIntWidget) Label

func (vs *VSliderIntWidget) Label(label string) *VSliderIntWidget

func (*VSliderIntWidget) Labelf

func (vs *VSliderIntWidget) Labelf(format string, args ...interface{}) *VSliderIntWidget

func (*VSliderIntWidget) OnChange

func (vs *VSliderIntWidget) OnChange(onChange func()) *VSliderIntWidget

func (*VSliderIntWidget) Size

func (vs *VSliderIntWidget) Size(width, height float32) *VSliderIntWidget

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 (*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.

type WindowFlags

type WindowFlags int
const (
	// WindowFlagsNone default WindowFlags = 0
	WindowFlagsNone WindowFlags = 0
	// WindowFlagsNoTitleBar disables title-bar.
	WindowFlagsNoTitleBar WindowFlags = 1 << 0
	// WindowFlagsNoResize disables user resizing with the lower-right grip.
	WindowFlagsNoResize WindowFlags = 1 << 1
	// WindowFlagsNoMove disables user moving the window.
	WindowFlagsNoMove WindowFlags = 1 << 2
	// WindowFlagsNoScrollbar disables scrollbars. Window can still scroll with mouse or programmatically.
	WindowFlagsNoScrollbar WindowFlags = 1 << 3
	// 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 = 1 << 4
	// WindowFlagsNoCollapse disables user collapsing window by double-clicking on it.
	WindowFlagsNoCollapse WindowFlags = 1 << 5
	// WindowFlagsAlwaysAutoResize resizes every window to its content every frame.
	WindowFlagsAlwaysAutoResize WindowFlags = 1 << 6
	// WindowFlagsNoBackground disables drawing background color (WindowBg, etc.) and outside border. Similar as using
	// SetNextWindowBgAlpha(0.0f).
	WindowFlagsNoBackground WindowFlags = 1 << 7
	// WindowFlagsNoSavedSettings will never load/save settings in .ini file.
	WindowFlagsNoSavedSettings WindowFlags = 1 << 8
	// WindowFlagsNoMouseInputs disables catching mouse, hovering test with pass through.
	WindowFlagsNoMouseInputs WindowFlags = 1 << 9
	// WindowFlagsMenuBar has a menu-bar.
	WindowFlagsMenuBar WindowFlags = 1 << 10
	// 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 = 1 << 11
	// WindowFlagsNoFocusOnAppearing disables taking focus when transitioning from hidden to visible state.
	WindowFlagsNoFocusOnAppearing WindowFlags = 1 << 12
	// WindowFlagsNoBringToFrontOnFocus disables bringing window to front when taking focus. e.g. clicking on it or
	// programmatically giving it focus.
	WindowFlagsNoBringToFrontOnFocus WindowFlags = 1 << 13
	// WindowFlagsAlwaysVerticalScrollbar always shows vertical scrollbar, even if ContentSize.y < Size.y .
	WindowFlagsAlwaysVerticalScrollbar WindowFlags = 1 << 14
	// WindowFlagsAlwaysHorizontalScrollbar always shows horizontal scrollbar, even if ContentSize.x < Size.x .
	WindowFlagsAlwaysHorizontalScrollbar WindowFlags = 1 << 15
	// WindowFlagsAlwaysUseWindowPadding ensures child windows without border uses style.WindowPadding (ignored by
	// default for non-bordered child windows, because more convenient).
	WindowFlagsAlwaysUseWindowPadding WindowFlags = 1 << 16
	// WindowFlagsNoNavInputs has no gamepad/keyboard navigation within the window.
	WindowFlagsNoNavInputs WindowFlags = 1 << 18
	// WindowFlagsNoNavFocus has no focusing toward this window with gamepad/keyboard navigation
	// (e.g. skipped by CTRL+TAB)
	WindowFlagsNoNavFocus WindowFlags = 1 << 19
	// 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 = 1 << 20

	// WindowFlagsNoNav combines WindowFlagsNoNavInputs and WindowFlagsNoNavFocus.
	WindowFlagsNoNav WindowFlags = WindowFlagsNoNavInputs | WindowFlagsNoNavFocus
	// WindowFlagsNoDecoration combines WindowFlagsNoTitleBar, WindowFlagsNoResize, WindowFlagsNoScrollbar and
	// WindowFlagsNoCollapse.
	WindowFlagsNoDecoration WindowFlags = WindowFlagsNoTitleBar | WindowFlagsNoResize | WindowFlagsNoScrollbar | WindowFlagsNoCollapse
	// WindowFlagsNoInputs combines WindowFlagsNoMouseInputs, WindowFlagsNoNavInputs and WindowFlagsNoNavFocus.
	WindowFlagsNoInputs WindowFlags = WindowFlagsNoMouseInputs | WindowFlagsNoNavInputs | WindowFlagsNoNavFocus
)

type WindowShortcut

type WindowShortcut struct {
	Key      Key
	Modifier Modifier
	Callback func()
}

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

func Window

func Window(title string) *WindowWidget

Window creates a WindowWidget

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL