This repository has been archived by the owner on Dec 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Text Edit
Soar edited this page Jun 21, 2017
·
4 revisions
char buffer[256]; //must be out of the func of GuiMain()
void GuiInit(){ //this func shold be call before GuiMain() and keep it run 1 time
strcpy(buffer, "This is some content"); //if u want to init a default text for the text edit
}
void GuiMain(){
nk_begin(.... // create a nk_window
// must be keep the fllow code between nk_begin... and nk_end...
nk_flags event = nk_edit_string_zero_terminated(ctx,
NK_EDIT_BOX|NK_EDIT_AUTO_SELECT, //fcous will auto select all text (NK_EDIT_BOX not sure)
buffer, sizeof(buffer), nk_filter_ascii);//nk_filter_ascii Text Edit accepts text types.
nk_end(ctx);//end a nk_window
}