O'Reilly logo

Learning Carbon by Apple Computer Inc

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Moon Travel Planner: Handling Files

You’ve now built an application that allows users to plan trips to the moon. Planning how to get somewhere is helpful, but what do tourists do once they get to the moon? To make your application truly useful as a moon travel planner, you should help users plan their itineraries once they’re moon-side. In this section, you will add a new window to your application: the itinerary window, which will display a traveler’s vacation event schedule for the duration of a stay on the moon.

You will also save the contents of the itinerary window in a file, and retrieve the contents of existing itinerary files. If you were creating a fully featured, robust application, you would make the text of the itinerary file editable by the user; however, that would involve creating a text editor. Since we do not show you how to handle text editing in this book, we will use a read-only itinerary file. Using a read-only file, we can still implement the Open and Save As commands. Once your application can handle these commands, you will have implemented most of the file handling code that you would need in order to implement the other standard File menu commands, Save and New. We will note in the chapter the places where you would normally implement these other commands.

Note

To get a quick start on supporting text editing capabilities in your application, read the Multilingual Text Engine documentation in Carbon Help.

To add an itinerary to your Moon Travel application, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required