TweetFollow Us on Twitter

ViewIt
Volume Number:8
Issue Number:7
Column Tag:Tools of the Trade

Faceware's ViewIt

Differs from other interface designers and toolbox extenders in its simple code writing.

By Philip Borenstein, MacTutor Regular Contributing Author

What is ViewIt?

The promotional literature that FaceWare puts out describes ViewIt as a window designer and manager. That description is accurate, but it makes ViewIt sound like yet another interface design kit. FaceWare also describes ViewIt as extensions to the Macintosh Dialog Manager and Control Manager. And that’s true, too. What these descriptions don’t convey is how different ViewIt is from other interface designers and toolbox extenders.

Like other interface-building tools, ViewIt lets you create windows and lay out controls in those windows. But instead of generating source code that you customize, ViewIt uses code resources that already know how to manage those windows and controls. This approach has some clear advantages and some drawbacks. Depending on the kinds of applications you write, the advantages may outweigh the drawbacks.

The main advantage is that the code that you write is remarkably simple. Most of what you do is set up a window, call the main event loop routine, and check for hits in your controls. In general, you don’t need to concern yourself with the Macintosh Toolbox. The main disadvantage is that most of the behavior is locked away in code resources, so your application may be carrying around extra baggage that you don’t really need.

What’s in the package?

ViewIt works with most popular Macintosh development environments. The commercial version comes with demo programs for THINK C, THINK Pascal (both of which can be used with MPW C and MPW Pascal), Absoft Fortran, Language Systems Fortran, and MacFortran. The THINK C and THINK Pascal programs come with ready-to-use projects. Two separate utilities let you use FaceWare modules with HyperCard and Prograph.

The ViewIt package consists of three parts: FaceIt, ViewIt, and UtilIt. ViewIt is the part of the system that lets you lay out controls in windows. FaceIt is the part of the system that deals with the main event loop, the menu bar, and other program-wide features. UtilIt consists of utility routines used by FaceIt, ViewIt, and by your own program.

You can use the ViewIt module without the FaceIt module to design modal dialog boxes. With FaceIt you get automatic support for modeless windows. The documentation does tell you how you can use ViewIt modeless windows in programs that have an existing event loop, but if you’re starting from scratch, you may not want to go through the trouble.

All the modules that make up ViewIt live in a resource file called FaceWare. You can place this file in your System folder, so all your ViewIt-based applications can share it, or you can copy resources from the FaceWare file into your application to create stand-alone applications.

ViewIt costs $95. FaceWare distributes a shareware version that includes nearly everything that comes in the commercial package. You can use the shareware version for 30 days. After that, you either get rid of it, or you buy the commercial package.

How does it work?

Instead of customizing source code, you make calls to a dispatching routine called FaceIt() which loads the appropriate modules for program-wide behavior like cutting, pasting, and printing and for control-specific behavior. In addition the standard Macintosh control manager, which uses CDEFs and CNTLs, ViewIt uses its own control drivers (stored in FCMD resources) and control descriptions (stored in FCTL resources). These FCMDs are the code resources that do all the work.

To create windows and lay out controls, you don’t use a separate application. You don’t even need to use ResEdit. Instead, you lay out the controls while your application is running. Once you’ve created a window, you press the Command-Shift-Option keys to enter ViewIt’s editing mode. In this mode, you can add or delete new controls and edit existing controls. To see how they’ll work, you just press the Enter key and you’re back in run mode again.

Since the edit mode is part of ViewIt (it’s stored in the FaceWare file), you can fine tune your user interface without using your development environment. Suppose you’re doing a demo for your users, and they say, “This button should be red. That menu should be over there.” All you have to do is go into edit mode, make the changes, and try them out. ViewIt comes with a smaller FaceWare file without the edit mode that you can use when your application is finished.

The FaceWare file with the on-line editing support takes up about 1 MB, and the file without the on-line editing support is about 440K.

This picture shows one of the dialogs used for editing a control. The Driver Help button brings up another window that contains the on-line help for buttons.

What kinds of interface elements does ViewIt handle?

In addition to the standard controls that the Macintosh Dialog Manager provides (buttons, check boxes, radio buttons, static text, and editable text) ViewIt also gives you pop-up menus, picture-based palettes, graphic buttons based on PICTs, ICONs, and SICNs, dials, and more esoteric controls like a help text viewer and a scrap viewer.

You can specify the color and framing style of any control. For text-based controls, you can set the font, size, style, and text color. You can have buttons draw their text in bold, outline Palatino, or you can have right-justified check boxes with the check box on the right side of the text. Most controls have several variations. Pop-up menus, for example, come in several varieties. Some menus behave like menus in the main menu bar. Some menus check only one item at a time while others have several items checked.

Every control belongs to a view, which is kind of a meta-control, and a window can have several views. Views can be longer than the window they belong to, and it’s easy to add both horizontal and vertical scroll bars to them. Views let you group controls, so you can move them around as a unit. Since you can show and hide views, you can use them for dialogs that have multiple pages.

ViewIt makes a distinction between a control’s appearance and its behavior. This distinction is useful for picture-based controls. For instance, you can have an icon behave like a button, so it highlights while the mouse button is pressed on it. Or you can have several icons behave like radio buttons where only one icon of a group is highlighted at a time. Of course, some combinations, like editable buttons, don’t work because the CDEF or FCMD doesn’t support a particular behavior, and other combinations, like check boxes that behave like radio buttons, will get you into trouble with the user interface police.

If you want to make a control behave a little (or a lot) differently, ViewIt gives you hooks that let you intercept virtually everything a control does.

In traditional dialog box programming, when you have a list of radio buttons, check boxes, or other controls, you need to set the controls’ values from one of your data structures. When the user dismisses the dialog, you need to get the value of each control and set your data structure accordingly. ViewIt has a nice feature called Data Linking that does this for you automatically. When you create a window, you pass ViewIt the address of a record. When you design your controls, you give the offset into the record where the value is stored. ViewIt takes care of doing all the numeric to string conversions-even for real numbers.

Of course, you don’t have to use Data Linking. You can have controls report when they’ve been hit. ViewIt uses a mechanism similar to menu events to tell you which control has been hit. ViewIt variables tell you which control, in which view, and in which window received the click. The ViewIt routines let you get the state of the control so you can tell what’s in an editable field, whether a check box is on or off, and so forth.

This picture shows a ViewIt window with two views in editing mode. The left view is a scrolling view that shows assorted controls. The right view is a Help Control that shows text.

Documentation

All of the ViewIt documentation is on-line, and it’s always available when you’re in edit mode. When you’re editing a specific control, you can click on a button to get its documentation. The documentation is right where you need it when you’re working, and it doesn’t clutter your desk. A printed manual, though, would have made learning ViewIt a bit easier.

With printed documentation you can flip through the pages to get a sense of what a piece of software is about, and even the manual’s physical size gives you a hint about the complexity of the software. With on-line manuals a list of topics in a menu may refer to half a kilobyte of text or two half a megabyte text. There’s no way to know.

The demo programs that come with ViewIt are complete in the sense that they show off virtually every feature, but a little hand-holding would have been nice. You can copy controls from the ViewIt demos and paste them into your own application, or you can try modifying them to see how different settings work.

Who is ViewIt for?

ViewIt is ideal for in-house programmers and consultants who need to write Macintosh applications quickly. Often, these programmers need to respond quickly to requests for new features, and ViewIt’s edit mode makes it easy for the programmer and the user to collaborate on the user interface. In-house programmers can take advantage of the fact that many ViewIt-based programs can share the same FaceWare file. This arrangement keeps the application size small.

ViewIt is also useful for programmers who have existing programs that they need to port to the Macintosh. ViewIt is much easier to learn to use than the Macintosh Toolbox. It’s certainly easier to learn ViewIt than it is to learn object-oriented programming, and for vanilla Macintosh programs, ViewIt handles most of the Macintosh housekeeping tasks.

Commercial (and shareware) software vendors may find that ViewIt’s overhead makes ViewIt-based applications larger than hand-rolled applications, particularly for small applications. It is possible to move only the resources your application uses from the FaceWare file. ViewIt comes with a utility program to do just that.

Summary

ViewIt is a surprisingly powerful interface-builder. Its approach to the problem is considerably different from the other tools on the market, so it may be difficult to get into it at first. For non-Macintosh programmers who need to put together a Macintosh application in a hurry, ViewIt takes care of most of the standard housekeeping chores. ViewIt doesn’t require you to learn object-oriented programming or a class library.

The only way you’ll be able to decide whether ViewIt will work for your application is to try it. You can use the shareware version of ViewIt for 30 days, and if you like it, you’re obligated to buy the full version. If not, you can wipe it off your disk, and program like you programmed before.

For more information

FaceWare

1310 N. Broadway, Urbana, IL 61801

217/328-5842 • AppleLink: D1323

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Make the passage of time your plaything...
While some of us are still waiting for a chance to get our hands on Ash Prime - yes, don’t remind me I could currently buy him this month I’m barely hanging on - Digital Extremes has announced its next anticipated Prime Form for Warframe. Starting... | Read more »
If you can find it and fit through the d...
The holy trinity of amazing company names have come together, to release their equally amazing and adorable mobile game, Hamster Inn. Published by HyperBeard Games, and co-developed by Mum Not Proud and Little Sasquatch Studios, it's time to... | Read more »
Amikin Survival opens for pre-orders on...
Join me on the wonderful trip down the inspiration rabbit hole; much as Palworld seemingly “borrowed” many aspects from the hit Pokemon franchise, it is time for the heavily armed animal survival to also spawn some illegitimate children as Helio... | Read more »
PUBG Mobile teams up with global phenome...
Since launching in 2019, SpyxFamily has exploded to damn near catastrophic popularity, so it was only a matter of time before a mobile game snapped up a collaboration. Enter PUBG Mobile. Until May 12th, players will be able to collect a host of... | Read more »
Embark into the frozen tundra of certain...
Chucklefish, developers of hit action-adventure sandbox game Starbound and owner of one of the cutest logos in gaming, has released their roguelike deck-builder Wildfrost. Created alongside developers Gaziter and Deadpan Games, Wildfrost will... | Read more »
MoreFun Studios has announced Season 4,...
Tension has escalated in the ever-volatile world of Arena Breakout, as your old pal Randall Fisher and bosses Fred and Perrero continue to lob insults and explosives at each other, bringing us to a new phase of warfare. Season 4, Into The Fog of... | Read more »
Top Mobile Game Discounts
Every day, we pick out a curated list of the best mobile discounts on the App Store and post them here. This list won't be comprehensive, but it every game on it is recommended. Feel free to check out the coverage we did on them in the links below... | Read more »
Marvel Future Fight celebrates nine year...
Announced alongside an advertising image I can only assume was aimed squarely at myself with the prominent Deadpool and Odin featured on it, Netmarble has revealed their celebrations for the 9th anniversary of Marvel Future Fight. The Countdown... | Read more »
HoYoFair 2024 prepares to showcase over...
To say Genshin Impact took the world by storm when it was released would be an understatement. However, I think the most surprising part of the launch was just how much further it went than gaming. There have been concerts, art shows, massive... | Read more »
Explore some of BBCs' most iconic s...
Despite your personal opinion on the BBC at a managerial level, it is undeniable that it has overseen some fantastic British shows in the past, and now thanks to a partnership with Roblox, players will be able to interact with some of these... | Read more »

Price Scanner via MacPrices.net

You can save $300-$480 on a 14-inch M3 Pro/Ma...
Apple has 14″ M3 Pro and M3 Max MacBook Pros in stock today and available, Certified Refurbished, starting at $1699 and ranging up to $480 off MSRP. Each model features a new outer case, shipping is... Read more
24-inch M1 iMacs available at Apple starting...
Apple has clearance M1 iMacs available in their Certified Refurbished store starting at $1049 and ranging up to $300 off original MSRP. Each iMac is in like-new condition and comes with Apple’s... Read more
Walmart continues to offer $699 13-inch M1 Ma...
Walmart continues to offer new Apple 13″ M1 MacBook Airs (8GB RAM, 256GB SSD) online for $699, $300 off original MSRP, in Space Gray, Silver, and Gold colors. These are new MacBook for sale by... Read more
B&H has 13-inch M2 MacBook Airs with 16GB...
B&H Photo has 13″ MacBook Airs with M2 CPUs, 16GB of memory, and 256GB of storage in stock and on sale for $1099, $100 off Apple’s MSRP for this configuration. Free 1-2 day delivery is available... Read more
14-inch M3 MacBook Pro with 16GB of RAM avail...
Apple has the 14″ M3 MacBook Pro with 16GB of RAM and 1TB of storage, Certified Refurbished, available for $300 off MSRP. Each MacBook Pro features a new outer case, shipping is free, and an Apple 1-... Read more
Apple M2 Mac minis on sale for up to $150 off...
Amazon has Apple’s M2-powered Mac minis in stock and on sale for $100-$150 off MSRP, each including free delivery: – Mac mini M2/256GB SSD: $499, save $100 – Mac mini M2/512GB SSD: $699, save $100 –... Read more
Amazon is offering a $200 discount on 14-inch...
Amazon has 14-inch M3 MacBook Pros in stock and on sale for $200 off MSRP. Shipping is free. Note that Amazon’s stock tends to come and go: – 14″ M3 MacBook Pro (8GB RAM/512GB SSD): $1399.99, $200... Read more
Sunday Sale: 13-inch M3 MacBook Air for $999,...
Several Apple retailers have the new 13″ MacBook Air with an M3 CPU in stock and on sale today for only $999 in Midnight. These are the lowest prices currently available for new 13″ M3 MacBook Airs... Read more
Multiple Apple retailers are offering 13-inch...
Several Apple retailers have 13″ MacBook Airs with M2 CPUs in stock and on sale this weekend starting at only $849 in Space Gray, Silver, Starlight, and Midnight colors. These are the lowest prices... Read more
Roundup of Verizon’s April Apple iPhone Promo...
Verizon is offering a number of iPhone deals for the month of April. Switch, and open a new of service, and you can qualify for a free iPhone 15 or heavy monthly discounts on other models: – 128GB... Read more

Jobs Board

Relationship Banker - *Apple* Valley Financ...
Relationship Banker - Apple Valley Financial Center APPLE VALLEY, Minnesota **Job Description:** At Bank of America, we are guided by a common purpose to help Read more
IN6728 Optometrist- *Apple* Valley, CA- Tar...
Date: Apr 9, 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
Medical Assistant - Orthopedics *Apple* Hil...
Medical Assistant - Orthopedics Apple Hill York Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Now Read more
*Apple* Systems Administrator - JAMF - Activ...
…**Public Trust/Other Required:** None **Job Family:** Systems Administration **Skills:** Apple Platforms,Computer Servers,Jamf Pro **Experience:** 3 + years of Read more
Liquor Stock Clerk - S. *Apple* St. - Idaho...
Liquor Stock Clerk - S. Apple St. Boise Posting Begin Date: 2023/10/10 Posting End Date: 2024/10/14 Category: Retail Sub Category: Customer Service Work Type: Part Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.