Skip to content
Soar edited this page Jun 21, 2017 · 6 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

}
Clone this wiki locally