From: Nit Khair Date: 2008-10-12T19:55:19+09:00 Subject: Re: Writing an OO wrapper (UI) Martin DeMello wrote: You > might get some inspiration from sup and raggle too, though I've not > looked at the source of either. > > martin I hope it is not inappropriate to continue this disc here (since its being mailed to a lot of people). 1. Looked at the source of sup. He does *not* use windows or panels at all -- only stdscr. One comment from source (the others are unprintable!): ## since we are currently only doing multiple full-screen modes, ## use stdscr for each window. once we become more sophisticated, ## we may need to use a new Ncurses::WINDOW ## I had initially asked some questions on the bugs-ncurses list (this is not ruby) and I had agreed with one person there that one should not use stdscr *at all* but panels. Panel take care of updating and managing themselves (in terms of which is on top etc) and when you delete a panel, what's under it is automatically displayed. That works excellently with me, since the menu calls other programs which call others and then you come back ... So I checked the source and (it seems) whenever a buffer is deleted, he pops the last one and refreshes/displays that. The only place he uses a field and form, is at the bottom, where he asks for From, To, CC etc in the last line, and then invokes my $EDITOR. i have only sent a mail using sup, not done anything else. 2. I then checked Raggle (not installed just looked at source). He only uses Windows and not panels. So when a window is removed, it seems he refreshes all the windows in $win (which is a global array for all windows). So my initial impression, is that these project are not ideal for understanding how ncurses is to be used. However, i think sup would be great for me to get ideas on how to allow customization of my app. The sup "TextField" class takes into account history and completions which could be useful someday. 3. I had checked Shoes some days back, it seems all the windowing code is in the C compiled file. ---- Anyway, I am wondering if you (or anyone) could give me some inputs on this problem i face. A) I have my project files in a folder. The templates, the application modules and runtime classes etc. In the *same* directory i create my DSLS and then generate programs to run. Its becoming a mess. If i use another working folder for my DSLs and output programs, the requires will fail. How does one go about working on a project in one location, and using it in another. (I do not want to place my project in /opt/local/...site_ruby, while I am developing). B) I have been looking through various projects, and I see one structure: Lets say the project is proj v 0.1 proj0.1 - lib/ -- proj.rb -- proj/ --- x.rb, y.rb etc Is there a place where this structure is explained? I understand that proj.rb is a common module. Is this the name of the file that is required. I would appreciate a link to some place where all this is explained. Thanks. -- Posted via http://www.ruby-forum.com/.