SLThrobber.sleela
lib/user-interface/SLThrobber.sleela · 90 line(s) · sleela
<< lib/user-interface/SLThrobber.sleela
SLeeLa Standard Library Definition.
Definition: Defines SLThrobber — a SleelaUI width-adjustable, full-motion,
colour-predictive, water-like flowing activity throbber. Unlike a spinning
ring, it is a fluid field: crests travel, disperse, and recombine like
ripples on water, their colour arriving slightly AHEAD of the motion (the
hue leads the local velocity), with latent hues surfacing on the brightest
crests under strong flow and receding as it calms. The width is adjustable
at any time and the field rescales while keeping the same physical feel.
The constructor bottoms out in the `uiThrobber` built-in (SleelaUI C ABI
slui_throbber()); it is an animated widget — while visible the window's
frame loop advances it and repaints it at its refresh rate.
An SLThrobber IS an SLWidget. Height follows setSizeRequest (a slim seam by
default); set the width with setWidth, the flow vigour with setIntensity, and
the base hue with setHue.
Family: user-interface. Native VM/UI work crosses the explicit `ui*` SLVM
bridge. >>
#sleela 2.5
material;
class SLThrobber extends SLWidget {
< ---- Descriptive metadata (version 1.11 nested-friendly accessors) ---- >
<< Eleven catalogued attributes with getter/setter pairs, so a GUI, loader,
or catalog can read and (where appropriate) override this record.
Values are faithful to the subject's real origin where publicly known. >>
String metaVersion = "1.0.0";
int metaId = 10400;
String metaAuthor = "Kiro Agent";
String metaDate = "2026-10-16";
String metaCopyright = "SLeeLa project";
String metaTrademark = "none";
String metaCorporation = "none";
< metaOrigin: National | <nation> | International | Galactic >
String metaOrigin = "International";
String metaBirthDate = "2026-10-07";
< metaScienceRating: maturity/robustness on a 1..10 scale >
int metaScienceRating = 9;
< metaNationalSchedule: a real, citable instrument or "none" >
String metaNationalSchedule = "none";
String getMetaVersion() { return metaVersion; }
void setMetaVersion(String v) { metaVersion = v; }
int getMetaId() { return metaId; }
void setMetaId(int v) { metaId = v; }
String getAuthor() { return metaAuthor; }
void setAuthor(String v) { metaAuthor = v; }
String getDate() { return metaDate; }
void setDate(String v) { metaDate = v; }
String getCopyright() { return metaCopyright; }
void setCopyright(String v) { metaCopyright = v; }
String getTrademark() { return metaTrademark; }
void setTrademark(String v) { metaTrademark = v; }
String getCorporation() { return metaCorporation; }
void setCorporation(String v) { metaCorporation = v; }
String getOrigin() { return metaOrigin; }
void setOrigin(String v) { metaOrigin = v; }
String getBirthDate() { return metaBirthDate; }
void setBirthDate(String v) { metaBirthDate = v; }
int getScienceRating() { return metaScienceRating; }
void setScienceRating(int v) { metaScienceRating = v; }
String getNationalSchedule() { return metaNationalSchedule; }
void setNationalSchedule(String v) { metaNationalSchedule = v; }
< Create a throbber inside `parent` with an initial pixel width. >
void createIn(SLWidget parent, int widthPx) {
widget = uiThrobber(parent.handle(), widthPx);
}
void createInHandle(int parentHandle, int widthPx) {
widget = uiThrobber(parentHandle, widthPx);
}
< Adjust the width in pixels; the water field rescales to fit. >
void setWidth(int widthPx) {
if (widget >= 0) { uiThrobberSetWidth(widget, widthPx); }
}
< Flow vigour in [0,1]: 0 = a calm trickle, 1 = vigorous flow. Drives both >
< the speed and the colour spread of the field. >
void setIntensity(double intensity) {
if (widget >= 0) { uiThrobberSetIntensity(widget, intensity); }
}
< Base hue in degrees the predictive colouring flows around (205 ~ water; >
< 150 ~ green water; 30 ~ warm). The actual rendered hue leads this by the >
< local flow velocity. >
void setHue(double hueDegrees) {
if (widget >= 0) { uiThrobberSetHue(widget, hueDegrees); }
}
}