1. Wee Wish List
- Posted by K_D_R Feb 03, 2016
- 1249 views
While downloading Irv's latest EuGTK, I noticed his routine to add popup help for Gtk Widgets. The Gtk help file needed is about 5 directories deep in the Gtk3xxx installation folder so I copied all the files from /home/kenneth/gtk3/gtk+-3.18.7/docs/reference/gtk/html to a folder named Gtk3Docs which I placed in my wee directory. Then edited the path referenced in Irv's routine to reference /wee/Gtk3Docs:
-- /* mods for GTK widget help -- In wee.exw comment out following 3 lines -- if length(search_dat) = 0 then -- ui_message_box_error(window_title, "File not found: euphoria/docs/html/js/search.js") -- return -- end if -- */ end if -- search search.dat for matching entry help = {} for i = 1 to length(search_idx) do if equal(search_idx[i], word) then help = search_dat[i] exit end if end for if atom(help) or length(help) = 0 then -- /* Mods for Gtk widget help -- insert following 3 lines if match("Gtk",word) > 0 then -- assume gtk docs in ~/wee/Gtk3Docs folder ui_show_uri("FILE://"& canonical_path(sprintf("~/wee/Gtk3Docs/%s.html",{word}))) else -- /* -- view_declaration() -- uncomment this line and comment -- out the following 4 lines -- to automatically view declaraton -- if html help is not available ui_message_box_error("Help", "Didn't find any help on the topic: "&word& "\nPlease put the cursor over an Euphoria identifier"& "\nor standard library routine and try again.") end if -- Gtk Widget help mod -- insert return end if
Works like a charm, but I got to thinking that perhaps the F1 hotkey help routine could be expanded to automatically or optionally call the view_declaration() routine if a help topic is not available. I suppose the ui_message_box_error routine could be edited to provide an option to view the declaration or simply continue.
Ken Rhodes