Minor misc fixes
[tpg/acess2.git] / Usermode / Applications / axwin3_src / WM / renderers / widget / textinput.c
index 6d34a8e..de862bf 100644 (file)
@@ -10,7 +10,7 @@
 #include <common.h>
 #include "./common.h"
 #include "./colours.h"
-#include <utf8.h>
+#include <unicode.h>
 #include <string.h>
 
 // TODO: Include a proper keysym header
@@ -117,6 +117,8 @@ void Widget_TextInput_Init(tElement *Element)
        info = Element->Data = malloc(sizeof(*info));
        info->DrawOfs = 0;
        info->CursorXOfs = 0;
+       info->CursorByteOfs = 0;
+       info->Length = 0;
 
        // No need to explicitly update parent min dims, as the AddElement routine does that    
 }
@@ -213,12 +215,12 @@ int Widget_TextInput_KeyFire(tElement *Element, int KeySym, int Character)
        }
 
        // TODO: Have a Widget_ function to do this instead
-       WM_Invalidate(Element->Window);
+       WM_Invalidate(Element->Window, 1);
        
        return 0;
 }
 
-DEFWIDGETTYPE(ELETYPE_TEXTINPUT,
+DEFWIDGETTYPE(ELETYPE_TEXTINPUT, "TextInput",
        WIDGETTYPE_FLAG_NOCHILDREN,
        .Render = Widget_TextInput_Render,
        .Init = Widget_TextInput_Init,

UCC git Repository :: git.ucc.asn.au