TAILIEUCHUNG - BeginningMac OS X Tiger Dashboard Widget Development 2006 phần 2

Như bạn đã thấy trước đó, nếu máy tính của bạn đã được tắt hoặc đang ngủ, lần đầu tiên bạn kích hoạt Bảng điều khiển, bạn có thể thấy tất cả các vật dụng của bạn mà không có sở thích của họ, trong khi thông tin được lấy ra. Đây là một kỹ thuật bảo tồn tài nguyên hệ thống trong khi Bảng điều khiển không được kích hoạt. | Tiger Dashboard and Widgets If you aren t using Safari you will probably have to double-click the widget to open the Widget Installer. Reloading Widgets Because widgets are essentially web pages they behave the same way web pages do in browsers. If you make a change to a widget while you are developing it you will have to reload the widget. You reload a widget in the same way you reload a page in Safari you press Command-R. Select a widget and then press Command-R the widget will spin Figure 1-12 to let you know that it has reloaded. Figure 1-12 You have to reload a widget for the same reason that you have to reload a page in Safari. Safari maintains a cache to make pages that you visit regularly load faster. Dashboard also maintains a cache. What Widgets Are Not Now that we know what widgets are a word or two is in order about what widgets are not. Widgets are not applications that run in Dashboard. In other words you should not plan to write a large multifunction application as a widget. A word processor would not make good widget. A good widget should be small focused in purpose. Perhaps the best thing to do is to think of a real-world widget. That simple device typically does one thing very very well and is better than anything else at what it does. The epitome of a widget for me is a paint scraper. You can find several varieties but they all have one thing in common a standard flat blade perfectly mounted to slide along glass under a layer of paint. A Dashboard widget should functionally mimic that real world widget. Rather than create a database application to run as a widget create your database in MySQL or Postgresql and create a widget interface to your database. The database itself runs in its own memory space as a process so you don t have the overhead of a GUI and your widget provides at-your-fingertips access to the data so you can query or create records. At least one web browser widget has been written for Dashboard. Ignoring the recursive ness this

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.