From 0ad54d136ef33d61172658e97b538f7cd6a91c26 Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Sun, 11 Feb 2024 16:39:26 +0000 Subject: Add a basic textbox element --- graphics.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'graphics.c') diff --git a/graphics.c b/graphics.c index cb1127f..c603c16 100644 --- a/graphics.c +++ b/graphics.c @@ -54,6 +54,10 @@ drawgui(GuiElement *g) } if(Dx(g->rect) > 0 && Dy(g->rect) > 0){ + /* Draw the background */ + Image *bg = getprop(g, Pbackground).colour->image; + draw(screen, g->rect, bg, nil, ZP); + spec.draw(g); for(int i = 0; i < g->nchildren; i++) @@ -65,8 +69,17 @@ drawgui(GuiElement *g) void drawcontainer(GuiElement *g) { - Image *bg = getprop(g, Pbackground).colour->image; - draw(screen, g->rect, bg, nil, ZP); + USED(g); +} + +void +drawtextbox(GuiElement *g) +{ + Rune *text = getprop(g, Ptext).text; + Image *fg = getprop(g, Ptextcolour).colour->image; + + + runestring(screen, g->content.min, fg, ZP, font, text); } Colour * -- cgit v1.2.3