Canvas
classin packageklyn.gui.windows
public abstract class Canvas extends Widget:
└ Canvas

Base class for custom drawing widgets.

A canvas is intentionally non-focusable and expansive on both axes. It is meant to occupy the central drawing area of an interface while side controls keep their preferred width or height.

class Gauge extends Canvas:
public override paint(painter as Painter) as Void:
painter.fillRect(this.x, this.y, this.width, this.height)
Inherited Properties
propertyInherited Properties from Widget: accentColor, backgroundColor, borderColor, bottom, canFocus, cornerRadius, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, isTabStop, isVisible, layoutParams, margin, maxHeight, maxWidth, minHeight, minWidth, parent, preferredHeight, preferredWidth, right, sizePolicy, styleClass, width, window, x, y
Inherited Events
eventInherited Events from Widget: keyPressed, keyReleased, mouseMoved, mousePressed, mouseReleased, mouseWheel, paintRequested, resized
Constructors
Modifier and Type Member Description
public Canvas Creates an expansive non-focusable drawing widget.
Inherited Methods
methodInherited Methods from Widget: blur, containsPoint, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintOverlay, repaint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds