2 * Acess2 Window Manager v3
3 * - By John Hodge (thePowersGang)
5 * renderer/widget/button.c
10 #include "./colours.h"
13 void Widget_DispText_Render(tWindow *Window, tElement *Element)
17 Element->CachedX+1, Element->CachedY+1,
18 Element->CachedW-2, Element->CachedH-2,
24 void Widget_DispText_UpdateText(tElement *Element, const char *Text)
28 if(Element->Text) free(Element->Text);
29 Element->Text = strdup(Text);
31 WM_Render_GetTextDims(NULL, Element->Text, &w, &h);
36 if(Element->Parent && (Element->Parent->Flags & ELEFLAG_VERTICAL)) {
37 Element->MinCross = w;
42 Element->MinCross = h;
45 Widget_UpdateMinDims(Element->Parent);
48 DEFWIDGETTYPE(ELETYPE_TEXT,
49 WIDGETTYPE_FLAG_NOCHILDREN,
50 .Render = Widget_DispText_Render,
51 .UpdateText = Widget_DispText_UpdateText