|
6-25-03
REALbasic News
by
Erick Tejkowski
Code Examples by Seth
Seth Willits has posted some new REALbasic examples.
- FSCursorModule is a new REALbasic module for cursor routines.
- New REALbasic example for dynamic AppleScripts on OS X
- FSDictionaryToDisk is an example with a module demonstrating how to write and load a dictionary from disk.
A bunch of neat stuff. Don't miss it.
Synchronous Socket
Aaron Ballman whipped up a quick class that implements a
synchronous TCPSocket.
This is a truly synchronous socket, all calls are blocking. Not sure if this is for you? Give it a try and see for yourself.
Metrowerks + REAL Software + SolidWave = Fast Development
Metrowerks has teamed With REAL Software and SolidWave Software To Speed Creation Of Mac Applications.
Metrowerks has joined forces with REAL Software, Inc. and SolidWave Software, Inc. to create a bundled product that helps Macintosh developers boost productivity and speed time to market.
The offering, called the Productivity Bundle, includes REAL Software's REALbasic 4.5 object-oriented rapid application development (RAD) environment, SolidWave Software's RADicode 1.0 code converter, and Metrowerks' CodeWarrior Development Studio, Mac OS X Edition.
The combined offering makes it easy for developers to create high quality interface code, and then to convert it into a CodeWarrior project built on Metrowerks' PowerPlantª object-oriented C++ application framework. The project is then ready to leverage the CodeWarrior Development Studio, which is the industry-standard development environment for commercial Mac OS¨ applications.
"This bundle essentially gives developers a head start in the creation of Mac applications," said Greg Hemstreet, director of core and desktop technologies, Metrowerks. "Developers can easily prototype their applications, then convert them in a matter of minutes, allowing more time for C++ coding and other important tasks."
BitJuggler Software moves
BitJuggler Software has moved! Update your bookmarks, so you don't miss this handy REALbasic site.
6-20-03
iPod Trickery with REALbasic (Part 3) by
Erick Tejkowski
Have you ever wondered how all those neat iPod utilities work? This week
we'll continue our multi-week tutorial about using REALbasic to have some fun with your iPod.
This week we'll finish up by showing how to view system information about a connected iPod.
If you'd like to follow along with this week's project,
download a copy of last week's finished project and
open it with REALbasic.
You can also go back and read the original tutorial in
case you missed it.
Enhance the Interface
Open Window1 and add a PushButton labeled "Info" to it. Uncheck the Enabled property of the button.
The updated Window1 interface looks like this:
Next, create a new window by selecting File-New Window. This window will function as a drawer, so change its
Frame property to "Drawer Window". (REALbasic 5.1 required). Open the new window (named Window2) and add an
EditField control to it. Resize the EditField and its MultiLine property checkbox in the Properties window. Here's what
my Window2 looks like:
Add the Code
Last week we added code to thread the iPod discovery and showed you how to copy files from the iPod.
This week, we'll look at how to access some important system information. Like previous editions
of this tutorial, this one is very simple. It turns out that each iPod stores its system information
in a hidden text file. All you have to do is open the text file, read in its contents, and display it
in a controll like our EditField. Basic stuff here. One small addition is that we'll want the drawer to open
if its closed, and close if its open.
First, we'll want to enable the "Info" button when an iPod is found. Double click PushButton1 and locate this line of code
PushButton2.enabled=TRUE
Add one line of code immediately after this PushButton2 code to enable PushButton4.
PushButton2.enabled=TRUE
PushButton4.enabled=TRUE
Next, add the following code to the Action event of PushButton4.
As you can tell from this code, the system information is found in the file MyiPod/iPod_control/Device/SysInfo.
One other new item is the ShowWithin method. When you call this for a Drawer window, it behaves as a drawer. The number 2
indicates that it will open on the right edge of its parent window.
Conclusion
That's it! Choose Debug-Run to see your work. Don't forget to mount an iPod before
you test it, otherwise this project won't do much. Your Mac doesn't have FireWire, but the one in the other room does?
You can always share an iPod over the network just like any other hard drive.
Download the code for this week's project here. See you next time!
6-18-03
REALbasic News
by
Erick Tejkowski
RoundSlider
Domain Softworx announces the release of RoundSlider, a Canvas subclass that mimics Cocoa's slider control with a round thumb instead of a pointed one.
RoundSlider supports most of the built-in slider's methods and properties and more. It can reverse direction, and become a "small slider". It is part of Domain Softworx's ongoing effort to make all the controls prescribed by Apple's Aqua Human Interface Guidelines available to REALbasic developers. (Any suggestions for the next one in the series?)
Download it here
dbReports 3.2
db Reports makes it very easy for REALbasic programmers to preview and print professional reports from your project.
Saves you time, and makes you look good. Check it out for free.
Shareware Article
Walter Purvis recommended this article about shareware. It discusses amateurism versus professionalism among shareware authors.
modMenu
modMenu (5.x only) is a small module with a half dozen methods to help you
deal with menus, and a couple for menu diagnostics. No rocket science, just
some handy code.
WWDC
Going to WWDC this year? Don't forget to stop by and say to the REAL Software staff. Word is they will also have a "birds of a feather" meeting as well to discuss all things REALbasic.
6-13-03
iPod Trickery with REALbasic (Part 2) by
Erick Tejkowski
Have you ever wondered how all those neat iPod utilities work? This week
we'll continue our multi-week tutorial about using REALbasic to have some fun with your iPod.
This week we'll show you how to copy files from a connected iPod. We'll also thread the search process,
so the project doesn't lock up the machine.
If you'd like to follow along with this week's project,
download a copy of last week's finished project and
open it with REALbasic.
You can also go back and read the original tutorial in
case you missed it.
Enhance the Interface
Open Window1 and add a PushButton, a ProgressBar, and a StaticText control to the interface.
The new button will be used to trigger a copy operation from the iPod to your Mac. The ProgressBar and StaticText controls
will be used to display information as the project searches for music files on the iPod. While you're staring at the interface,
press and hold Cmd-Shift on your keyboard. Then, drag from the new PushButton to the Listbox control. When you let go of the mouse,
a dialog appears allowing you to select a Control Binding operation. Select the only option and click "OK". This will
cause the PushButton to become enabled when the Listbox has a selection. Otherwise, it remains disabled.
Rearrange the interface
however you like. I've left the default "Label:" text setting for the StaticText control so you can see its location.
My interface looks like this:
Next, double click Window1 to open its Code Editor. Scroll down to the Properties, and
double-click iPods(0) as folderItem property to edit it. Make sure that the Private checkbox
is NOT checked. This will give our Thread object (later in this tutorial) access to the array of iPod FolderItems.
Finally, return to the Project Window and click on the File-New Class menu item. Name the new
class "iPodThread" by editing its Name property and then change its Super property
to "Thread" (ignore quotes for both Name and Super). Double-click the new Thread class to open its Code Editor.
Choose Edit-New Property and create a new property named "caller as Window1".
Again, uncheck the Private checkbox.
Add the Code
Last week we created some code to locate the music files on an iPod.
The code was fairly simple, but it had one drawback. Because an iPod might have
thousands of music files, it takes awhile to find them all. Furthermore, our
code was inelegant. It used a "brute force" method that caused the application
to overtake the CPU. A user can't do anything until the process is over. To remedy this
problem, all you have to do is use a Thread (which you created earlier in this tutorial).
Code that runs in a thread won't lock up the CPU. Instead, the user can continue to use the interface,
switch applications, and everything else they expect to be able to do. You can also provide visual feedback
in a thread a lot easier than you can in non-threaded code. The trade-off is
that your threaded code will run a little slower. For long operations like this one, users will
appreciate feedback. Another advantage of a thread is that you can easily permit the user to cancel.
To create and run the thread, replace the Code in the Action event of PushButton2 with the following code:
In the Action event of PushButton3 enter the following code to copy the selected file on the iPod to the desktop.
Next, open the iPodThread class and add the following code to the Run event. If you're
following along from last week, you'll recognize much of the code. Most of it is code that we used
within the PushButton2 control last time. We've also added some feedback via the ProgressBar and StaticText
control. Finally, we give the user the chance to cancel the operation by holding Escape or Cmd-Period.
Another difference is that this time we are displaying each file name in the first column of the Listbox,
and its path in the second column. Because we give the first column 100% of the Listbox width, you won't see the
paths displayed. We effectively "hid" them. (They're long and messy anyway)
Conclusion
We're done! Choose Debug-Run to see your work. Don't forget to mount an iPod before
you test it, otherwise this project won't do much. Your Mac doesn't have FireWire, but the one in the other room does?
You can always share an iPod over the network just like any other hard drive.
Download the code for this week's project here. See you next time!
|