Danh mục

The Cocoa Difference

Số trang: 10      Loại file: pdf      Dung lượng: 43.99 KB      Lượt xem: 21      Lượt tải: 0    
Hoai.2512

Phí tải xuống: 1,000 VND Tải xuống file đầy đủ (10 trang) 0
Xem trước 2 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

5.10. The Cocoa Difference Here are some of the advantages Cocoa programs offer. Its worth reading
Nội dung trích xuất từ tài liệu:
The Cocoa Difference 5.10. The Cocoa DifferenceHere are some of the advantages Cocoa programs offer. Its worth reading—not to makeyou drool about a future when all Mac programs will fall into this category, but to helpclear up any confusion you may have about why certain features seem to be present onlyoccasionally.Note: The following features appear in almost all Cocoa programs. Thats not to say thatyoull never see these features in Carbonized programs; the occasional Carbon programmay offer one of these features or another. Thats because programmers have to do quite abit of work to bring them into Carbon applications—and almost none to include them inCocoa ones.5.10.1. The Font PanelThe Mac has always been the designers preferred computer, and Mac OS X onlystrengthens its position. For one thing, Mac OS X comes with over 200 absolutelybeautiful fonts that Apple licensed from commercial type companies.When you use a Carbon program, you usually access these fonts the same way as always:using a Font menu. But when you use a Cocoa program, you get the Font panel, whichmakes it far easier to organize, search, and use your font collection. Chapter 14 describesfonts, and the Font panel, in more detail.5.10.2. Title Bar TricksYou may remember from Chapter 2 that the title bar of every Finder window harbors asecret pop-up menu. When you Control-click it (or right-click, or -click), youreshown a little folder ladder that delineates your current position in your folder hierarchy.You may also remember that the tiny icon just to the left of the windows name is actuallya handle that you can drag to move a folder into a different window.In Cocoa programs, you get the same features in document windows, as shown backinFigure 2-5 (Section 2.4.4). (This feature is available in many Carbonized programs, but itisnt a sure thing.) By dragging the tiny document icon next to the documents name, youcan perform these two interesting stunts: • Drag to the desktop. By dragging this icon to the desktop, or onto a folder or disk icon, you create an instant alias of the document youre working on. This is a useful feature when, for example, youre about to knock off for the night, and you want easy access to whatever youve been working on when you return the next day. • Drag to the Dock. By dragging this title-bar icon onto the Dock icon of an appropriate program, you open your document in that other program. For example, if youre in TextEdit working on a memo, and you decide that youll need the full strength of Microsoft Word to dress it up, you can drag its title-bar icon directly onto the Word icon in the Dock. Word then launches and opens up the TextEdit document, ready for editing.5.10.3. ServicesApple has always dreamed of a software architecture that would let you mix and matchfeatures from different programs—using the Macs spell checker in Microsoft Word, thedrawing tools of PowerPoint in your email program, and so on. (Remember ApplesOpenDoc software project? Neither does anybody else.)In Mac OS X, Apples dream has finally become a reality, sort of. Nestled in theApplication menu of almost every Mac OS X program is a command called Services. Itssubmenu lists several functions that technically belong to other programs, as describedbelow.Unfortunately, these commands are dimmed when you use most Carbonized programs.They become available only when you use Cocoa programs like iChat, TextEdit, Mail,OmniWeb—and the Finder.(Yes, the Finder is a Carbon program. But remember thatprogrammers can add Cocoa features to their older, Carbonized programs; it just takes alot of work.)Heres a summary of what they do:Note: Not all of these Services work in all programs—even Cocoa programs.Implementing them is left to programmers discretion.5.10.3.1. ChineseTextConverterTalk about obscure: This utility, formerly located in your Applications Utilitiesfolder, converts selected text that youve written in Chinese using its Simplified textsystem into the Chinese Traditional text system—or vice versa. Let the celebration begin!5.10.3.2. Disk UtilityHeres another Service that everyday Mac fans havent exactly been clamoring for. Thisone lets software programmers and system administrators check to make sure that thedisk image files theyve created (Section 10.30.11.2) havent been altered—without evenhaving to double-click and mount the disk image.5.10.3.3. FinderThe three commands listed in this submenu work only in one situation: when youvehighlighted some text that precisely matches the name and folder path of any icon, suchas ~/Documents/Marge.jpg. (Details on path notation on Section 1.2.4.)At that point, you can choose any of these commands from the Services Findersubmenu: • Open.Opens the icon. This command, in effect, lets you open any file on your hard drive, from within any Cocoa program, without having to switch to the Finder. For example, you could keep a list of your favorite files and programs in a TextEdit document, ready for opening without having to leave the program. • Reveal. Takes you to the Finder, where the specified icon is highlighted and its enclosing folder opened into a window. • Show Info. Switches to the Finder, where the Get Info window for the specified file opens, for your inspection pleasure.If what youve highlighted isnt the name and path of a document, youll get only an errormessage.5.10.3.4. Font BookFont Book, as you can read in Chapter 14, is a font-managing program. Among othertalents, it can clump your fonts into Collections (subsets of your choice) or Libraries(collections of Collections).These Service commands generate a whole collection or library of fonts contained in onedocument (whatevers ...

Tài liệu được xem nhiều:

Gợi ý tài liệu liên quan: