Creating Mac Widgets with Dashcode.pdf

(7648 KB) Pobierz
373165547 UNPDF
Available as a
PDF Electronic Book
or Print On Demand
Creating
Mac Widgets
89
PAgeS
William H. Murray and Chris H. Pappas
with Dashcode
373165547.023.png 373165547.024.png 373165547.025.png 373165547.026.png 373165547.001.png 373165547.002.png 373165547.003.png 373165547.004.png 373165547.005.png 373165547.006.png 373165547.007.png 373165547.008.png 373165547.009.png 373165547.010.png 373165547.011.png 373165547.012.png 373165547.013.png 373165547.014.png 373165547.015.png
About firstPress
Apress's firstPress series is your source for understanding cutting-edge technology. Short,
highly focused, and written by experts, Apress's firstPress books save you time and effort. They
contain the information you could get based on intensive research yourself or if you were to
attend a conference every other week—if only you had the time. They cover the concepts and
techniques that will keep you ahead of the technology curve. Apress's firstPress books are real
books, in your choice of electronic or print-on-demand format, with no rough edges even when
the technology itself is still rough. You can't afford to be without them.
Creating Mac Widgets with Dashcode
Dear Reader,
We have taught a lot of programming courses and written a lot of programming books in our
careers, but this time we felt that Mac users would benefit the most by knowing how to develop
Dashboard widgets with Dashcode rather than laboring over programming languages and
endless pages of code.
Our first goal in this short book is to introduce you to the major significant components of the
Dashcode product and quickly teach you how to develop some interesting and exciting
Dashboard widgets. The first half of the book concentrates on Dashcode templates and shows
you how to use the stock templates, with just a little modification, to create your own unique
widgets.
The latter half of the book uses slightly more aggressive alterations to the templates and
introduces you to some straightforward JavaScript code. With just a little effort, you'll be
creating some really exciting widgets.
The second goal is to get you right into using the Dashcode product, help you have fun
developing widgets, and show you how easy it is to create those essential utilities that you have
wanted to create for so long. Have fun!
Chris H. Pappas and William H. Murray,
Professors of Computer Science,
State University of New York Affiliation,
Binghamton, New York
Contents
Chapter 1: Widgets in a Hurry..................................................... 1
A Little Widget History.......................................................................... 2
Ease ............................................................................................................ 2
Focus .......................................................................................................... 3
Functionality............................................................................................... 4
Cost ............................................................................................................ 5
Implementation ........................................................................................... 7
Distribution............................................................................................... 12
The Look and Feel of a Good Apple Widget ........................................ 18
Front Face Design Ideas............................................................................ 18
Back Face Design Ideas ............................................................................ 19
Miscellaneous Design Ideas ...................................................................... 20
What Widgets Can and Cannot Do ...................................................... 20
The Problems with Widgets.................................................................. 20
Clutter....................................................................................................... 20
Widget Removal ....................................................................................... 21
More Excitement Coming .................................................................... 21
373165547.016.png 373165547.017.png 373165547.018.png
Chapter 2: Widgets Without Worry: Using Dashcode ................... 23
What Is Dashcode? .............................................................................. 23
Where Is Dashcode and How Is It Installed? ...................................... 23
A Quick Look at Dashcode Features ................................................... 28
Front Face Changes .................................................................................. 36
Back Face Changes ................................................................................... 41
Important Dashcode Features and Tools............................................. 44
View ......................................................................................................... 44
Library...................................................................................................... 46
Inspector ................................................................................................... 47
One Template Down, Nine To Go ........................................................ 52
Chapter 3: Widget Templates: Thinking Out of the Box ............... 53
The Countdown Timer Template ......................................................... 54
The Maps Template.............................................................................. 59
The RSS and the Daily Feed Templates............................................... 66
The Podcast Template .......................................................................... 71
The Photocast Template ....................................................................... 75
The Photocast Template and .Mac Web Gallery........................................ 78
The Quartz Composer Template .......................................................... 79
The Video Podcast Template ................................................................ 83
The Gauge Template ............................................................................ 86
Out of the Box—Not! ........................................................................... 89
Creating Mac Widgets with Dashcode
373165547.019.png 373165547.020.png 373165547.021.png
Creating Mac Widgets with Dashcode
by William H. Murray and Chris H. Pappas
Welcome to the world of easy widget programming. Dashcode is Apple’s
revolutionary product for automatically generating widget code. With Dashcode,
you can work with a variety of widget templates and experiment with subtle
changes in widget forms and properties. When you are ready to move on to more
challenging projects, those same templates can serve as the base for exciting and
unique widgets that you can add JavaScript code to in order to make even more
functional.
The key ingredient in Dashcode is ease of use. You’ll be developing widgets in no
time at all. We’ll teach you how to start with small projects, and as you expand
your knowledge, show you how to add interesting features to each widget.
Widget programming fills the gap in your application needs. Once, you would
either have had to purchase every application you needed or become a
programmer and designed your own applications using massive compilers like
those provided with Xcode. With Dashcode, much of what you need for your
applications is generated automatically. Then, with a little JavaScript, you can
create even more robust applications.
This book will provide many of the development fundamentals you will need to be
an active widget designer and creator. But, this book is only the beginning of
what you can do with Dashcode! It’s all in the word: Dashcode. Dash for fast
and code for what is being written. Dashcode, fast code.
Creating Mac Widgets with Dashcode
iii
 
373165547.022.png
Zgłoś jeśli naruszono regulamin