summaryrefslogtreecommitdiffstats
path: root/source/widgets/textbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/widgets/textbox.c')
-rw-r--r--source/widgets/textbox.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/widgets/textbox.c b/source/widgets/textbox.c
index 29b08cb4..87d90767 100644
--- a/source/widgets/textbox.c
+++ b/source/widgets/textbox.c
@@ -77,6 +77,15 @@ static void textbox_resize ( widget *wid, short w, short h )
textbox *tb = (textbox *) wid;
textbox_moveresize ( tb, tb->widget.x, tb->widget.y, w, h );
}
+static int textbox_get_desired_height ( widget *wid )
+{
+ textbox *tb = (textbox *)wid;
+ if ( tb->flags & TB_AUTOHEIGHT )
+ {
+ return tb->widget.h;
+ }
+ return textbox_get_height (tb);
+}
textbox* textbox_create ( const char *name, TextboxFlags flags, TextBoxFontType tbft, const char *text )
{
@@ -89,6 +98,7 @@ textbox* textbox_create ( const char *name, TextboxFlags flags, TextBoxFontType
tb->widget.resize = textbox_resize;
tb->widget.get_width = textbox_get_width;
tb->widget.get_height = _textbox_get_height;
+ tb->widget.get_desired_height = textbox_get_desired_height;
tb->flags = flags;
tb->changed = FALSE;