How do I set up a menu item to read a text file? - General Discussion and Assistance - CHDK Forum supplierdeeply

How do I set up a menu item to read a text file?

  • 2 Replies
  • 1887 Views
How do I set up a menu item to read a text file?
« on: 10 / November / 2008, 23:14:25 »
Advertisements
Hi,

I want to add a help menu item to a menu. To do this I just want to use the text file reader to read an existing text file.

I have tried calling gui_draw_read_selected, but can't get it to work.
Next I tried to fake the text file reader into thinking that my existing file was the last file read.  This doesn't work, but at least it doesn't crash.
Does anyone have a better suggestion?
Code: [Select]
    {LANG_MENU_MY_HELP,     MENUITEM_PROC,      (int*)gui_my_help },
...

void gui_my_help(int arg) {
strcpy(conf.reader_file,"A:/CHDK/BOOKS/myhelp.txt");
gui_draw_read_last(1);
}

*

Offline Hacki

  • ****
  • 358
  • SX100
Re: How do I set up a menu item to read a text file?
« Reply #1 on: 11 / November / 2008, 07:51:31 »
"A:/CHDK/BOOKS/myhelp.txt"

Is wrong. You're using it like windows paths, but its supposed to be just "A/PATH/TO/FILE", without the colon..

Hope this helps.

Re: How do I set up a menu item to read a text file?
« Reply #2 on: 11 / November / 2008, 10:35:46 »
That was the problem, how stupid of me. 
Thanks I never would have caught that.

 

Related Topics