Omnimaga
Calculator Community => TI Calculators => Calculator C => Topic started by: CiriousJoker on July 20, 2014, 09:17:10 am
-
Lets say i have this function:
int main()
{
nio_console csl;
lcd_ingray();
clrscr();
nio_InitConsole(csl, 54, 30, 0, 0, 0, 15);
nio_DrawConsole(csl);
nio_drawing_enabled(&csl,TRUE);
nio_cursor_type(&csl, NIO_CURSOR_UNDERSCORE);
doSomething();
}
int doSomething()
{
const char * title = "Title";
const char * subtitle = "Sub titile";
const char * msg1 = "Element 1";
const char * msg2 = "Element 2";
char * defaultvalue = "default value";
char * value;
int len;
int value1 = 42;
int value2 = 1337;
char popup1_result[256];
char popup2_result[256];
if (show_1numeric_input(title, subtitle, msg1, &value1, -42, 9001) != 1) return 0;
sprintf(popup1_result, "%s:%d", msg1, value1);
show_msgbox(title, popup1_result);
}
(It's some code of the "ndless_popup_tests" example)
Than that results in a completely awkward screen.
If i use standard messagebox with title and content then it works perfectly and the box will be drawn over the console window.
However, using the used messagebox works so its just a graphical problem.
Is there a possibility to close the console window somehow and open it afterwards?
-
seems to be a problem with the grayscale mode...
if i add lcd_incolor();when i call the function, it "just" makes this graphical bug
EDIT: when i use the f10 (connect) command of the emulator, the screen is refreshed and it displays correctly.
Is there any similiar method in c or any ndless related library?
-
Problem solved now:
if you want to display messageboxes and console together, you have to switch between grayscale mode and color mode with
lcd_incolor();
lcd_ingray();
else it produces such graphic bugs :w00t:
-
Using refresh_osscris a bad idea. I would advise you never to use it, because it refreshes the documents screen, which can take forever if you have a lot of folders. A better way would be to create your own dialog box functions. Or better yet, just ask for the number in the console itself.
-
For now, it works fine and if the user has so much folders, its not my fault :P
Right now i dont notice any delay and i have quite some folders...
I don't think this much of a problem. I just used this version with the messagebox
because i was too lazy to make my own console function, this way its one line + some stuff
around to get the data into a struct.
However, thanks for the notice, if i feel some delay, i'll make use of it :thumbsup:
EDIT: tryed it out on my real calculator and it really slowed it down, thanks, i fixed it <3