Poptart.Desktop
Desktop
application and window
Poptart.Desktop.Application
โ TypeApplication(; windows = UIWindow[Window(title="Title", frame=(x=0,y=0,frame...))],
closenotify = Condition(),
title::String="App",
frame::NamedTuple{(:width,:height)} = (width=400, height=300),
bgcolor = RGBA(0.10, 0.18, 0.24, 1))
Poptart.Desktop.resume
โ Methodresume(app::UIApplication)
Poptart.Desktop.pause
โ Methodpause(::UIApplication)
Poptart.Desktop.Window
โ TypeWindow(; title::String="Title",
frame::Union{NamedTuple{(:width,:height)}, NamedTuple{(:x,:y,:width,:height)}} = (width=400, height=300),
items::Union{Vector{Any},Vector{<:UIControl}} = UIControl[],
name::Union{Nothing,String}=nothing,
show_window_closing_widget::Bool=true,
flags=CImGui.ImGuiWindowFlags(0))
controls
Poptart.Desktop.Label
โ TypeLabel(; text::String)
Poptart.Desktop.Button
โ TypeButton(; title::String = "Button", callback::Union{Nothing,Function} = nothing)
Poptart.Desktop.Slider
โ TypeSlider(; label::String = "", range::Union{<:AbstractRange, Tuple, <:NamedTuple}, value)
Poptart.Desktop.Canvas
โ TypeCanvas(; items::Vector{Drawing}} = Drawing[])
Poptart.Desktop.InputText
โ TypeInputText(; label::String = "", buf::String = "", buf_size::Int = 32)
Poptart.Desktop.Checkbox
โ TypeCheckbox(; label::String = "", value::Bool = false)
layouts
Poptart.Desktop.Separator
โ TypeSeparator
Poptart.Desktop.SameLine
โ TypeSameLine
Poptart.Desktop.NewLine
โ TypeNewLine
Poptart.Desktop.Spacing
โ TypeSpacing
Poptart.Desktop.Group
โ TypeGroup(; items::Vector{Union{<:LayoutElement, <:UIControl}})
plots
Poptart.Desktop.ScatterPlot
โ TypeScatterPlot(; x::AbstractVector, y::AbstractVector, [label::String], [scale::NamedTuple{(:x, :y)}], [frame])
Poptart.Desktop.Spy
โ TypeSpy(; A::AbstractMatrix, [label::String], [frame])
Poptart.Desktop.BarPlot
โ TypeBarPlot(; values::Vector{Number}, [captions::Vector{String}], [label::String], [scale::NamedTuple{(:min_x,:max_x)}], [frame])
Poptart.Desktop.LinePlot
โ TypeLinePlot(; values::AbstractVector, [label::String], [scale::NamedTuple{(:min, :max)}], [color::RGBA], [frame])
Poptart.Desktop.MultiLinePlot
โ TypeMultiLinePlot(; items::Vector{LinePlot}, [label::String], [scale::NamedTuple{(:min, :max)}], [frame])
Poptart.Desktop.Histogram
โ TypeHistogram(; values::AbstractVector, [label::String], [scale::NamedTuple{(:min, :max)}], [frame])
menus
Poptart.Desktop.MenuBar
โ TypeMenuBar(; menus::Vector)
Poptart.Desktop.Menu
โ TypeMenu(; title::String, items::Vector)
Poptart.Desktop.MenuItem
โ TypeMenuItem(; title::String, [shortcut], [selected], [enabled])
popups
Poptart.Desktop.Popup
โ TypePopup(; label::String = "", items::Vector{<:UIControl})
!!! Note: You must use a sync Button (`Button(async=false)`) to open a Popup.
Poptart.Desktop.OpenPopup
โ FunctionOpenPopup(popup::Popup)
events
Poptart.Desktop.Mouse.leftClick
โ FunctionleftClick(item)
Poptart.Desktop.didClick
โ FunctiondidClick(f::Union{Nothing,Function}, widget::UIControl)
custom
Poptart.Desktop.exit_on_esc
โ MethodDesktop.exit_on_esc()
Poptart.Desktop.custom_fonts
โ MethodDesktop.custom_fonts(::Application)