return me;
}
+void XonoticTextBox_destroy(entity me)
+{
+ if (me.stringList >= 0)
+ {
+ buf_del(me.stringList);
+ me.stringList = -1;
+ }
+}
+
void XonoticTextBox_setText(entity me, string text)
{
+ if (me.stringList >= 0)
+ {
+ buf_del(me.stringList);
+ me.stringList = -1;
+ }
+
int buf;
int line = 0;
string XonoticTextBox_getTextBoxContent(entity me, int i)
{
- return bufstr_get(me.stringList, i);
+ if (me.stringList >= 0)
+ {
+ return bufstr_get(me.stringList, i);
+ }
+ return string_null;
}
// mostly copied from playerlist
// slightly hacky multiline textbox with scrollbar
CLASS(XonoticTextBox, XonoticListBox)
+ METHOD(XonoticTextBox, destroy, void(entity));
ATTRIB(XonoticTextBox, rowsPerItem, float, 1);
METHOD(XonoticTextBox, resizeNotify, void(entity, vector, vector, vector, vector));
METHOD(XonoticTextBox, drawListBoxItem, void(entity, int, vector, bool, bool));