Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!kuhub.cc.ukans.edu!markv From: markv@kuhub.cc.ukans.edu Newsgroups: comp.sys.amiga.programmer Subject: Re: Using the Layers library to do non-Intuition windows Message-ID: <1991Apr19.162052.29848@kuhub.cc.ukans.edu> Date: 19 Apr 91 21:20:52 GMT References: <1991Apr19.003233.16889@netcom.COM> Organization: University of Kansas Academic Computing Services Lines: 81 In article <1991Apr19.003233.16889@netcom.COM>, rodent@netcom.COM (Ben Discoe) writes: > > I'm working on a custom screen and I'd like to manipulate several > "text windows" without using real Intuition windows. In fact, I am > trying to emulate the manner in which MSDOS applications allow > "windowing" on text-based screens. I think the Layers library is > ideal for doing this? > > 1. The windows won't be moved or resized, but they will be opened, > closed, and depth-arranged under program control. > 2. Using SMART_REFRESH layers would make the Amiga do all my > refreshing for me, I assume. > 3. I DON'T want Intuition redirecting the user input, drawing a window > title, responding to the mouse etc. > > Is creating my own Layers a good idea? I've never heard of anyone doing > this before (Layers lib seems like toolkit for Intuition's use only). No, generally its not. Esp. if your a novice Amiga programmer there is a lot to worry about with Layers library. I would use intution and open windows with the following either as BORDERLESS or with no flags (which will give a single line border but no system gadgets). Intuition will only render what it is supposed to. With a BORDERLESS SMARTREFRESH inituion will refresh exposed areas, although you still have to deal with REFRESH messages, such as when its resized. I suggest using windows because Windows are much easier to deal with and much less easy to cause problems with than simple layers. You can still use intuition to do your window managment, but under program control, via things like WindowToFront(), ResizeWindow(), MoveWindow() etc. Also, since you have a text application, if you wish to have a true charecter stream input and/or output, you can attach consoles to each window, for either read, write, or both. For instance, I did a simple editor that I used Intuition for input (to support menus, etc), but by having a console attached to the window for output, things were greatly simplified. This is even more powerful with the 2.0 console device. In 2.0 you can even attach a DOS CON: filehandle to an existing window with an open call like: FILE *ConOut; struct Window *MyWind: char *ConName[255+1]; MyWind = OpenWindow(foo stuff...); sprintf(ConName, "CON://////WINDOW %p", MyWind); ConOut = fopen(ConName, "w"); or open a "quiet" CON like: ConOut = fopen("CON:/0/0/640/200/DummyTitle/NOBORDER/NODRAG/NOSIZE", "w"); In General, the 2.0 CON: supports the following flags (that are seperated by / following the Title argument): AUTO -Only open if I/O occurs. CLOSE -Put Close gadget on window WAIT -Hold of close until Close gad clicked or CTRL-\ WINDOW 0xAddr -Use Specifed window (may be on custom screen). SCREEN name -Open on public screen name BACKDROP -Open as backdrop window. NODRAG -Leave off drag bar (and title) NOBORDER -BORDLESS window NOSIZE -Leave off sizing gad SIMPLE -Open as SIMPLE_REFRESH SMART -Open as SMART_REFRESH Hope this helps. > ------------------- > Ben in San Jose, programmer/ecologist at large. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Mark Gooderum Only... \ Good Cheer !!! Academic Computing Services /// \___________________________ University of Kansas /// /| __ _ Bix: mgooderum \\\ /// /__| |\/| | | _ /_\ makes it Bitnet: MARKV@UKANVAX \/\/ / | | | | |__| / \ possible... Internet: markv@kuhub.cc.ukans.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~