<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://plexydesk.org/index.php?action=history&amp;feed=atom&amp;title=Examples</id>
	<title>Examples - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://plexydesk.org/index.php?action=history&amp;feed=atom&amp;title=Examples"/>
	<link rel="alternate" type="text/html" href="https://plexydesk.org/index.php?title=Examples&amp;action=history"/>
	<updated>2026-04-03T19:21:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://plexydesk.org/index.php?title=Examples&amp;diff=5&amp;oldid=prev</id>
		<title>Plexydesk: Add examples reference</title>
		<link rel="alternate" type="text/html" href="https://plexydesk.org/index.php?title=Examples&amp;diff=5&amp;oldid=prev"/>
		<updated>2026-03-21T19:32:56Z</updated>

		<summary type="html">&lt;p&gt;Add examples reference&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Examples =&lt;br /&gt;
&lt;br /&gt;
The repository includes a small collection of examples that are useful both as smoke tests and as reference code for application authors.&lt;br /&gt;
&lt;br /&gt;
== Minimal PlexyUI example ==&lt;br /&gt;
The following example is based on &amp;lt;code&amp;gt;examples/hello_uikit.c&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;amp;lt;plexy_ui.h&amp;amp;gt;&lt;br /&gt;
#include &amp;amp;lt;stdio.h&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
static void on_click(uint32_t widget_id, void* userdata) {&lt;br /&gt;
    printf(&amp;quot;Button clicked! (widget %u)\n&amp;quot;, widget_id);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(void) {&lt;br /&gt;
    PlexyApp* app = plexy_app_create(&amp;quot;Hello UIKit&amp;quot;);&lt;br /&gt;
    PlexyWindow* win = plexy_window_create(app, 400, 300, &amp;quot;Hello PlexyDesk&amp;quot;);&lt;br /&gt;
    uint32_t root = plexy_window_root(win);&lt;br /&gt;
&lt;br /&gt;
    plexy_padding(win, root, 24, 24, 24, 24);&lt;br /&gt;
    plexy_gap(win, root, 16);&lt;br /&gt;
    plexy_justify(win, root, PLEXY_JUSTIFY_CENTER);&lt;br /&gt;
    plexy_align(win, root, PLEXY_ALIGN_CENTER);&lt;br /&gt;
&lt;br /&gt;
    uint32_t title = plexy_label(win, root, &amp;quot;Welcome to PlexyDesk UIKit&amp;quot;);&lt;br /&gt;
    plexy_set_text_color_hex(win, title, &amp;quot;#1f2937&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    uint32_t btn = plexy_button(win, root, &amp;quot;Click Me&amp;quot;);&lt;br /&gt;
    plexy_set_fill_color_hex(win, btn, &amp;quot;#3b82f6&amp;quot;);&lt;br /&gt;
    plexy_set_text_color_hex(win, btn, &amp;quot;#ffffff&amp;quot;);&lt;br /&gt;
    plexy_on_click(win, btn, on_click, NULL);&lt;br /&gt;
&lt;br /&gt;
    plexy_app_run(app);&lt;br /&gt;
    plexy_app_destroy(app);&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Build and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gcc -o hello_uikit hello_uikit.c -L../lib -lplexyui&lt;br /&gt;
./hello_uikit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Useful example files ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! File&lt;br /&gt;
! Why it is useful&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;examples/hello_uikit.c&amp;lt;/code&amp;gt;&lt;br /&gt;
| Smallest usable PlexyUI program&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;examples/hello_client.c&amp;lt;/code&amp;gt;&lt;br /&gt;
| Lightweight client-side entry point&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;examples/canvas_demo.c&amp;lt;/code&amp;gt;&lt;br /&gt;
| Canvas and rendering-oriented example&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;examples/drawer_demo.c&amp;lt;/code&amp;gt;&lt;br /&gt;
| Drawer and interaction example&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;examples/plexy_dock.c&amp;lt;/code&amp;gt;&lt;br /&gt;
| Dock-related shell UI ideas&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;examples/settings_panel.c&amp;lt;/code&amp;gt;&lt;br /&gt;
| Structured settings-style interface&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;examples/showcase_demo.c&amp;lt;/code&amp;gt;&lt;br /&gt;
| Broader demonstration page for the toolkit&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;examples/widget_demo.c&amp;lt;/code&amp;gt;&lt;br /&gt;
| Widget coverage and visual output&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== What to learn from the examples ==&lt;br /&gt;
* how to create an application and a root window&lt;br /&gt;
* how layout is controlled with padding, gap, justify, align, and rows or columns&lt;br /&gt;
* how to style widgets with color, radius, elevation, and glass-related helpers&lt;br /&gt;
* how to bind click and value callbacks&lt;br /&gt;
* how client programs fit into the compositor model&lt;br /&gt;
&lt;br /&gt;
== Next step ==&lt;br /&gt;
After reading the examples, continue with [[Developer Guide]] and [[Architecture]].&lt;/div&gt;</summary>
		<author><name>Plexydesk</name></author>
	</entry>
</feed>