Skip to content

rayquiro.app

The rayquiro.app module serves as the primary UI structural foundation for RayQuiro. It operates in two unified modes:

  1. Native Desktop GUI Application: Native Win32/Linux windowing, High-DPI awareness, automatic pixel-perfect baseline alignment, built-in themes, and event loop management.
  2. Declarative DOM/HTML Elements: Component hierarchy building (<button>, <input>, <div>, flex rows/columns) and serialization to HTML via app.to_html.
import "rayquiro.app";
import "rayquiro.ui";

1. The Mental Model: app = HTML / Controls, ui = CSS

Section titled “1. The Mental Model: app = HTML / Controls, ui = CSS”
┌────────────────────────────────────────────────────────┐
│ RayQuiro Interface │
├──────────────────────────┬─────────────────────────────┤
│ rayquiro.app │ rayquiro.ui │
│ (Controls & Structure)│ (CSS & Styling) │
├──────────────────────────┼─────────────────────────────┤
│ • Window Lifecycle │ • Themes: dark, light, nord │
│ • High-DPI Awareness │ • Colors: rgb, rgba, hex │
│ • Button, Text, Input │ • Color blending & alpha │
│ • Checkbox, Radio, Slider│ • CSS rule parser │
│ • Row, Column, Box, Card │ • ui.apply(element, style) │
│ • app.to_html(element) │ • Typography & tokens │
└──────────────────────────┴─────────────────────────────┘

In v1.1, rayquiro.app features full High-DPI support (SetProcessDPIAware) on Windows and pixel-perfect vertical centering across both Windows and Linux. All controls adhere to a standardized 36px height baseline, eliminating layout jumping and misaligned fonts.

import "rayquiro.app";
import "rayquiro.ui";
app.init("RayQuiro v1.1 Studio", 520, 380);
app.set_theme("dark");
app.text("Welcome to RayQuiro Desktop Application");
app.input("Project name or path...");
app.checkbox("Enable Vulkan PBR hardware acceleration", true);
app.button("Create Project");
app.run();
FunctionSignatureDescription
app.initapp.init(title, width, height)Initializes application window with High-DPI scaling enabled.
app.runapp.run()Starts OS event processing and render loop.
app.set_themeapp.set_theme(name)Applies theme palette ("dark", "light", "midnight", "dracula", "cyberpunk").
app.set_styleapp.set_style(cssLike)Configures background and font size via CSS syntax.
app.buttonapp.button(text, x = -1, y = -1, w = -1, h = -1)Native push button with auto-layout or explicit geometry.
app.textapp.text(text, x = -1, y = -1, w = -1, h = -1)Vertically centered text label aligning with buttons and inputs.
app.inputapp.input(placeholder, x = -1, y = -1, w = -1, h = -1)Single-line editable text input box with clipboard support.
app.checkboxapp.checkbox(label, checked, x = -1, y = -1, w = -1, h = -1)Native toggle checkbox with vertically centered baseline.
app.msgapp.msg(title, text)Native modal system message dialog box.
app.show_messageapp.show_message(title, text)Alias for app.msg.
app.quitapp.quit()Terminates message loop and destroys application window.

rayquiro.app can also be used as a structured UI element tree generator that serializes directly to clean HTML:

ElementSignatureDescription
Buttonapp.button(text, options)Interactive button element (<button>).
Textapp.text(text, options)Text span / label element (<span>).
Labelapp.label(text, options)Form label element (<label>).
Inputapp.input(placeholder, value, options)Text input field (<input>).
Textareaapp.textarea(placeholder, value, options)Multi-line text field (<textarea>).
Checkboxapp.checkbox(label, checked, options)Toggle checkbox (<input type="checkbox">).
Radioapp.radio(label, group, checked, options)Radio button (<input type="radio">).
Sliderapp.slider(min, max, value, options)Numeric range slider (<input type="range">).
Progressapp.progress(value, max, options)Progress bar (<progress>).
Selectapp.select(optionsArray, selectedIndex, options)Dropdown select menu (<select>).
Imageapp.image(src, options)Image element (<img>).
Linkapp.link(url, text, options)Anchor hyperlink (<a href="...">).
Headingapp.heading(text, level, options)Heading element <h1> - <h6>.
Dividerapp.divider(options)Horizontal divider line (<hr />).
Rowapp.row(children, options)Horizontal flexbox layout container.
Columnapp.column(children, options)Vertical flexbox layout container.
Boxapp.box(children, options)Container block (<div>).
Cardapp.card(children, options)Styled card container.
Genericapp.element(tag, props, children, style)Generic custom HTML tag constructor.
To HTMLapp.to_html(element)Serializes element tree directly to HTML string.
import "rayquiro.app";
import "rayquiro.ui";
var heading = app.heading("Account Login", 2);
var userField = app.input("Username");
var passField = app.input("Password");
var keepLogged = app.checkbox("Remember session", true);
var loginBtn = app.button("Sign In");
loginBtn = ui.apply(loginBtn, {
"background": "#2563eb",
"color": "#ffffff",
"radius": 6,
"padding": "8px 16px"
});
var card = app.card([
heading,
app.divider(),
userField,
passField,
keepLogged,
loginBtn
]);
var html = app.to_html(card);
print(html);