Which way is better in C ?
Roger Oberholtzer
roger
Wed Jan 19 11:13:58 PST 2005
On Tue, 2005-01-18 at 16:18, Ben Duncan wrote:
> Ok, I am well on my way on the SLAG Menu system.
> It will have a limit of 64 Menu Set's, each set
> with a limit of 20 items. Each item can be a
> "SLAG" program, another Menu Set, or a "line".
> These are done using structure's and arrays.
>
> There is a 64 "user" menu array that is the list of the
> menu transversal as you go thru the system. It has the
> row, column, active menu item, and index to which
> Menu Set on this index.
>
> Now, the 64 limit's are on Application Set, not total
> menu set's. SO AR can have 64 menu sets, AP,Gl and so on.
> These definitions are stored in a SDEF Menu file.
>
> S-Lang has the ability to "read" the screen and return a malloc'd
> buffer of what the screen currently looks like (warts and all ;-> ).
>
> I though about adding a pointer to the buffer on the "user" structure
> to store what the screen looked like BEFORE a selection was made that
> A) opened a sub-sub-menu
> OR
> B) Called a SLAG program.
> Then when the task was done, simply push the screen image back
> out to the display. However, one then must keep up with freeing
> and or allocating the buffers.
>
> A alternate way, since I have the user transversal list, would be after each
> completed selection, simply run down the list and repaint the screen
> from the information in the list till I got to the last active one.
>
> So the questions becomes, from a C stand point, do I make and keep up with
> screen image buffers and push them out when a selection is completed, or
> is it/would it be just a good to simply re-build the screen from the
> transversal list I have?
>From a C POV, wouldn't you use ncurses? That has a concept of the
screen, occluding windows, and replacing the text that is no longer
covered by a pop-up (i.e., a menu). I have a few apps that use the
screen info to keep track of what a user types in an area of the screen.
But ncurses will make your life easier for this. And eliminate terminal
dependencies in your code and all.
>
>
> Thanks ..
+????????????????????????????+???????????????????????????????+
? Roger Oberholtzer ? E-mail: roger at opq.se ?
? OPQ Systems AB ? WWW: http://www.opq.se/ ?
? Nybrogatan 66 nb ? Phone: Int + 46 8 314223 ?
? 114 41 Stockholm ? Mobile: Int + 46 733 621657 ?
? Sweden ? Fax: Int + 46 8 314223 ?
+????????????????????????????+???????????????????????????????+
More information about the Linux-users
mailing list