Rick,
Sure, Pascal menuing would be preferable to calling c's menu. I'm working on making ncurses function across more of the gnu/gpc platforms. ("More" but I probably won't be able to make it autoconfigure across all.) I have our specific application (Dr. Pascal) as my primary goal, so I'm not going to put effort into writing a library for menu use.
I would guess that I and other gpc programmers would find it valuable to have a general-purpose menuing function that could both call ncurses and do menuing on a "terminal", and with the same library calls, do platform-appropriate menuing on macintosh OSX or windows. Writing such a library, I think, would be a substantial task and definately is beyond my time and ability.
- Willett
On 2 May 2005, at 9:25 AM, Rick Engebretson wrote:
willett wrote:
Rick Engebretson wrote:
There are many C libraries that use ncurses. Menu, panel, CDK to name a few.
But all the added C constructs can be done better through Pascal. Instead of working to access these ncurses derivatives, perhaps object pascal and ncurses is enough.
Rick, thanks for trying to save me some time. I'm thinking I'd like to use menu, which is already documented and tested, rather than writing my own. So I might do that interface. The others I would definately leave. (Panel is said to be buggy) Or were you volunteering to write a Pascal version of menu?
Willett Kempton
I'm approaching it differently. Among the many gains with Object Pascal are encapsulation, polymorphism, dynamic variables, etc. So how the menu or panel C functions manage ncurses doesn't concern me. A menu or panel is an ObjectWindow (the type I'm trying to use) like any other window. Same with a button. With Pascal, these objects can be created and managed with ease. If someone chooses to develop an object inheritance scheme with virtual methods, fine. But then you need extensive documentation and have TurboVision or worse (Java). I seek simplicity.
Obviously, there is a lot of prior GUI effort to consider. Tk and its object variant incrTcl are nice.
Again, a menu, panel or button is just a window. And you can already program windows with ncurses. I am only suggesting that you limit your use of C code. Let Pascal do most of the work.
I learned a long time ago ( pushing the fiber-optic supernetwork ) never to try please programmers.