TweetFollow Us on Twitter

Nov 91 Letters
Volume Number:7
Issue Number:11
Column Tag:Letters

Strip Printing

By Kirk Chase, Editor

Larry Resestein at August BAMADA

James Plamondon

Fourth Wednesday of the month at 7PM, in the Mountain View Room of Apple’s City Center Four building, at 20450 Steven’s Creek Boulevard, Cupertino

Larry Rosenstein, MacApp wizard, was the speaker at the August BAMADA meeting where he discussed a few ideas from his book, C++ Programming with MacApp. First, he discussed filtered commands, which are described in detail in Chapter 25 of his book. The goal of the filtered command mechanism is to reduce the amount of information that one must maintain in order to undo or redo a command.

Larry gave the example of a styled text document, containing hundreds of different style runs (a little bold Times, some 9-point Zapf Chancery, a dash of italic Courier, etc. -- a real ransom-note document). If the user selected all of the document’s styled text, and set it to plain Geneva 12, saving the previous state of the document -- with all of its different styles -- could take a lot of space; in the worst case, you might have to save off the entire document.

Filtered commands solve this problem. Instead of saving the pre-change data, and then altering the document in accordance with the command, the command just installs a filter into each affected piece of data which makes it LOOK as if it has been changed. In the example above, each style run object would be filtered to look like it was plain Geneva 12. To undo the command, the filter is simply removed; to redo it, the filter is reapplied.

The mechanics of the approach are beyond the scope of this summary; besides, you can find them in Larry’s excellent book. Suffice it to say that the use of such commands simplifies the implementation of Undo/Redo significantly, and reduces the storage costs associated with it, at the cost of slightly slower data access times.

After Larry shined his light on filtered commands, he moved on to streaming. Streaming is also discussed in his book (in Chapter 22), and is a major feature of MacApp 3.0. By using streams for data I/O, one can handle input and output more abstractly; one can stream to a file or to the clipboard with equal ease.

The basic idea is that the TStream class is responsible for reading and writing bytes, or aggregates of bytes, from and to “something.” TStream’s subclasses implement the abstract methods that do the reading an writing. For example, a TFileStream would implement reading and writing to a file, while a THandleStream would implement reading and writing to a memory block. A TCountingStream wouldn’t read or write anything -- it would just count the bytes that it was told to write; this is particularly useful when trying to find out if there’s enough room on a disk to hold a file, before you actually write it out (via a TFileStream).

Larry’s book describes streaming in much more detail than this, of course, and you’ll want to look into it, as streams are used extensively in MacApp 3.0.

Article missing

MacTutor

Due to an oversight on our part, the last part of Brendan Murphy's article on Modeless SFDialogs was missing. Here is a reprint of that final section.

Conclusion

After reading this article there are probably a lot of unanswered questions. These questions are left to the reader as an exercise (I always hated that in college). I’m not going to produce a Think C version or a MacApp version. I leave this honor to some hearty soul out there. I will release a maintenance version if enough bugs or deficiencies are brought to my attention. My hope for this piece of software is that it will someday be incorporated into Apple’s system software (7.x or 8.x) and thus make this article a moot exercise for future programmers.

In the future, I plan to write more articles on TCL and perhaps MacApp. I am already “cooking up” some ideas to remove some of the short comings of TCL, but I have not yet decided which idea to pursue. Half the battle is coming up with the idea and half the battle is sticking with the idea and half the battle is implementing the idea. Yes, that adds up to 3/2 which goes to show that anything worth doing, is more work than you thought.

A Problem Stripping

Deborah E. Meadow

Cormetrics Medical Systems, Inc.

61 Barnes Park Road North

Wallingford, CT 06492-0333

(203) 265-5631

Now that the title has caught your attention, here is somthing interesting. While a the Boston MacWorld, Deborah Meadow approached me with an unsual problem. From the above address, you can see that she works for a medical group. Her problem involves printing. Some things such as EKG strips are printed in a continuous fashion, i.e. they are not spooled by the page as Mac printing is usually done. What she would like is help in creating, hopefully, a general purpose driver to do real-time, strip printing. If you have an idea, please get in touch with her at the above address.

Cheshire Keeps on Smiling

Cheshire Grin Productions Ltd.

2145 Sherobee Rd., Ste. 43

Mississauga, Ontario, Canada L5A 3G8

Cheshire Grin has just added two new additions to their Stack Enhancers product. The first addition is the Browser Palette. This allows the user/developer to navigate cards quickly and do card management, such as renaming cards; its immediate benefit is navigation for incomplete stacks. The second addition to Stack Enhancers is the Search Palette. This palette allows you to search for text on a particular stack-great for keeping a list of cards that meet the search criterea. Contact Cheshire Grin for more information.

Prospective International Software Developers

The Software Toolworks

60 Leveroni Court

Novato, CA 94949

(415) 883-3000

Planning on making a trip overseas to a trade show or just curious about the world around you? The Software Toolworks has the product for you, World Atlas. This product puts the atlas on your computer. It comes complete with over 250 detailed maps in either black & white or color. There is also a database covering information such as population, climate, national holidays, and travel documents. Sort of a one stop shop in world travel information.

BitMap Error

Kirk Chase

MacTutor

I would like to point out an error in some code published in MacTutor, November 1990 ("Special Effects") and June 1991 ("Kolorize Your B&W Application"). Basically the code in question is the offscreen bitmap allocation function used in both articles. The offending line in the procedure NewBitMap is

bm->baseAddr=NewPtr(bm->rowBytes *(long (r->right - r->left));

This assumes a height the same size as the width. Correct it to the following:

bm->baseAddr=NewPtr(bm->rowBytes *(long (r->bottom - r->top));

Thanks to Randy Frank for pointing this out.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Netflix Games expands its catalogue with...
It is a good time to be a Netflix subscriber this month. I presume there's a good show or two, but we are, of course, talking about their gaming service that seems to be picking up steam lately. May is adding five new titles, and there are some... | Read more »
Seven Knights Idle Adventure drafts in a...
Seven Knights Idle Adventure is opening up more stages, passing the 15k mark, and players may find themselves in need of more help to clear these higher stages. Well, the cavalry has arrived with the introduction of the Legendary Hero Iris, as... | Read more »
AFK Arena celebrates five years of 100 m...
Lilith Games is quite the behemoth when it comes to mobile games, with Rise of Kingdom and Dislyte firmly planting them as a bit name. Also up there is AFK Arena, which is celebrating a double whammy of its 5th anniversary, as well as blazing past... | Read more »
Fallout Shelter pulls in ten times its u...
When the Fallout TV series was announced I, like I assume many others, assumed it was going to be an utter pile of garbage. Well, as we now know that couldn't be further from the truth. It was a smash hit, and this success has of course given the... | Read more »
Recruit two powerful-sounding students t...
I am a fan of anime, and I hear about a lot that comes through, but one that escaped my attention until now is A Certain Scientific Railgun T, and that name is very enticing. If it's new to you too, then players of Blue Archive can get a hands-on... | Read more »
Top Hat Studios unveils a new gameplay t...
There are a lot of big games coming that you might be excited about, but one of those I am most interested in is Athenian Rhapsody because it looks delightfully silly. The developers behind this project, the rather fancy-sounding Top Hat Studios,... | Read more »
Bound through time on the hunt for sneak...
Have you ever sat down and wondered what would happen if Dr Who and Sherlock Holmes went on an adventure? Well, besides probably being the best mash-up of English fiction, you'd get the Hidden Through Time series, and now Rogueside has announced... | Read more »
The secrets of Penacony might soon come...
Version 2.2 of Honkai: Star Rail is on the horizon and brings the culmination of the Penacony adventure after quite the escalation in the latest story quests. To help you through this new expansion is the introduction of two powerful new... | Read more »
The Legend of Heroes: Trails of Cold Ste...
I adore game series that have connecting lore and stories, which of course means the Legend of Heroes is very dear to me, Trails lore has been building for two decades. Excitedly, the next stage is upon us as Userjoy has announced the upcoming... | Read more »
Go from lowly lizard to wicked Wyvern in...
Do you like questing, and do you like dragons? If not then boy is this not the announcement for you, as Loongcheer Game has unveiled Quest Dragon: Idle Mobile Game. Yes, it is amazing Square Enix hasn’t sued them for copyright infringement, but... | Read more »

Price Scanner via MacPrices.net

Apple introduces the new M4-powered 11-inch a...
Today, Apple revealed the new 2024 M4 iPad Pro series, boasting a surprisingly thin and light design that pushes the boundaries of portability and performance. Offered in silver and space black... Read more
Apple introduces the new 2024 11-inch and 13-...
Apple has unveiled the revamped 11-inch and brand-new 13-inch iPad Air models, upgraded with the M2 chip. Marking the first time it’s offered in two sizes, the 11-inch iPad Air retains its super-... Read more
Apple discontinues 9th-gen iPad, drops prices...
With today’s introduction of the new 2024 iPad Airs and iPad Pros, Apple has (finally) discontinued the older 9th-generation iPad with a home button. In response, they also dropped prices on 10th-... Read more
Apple AirPods on sale for record-low prices t...
Best Buy has Apple AirPods on sale for record-low prices today starting at only $79. Buy online and choose free shipping or free local store pickup (if available). Sale price for online orders only,... Read more
13-inch M3 MacBook Airs on sale for $100 off...
Best Buy has Apple 13″ MacBook Airs with M3 CPUs in stock and on sale today for $100 off MSRP. Prices start at $999. Their prices, along with Amazon’s, are the lowest currently available for new 13″... Read more
Amazon is offering a $100 discount on every 1...
Amazon has every configuration and color of Apple’s 13″ M3 MacBook Air on sale for $100 off MSRP, now starting at $999 shipped. Shipping is free: – 13″ MacBook Air (8GB RAM/256GB SSD): $999 $100 off... Read more
Sunday Sale: Take $150 off every 15-inch M3 M...
Amazon is now offering a $150 discount on every configuration and color of Apple’s M3-powered 15″ MacBook Airs. Prices start at $1149 for models with 8GB of RAM and 256GB of storage: – 15″ M3 MacBook... Read more
Apple’s 24-inch M3 iMacs are on sale for $150...
Amazon is offering a $150 discount on Apple’s new M3-powered 24″ iMacs. Prices start at $1149 for models with 8GB of RAM and 256GB of storage: – 24″ M3 iMac/8-core GPU/8GB/256GB: $1149.99, $150 off... Read more
Verizon has Apple AirPods on sale this weeken...
Verizon has Apple AirPods on sale for up to 31% off MSRP on their online store this weekend. Their prices are the lowest price available for AirPods from any Apple retailer. Verizon service is not... Read more
Apple has 15-inch M2 MacBook Airs available s...
Apple has clearance, Certified Refurbished, 15″ M2 MacBook Airs available starting at $1019 and ranging up to $300 off original MSRP. These are the cheapest 15″ MacBook Airs for sale today at Apple.... Read more

Jobs Board

IN6728 Optometrist- *Apple* Valley, CA- Tar...
Date: May 8, 2024 Brand: Target Optical Location: Apple Valley, CA, US, 92308 **Requisition ID:** 824398 At Target Optical, we help people see and look great - and Read more
Nurse Anesthetist - *Apple* Hill Surgery Ce...
Nurse Anesthetist - Apple Hill Surgery Center Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Now Read more
LPN-Physician Office Nurse - Orthopedics- *Ap...
LPN-Physician Office Nurse - Orthopedics- Apple Hill Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Read more
Supervisor/Therapist Rehabilitation Medicine...
Supervisor/Therapist Rehabilitation Medicine - Apple Hill (Outpatient Clinic) - Day Location: York Hospital, York, PA Schedule: Full Time Sign-On Bonus Eligible Read more
BBW Sales Support- *Apple* Blossom Mall - Ba...
BBW Sales Support- APPLE BLOSSOM MALL Brand: Bath & Body Works Location: Winchester, VA, US Location Type: On-site Job ID: 04388 Job Area: Store: Sales and Support Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.