Index: uspace/app/uidemo/uidemo.c
===================================================================
--- uspace/app/uidemo/uidemo.c	(revision 3583ffba079f2204a6f171e8f3c934940ddb3679)
+++ uspace/app/uidemo/uidemo.c	(revision d8ddf7a17eaf0cf4fee87a5efb1faca4bb6562b2)
@@ -33,8 +33,12 @@
  */
 
+#include <gfx/bitmap.h>
 #include <gfx/coord.h>
+#include <io/pixelmap.h>
 #include <stdio.h>
 #include <str.h>
+#include <ui/entry.h>
 #include <ui/fixed.h>
+#include <ui/image.h>
 #include <ui/label.h>
 #include <ui/pbutton.h>
@@ -44,4 +48,6 @@
 #include "uidemo.h"
 
+static errno_t bitmap_moire(gfx_bitmap_t *, gfx_coord_t, gfx_coord_t);
+
 static void wnd_close(ui_window_t *, void *);
 
@@ -79,13 +85,13 @@
 
 	if (pbutton == demo->pb1) {
-		rc = ui_label_set_text(demo->label, "Confirmed");
+		rc = ui_entry_set_text(demo->entry, "OK pressed");
 		if (rc != EOK)
-			printf("Error changing label text.\n");
-		(void) ui_label_paint(demo->label);
+			printf("Error changing entry text.\n");
+		(void) ui_entry_paint(demo->entry);
 	} else {
-		rc = ui_label_set_text(demo->label, "Cancelled");
+		rc = ui_entry_set_text(demo->entry, "Cancel pressed");
 		if (rc != EOK)
-			printf("Error changing label text.\n");
-		(void) ui_label_paint(demo->label);
+			printf("Error changing entry text.\n");
+		(void) ui_entry_paint(demo->entry);
 	}
 }
@@ -99,5 +105,9 @@
 	ui_demo_t demo;
 	gfx_rect_t rect;
+	gfx_context_t *gc;
 	ui_resource_t *ui_res;
+	gfx_bitmap_params_t bparams;
+	gfx_bitmap_t *bitmap;
+	gfx_coord2_t off;
 	errno_t rc;
 
@@ -113,5 +123,5 @@
 	params.rect.p0.y = 0;
 	params.rect.p1.x = 220;
-	params.rect.p1.y = 100;
+	params.rect.p1.y = 180;
 
 	memset((void *) &demo, 0, sizeof(demo));
@@ -128,4 +138,5 @@
 
 	ui_res = ui_window_get_res(window);
+	gc = ui_window_get_gc(window);
 
 	rc = ui_fixed_create(&demo.fixed);
@@ -135,5 +146,5 @@
 	}
 
-	rc = ui_label_create(ui_res, "Hello there!", &demo.label);
+	rc = ui_label_create(ui_res, "Text label", &demo.label);
 	if (rc != EOK) {
 		printf("Error creating label.\n");
@@ -154,5 +165,5 @@
 	}
 
-	rc = ui_pbutton_create(ui_res, "Confirm", &demo.pb1);
+	rc = ui_pbutton_create(ui_res, "OK", &demo.pb1);
 	if (rc != EOK) {
 		printf("Error creating button.\n");
@@ -163,7 +174,7 @@
 
 	rect.p0.x = 15;
-	rect.p0.y = 60;
+	rect.p0.y = 70;
 	rect.p1.x = 105;
-	rect.p1.y = 88;
+	rect.p1.y = 98;
 	ui_pbutton_set_rect(demo.pb1, &rect);
 
@@ -185,10 +196,65 @@
 
 	rect.p0.x = 115;
-	rect.p0.y = 60;
+	rect.p0.y = 70;
 	rect.p1.x = 205;
-	rect.p1.y = 88;
+	rect.p1.y = 98;
 	ui_pbutton_set_rect(demo.pb2, &rect);
 
 	rc = ui_fixed_add(demo.fixed, ui_pbutton_ctl(demo.pb2));
+	if (rc != EOK) {
+		printf("Error adding control to layout.\n");
+		return rc;
+	}
+
+	rc = ui_entry_create(ui_res, "", &demo.entry);
+	if (rc != EOK) {
+		printf("Error creating entry.\n");
+		return rc;
+	}
+
+	rect.p0.x = 15;
+	rect.p0.y = 110;
+	rect.p1.x = 205;
+	rect.p1.y = 135;
+	ui_entry_set_rect(demo.entry, &rect);
+	ui_entry_set_halign(demo.entry, gfx_halign_center);
+
+	rc = ui_fixed_add(demo.fixed, ui_entry_ctl(demo.entry));
+	if (rc != EOK) {
+		printf("Error adding control to layout.\n");
+		return rc;
+	}
+
+	gfx_bitmap_params_init(&bparams);
+	bparams.rect.p0.x = 0;
+	bparams.rect.p0.y = 0;
+	bparams.rect.p1.x = 188;
+	bparams.rect.p1.y = 24;
+
+	rc = gfx_bitmap_create(gc, &bparams, NULL, &bitmap);
+	if (rc != EOK)
+		return rc;
+
+	rc = bitmap_moire(bitmap, bparams.rect.p1.x, bparams.rect.p1.y);
+	if (rc != EOK)
+		return rc;
+
+	rc = ui_image_create(ui_res, bitmap, &params.rect, &demo.image);
+	if (rc != EOK) {
+		printf("Error creating label.\n");
+		return rc;
+	}
+
+	off.x = 15;
+	off.y = 145;
+	gfx_rect_translate(&off, &bparams.rect, &rect);
+
+	/* Adjust for frame width (2 x 1 pixel) */
+	rect.p1.x += 2;
+	rect.p1.y += 2;
+	ui_image_set_rect(demo.image, &rect);
+	ui_image_set_flags(demo.image, ui_imgf_frame);
+
+	rc = ui_fixed_add(demo.fixed, ui_image_ctl(demo.image));
 	if (rc != EOK) {
 		printf("Error adding control to layout.\n");
@@ -208,4 +274,39 @@
 	ui_window_destroy(window);
 	ui_destroy(ui);
+
+	return EOK;
+}
+
+/** Fill bitmap with moire pattern.
+ *
+ * @param bitmap Bitmap
+ * @param w Bitmap width
+ * @param h Bitmap height
+ * @return EOK on success or an error code
+ */
+static errno_t bitmap_moire(gfx_bitmap_t *bitmap, gfx_coord_t w, gfx_coord_t h)
+{
+	int i, j;
+	int k;
+	pixelmap_t pixelmap;
+	gfx_bitmap_alloc_t alloc;
+	errno_t rc;
+
+	rc = gfx_bitmap_get_alloc(bitmap, &alloc);
+	if (rc != EOK)
+		return rc;
+
+	/* In absence of anything else, use pixelmap */
+	pixelmap.width = w;
+	pixelmap.height = h;
+	pixelmap.data = alloc.pixels;
+
+	for (i = 0; i < w; i++) {
+		for (j = 0; j < h; j++) {
+			k = i * i + j * j;
+			pixelmap_put_pixel(&pixelmap, i, j,
+			    PIXEL(255, k, k, 255 - k));
+		}
+	}
 
 	return EOK;
