Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!mailrus!csd4.milw.wisc.edu!bionet!agate!ucbvax!hplabs!otter!grg From: grg@otter.hpl.hp.com (Gerd Groos) Newsgroups: comp.windows.ms Subject: Re: Glockenspiel C++ Message-ID: <10960005@otter.hpl.hp.com> Date: 7 Aug 89 18:23:24 GMT References: <5157@umd5.umd.edu> Organization: Hewlett-Packard Laboratories, Bristol, UK. Lines: 104 CommonView is a C++ library sold with the Glockenspiel C++ compiler. Here an example for those unfamiliar with it. This 'Doodle' example opens a window and lets you draw lines in it with the mouse. Compiles down to a normal MS Windows application. Compare it with SDK's doodle example... // ------------------------------------- #include // CommonView library declarations class DoodleWind : public TopAppWindow { Point LastPt; protected: long far MouseDrag ( MouseEvt ); long far MouseButtonDn ( MouseEvt ); }; void App::far Start() // window's main() { DoodleWind Doodle; // open window Doodle.EnableSysMenu (); // appearance (not mandatory) Doodle.EnableBorder (); // "" Doodle.SetCaption ( "Doodle" ); // title (not mandatory) Doodle.Show (); // display it Exec (); // kick off ms window event handler } long DoodleWind::far MouseButtonDn ( MouseEvt Evt ) // called if MouseButtons { // pushed in this window LastPt = Evt.Where (); // remember start point } long DoodleWind::far MouseDrag ( MouseEvt Evt ) // called when mouse is dragged { MoveTo ( LastPt ); LineTo ( LastPt = Evt.Where ()); // draw line } // ------------------------------------- > The examples stink and are unreadable! Better read the manual. > The windows interface looks too much like MS Windows C coding. Compare the Glockenspiel source examples with the SDK ones. Which ones are easier to read? To quote Glockenspiel: (manual page CV1-5): CommonView makes no attempt to iron out differences in the look and feel of different systems. That's because someone running an application on a Sun doesn't want it to look and feel like PS/2 and conversely. > C++ still uses a rc file to further seperate the code from its meaning, > once again I must write my own dialog box code like I did for Actor. Use dialog.exe to interactively build dialog boxes etc. in MS Windows with the mouse. > There is a product called C_Talk which I have on order. The little > I saw from it in the adds tells me it it much much better than Common View. Could you tell me more? >I was able to crash windows very easily be creating too many C++ objects. Happened to me when stack/heapsize was to small in the .def file My personal opinion on CommonView: 1. It uses an accepted language (C++). Applications get all the MS Windows functionality for free (hardware independance, handling etc.). 2. Glockenspiel guarantees (so they write) portability between MS Windows and PS/2 (the OS/2 window manager). They told me they are working on a X11 version (via Motif). 3. I see several advantages of CommonView over 'C' MS Windows programming: 1. Easier to learn. It took me two weeks to get into CommonView without previous window programming experience. And it was fun. 2. CommonView hides the setup and handling of data structures that makes up most of any 'C' MS Windows source code. 3. I had no need for Windows software or hardware debuggers. CommonView does the MS Windows housekeeping, so you can't mess it up. The usual logical bugs in my code are easy to find as the application doesn't hang. 4. Not much point using Glockenspiel's compiler without extended memory. 5. CommonView let's you do any MS Window call via handles. This is nice if you do unusual things like interfacing hardware. 5. Maybe not the best object oriented windows interface. But a good and usable one. Gerd. -------------------------------------------------------------- A good programmer can produce Fortran programs in any language