#!/usr/bin/perl -w # # Copyright 2000 by Michael Coyle # Released under GPL. # # Call it with: # [an error occurred while processing this directive] # # Get the file name from the browser... $file_name = $ENV{'QUERY_STRING'}; # Open the file... open (EP, $file_name); # Print to the browser... print "Content-Type: text/html \n\n"; # Load the file and keep spitting it out to the browser... while () { chomp; print "$_ "; } # Close the file and go home... close EP #!/usr/bin/perl -w # # Copyright 2000 by Michael Coyle # Released under GPL. # # Call it with: # [an error occurred while processing this directive] # # Get the file name from the browser... $file_name = $ENV{'QUERY_STRING'}; # Open the file... open (EP, $file_name); # Print to the browser... print "Content-Type: text/html \n\n"; # Load the file and keep spitting it out to the browser... while () { chomp; print "$_ "; } # Close the file and go home... close EP

3D
3D Photo Gallery (Part 1)
3D Photo Gallery (Part 2)

Audio
Poor Man's MIDI
Make A Metronome
iPod Tricks (Part 1)
iPod Tricks (Part 2)
iPod Tricks (Part 3)
Laugh Track Machine
Audio Player with Reverb
Shepard Melody
RB Phone Home
Build a Drum Machine

Custom Controls and Windows
Double Click Listbox
Draggable Metal Window
Double Click Canvas
Custom Buttons
Custom Buttons Part II
iTunes-style Listboxes
Custom Controls


General RB
Scrolling Windows
Using Mesage Dialogs
Case-Sensitive Word Finder
Introduction to Stacks
Wiggle Window
JPEG in PDF
Listbox Checkboxes
Background Applications
Listbox Auto-Find
Virtual Volumes
Time Tracker
Software Distribution (Part 1)
Software Distribution (Part 2)
Software Distribution (Part 3)
Software Distribution (Part 4)
Exceptions
Tips and Tricks
Text Clippings Made Easy

Graphics
Drawing a Simple Gradient
The SpriteSurface: Space Game
Image Spinner
Cropping Graphics (Part 1)
Cropping Graphics (Part 2)
Cropping Graphics (Part 3)
Cropping Graphics (Part 4)
Shimmer Graphics
Lissajous Figures
Simple Screen Capture
Vector Graphics
Kaleidoscope Images
Stegonography
Spirals!
Image Table
RB Magnifying Lens
Screen Capture
Color Picker Tutorial

Hacks
Ghost Grab
Speedy Mouse Extension
iTunes Plugins
iTunes Skinner

Mac OS X
Global Hot Key Event (Carbon Events)
Login Welcomer (Carbon Events)
Add/Remove Buttons
Resizable Sheets
Mac OS X Preferences Window
Using Sheets in REALbasic
Build a Bundle (Part 1)
Build a Bundle (Part 2)
Dock Your Passwords
Mac OS X Debugging
REALbasic Mac OS X Icon Tutorial
Animate Your Dock
RB and the Command Line

Menus
Window Menu
Templates Menu
Listbox Menu

Novelty
Guessing Game
Calendar Trivia
Tile Mixer
Zip Code Finder
Happy Valentine's Day
Merlin Simulator (Part 1)
Merlin Simulator (Part 2)
Merlin Simulator (Part 3)
Buzzword Machine
AppleSoft BASIC

Printing
Print to PDF

Registration
Registration Code Validation
Network Registration Codes

Resources
Picture Extractor (Part 1)
Picture Extractor (Part 2)

Serial
Caller ID (Part 1)
Caller ID (Part 2)
Caller ID (Part 3)

Speech
Speech Recognition

Socket Communication
Easy Peer-to-Peer File Sharing
MacPAD Version Checking
Display Web Image In Canvas
HTML IMG Tags
Version Tracking
Even Smarter Instant Messaging
Web Tiler
JavaScript and REALbasic
Stock Ticker (Part I)
Stock Ticker (Part 2)
AIM Mate

XML Manipulation
Simple XML Introduction

Video
Big Brother Video Capture

Note: All articles without a byline were written by Erick Tejkowski. When cleaning the site I removed them because the code differed from page to page, and I have yet to put them back in.

resexc2.gif (20k)




REALbasic for Dummies
by Erick Tejkowski

$19.99 @ Amazon





Files are in Stuffit 6.5 or earlier, or ZIP format.
Download Stuffit Expander

Tell us about a bad link.

REALbasic Tips and Tricks
06-14-01




This week we are going to break from tradition. Instead of the usual tutorial, we will take a look at some useful REALbasic tips and tricks.

Tip 1

REALbasic, like any well-respected Mac app, makes interesting use of drag and drop. For example, you can drag a window (named Window1, for this example) from the the Project Window onto a PushButton in the Window Editor. When you release the mouse, the following code automatically appears in the Action Event of the PushButton:

Window2.Show 06-14_dragtip.jpg (22k)

Some other drag and drop functions you can use in REALbasic:

  • Drag pictures, sounds, AppleScripts, and REALbasic components directly into the Project Window.
  • Select some text in the Code Editor and drag it to the desktop. The code becomes a Text Clipping instantly. Drag it back into the Code Editor to reuse it later.
  • Drag code examples from the Language Reference (in REALbasic) directly into the Code Editor. Instant functionality - no typing required!
  • Normally you drag a control from the Toolbar to the Window Editor. Did you know that you can also drag controls to the Code Editor as well? When you do, the controls name appears in the Code Editor.

Tip 2

If you are the musical type, perhaps you have tried out the REALbasic NotePlayer. If so, you know that to play a note you supply a note number (between 0-127) and a volume (also 0-127), like so:

NotePlayer1.PlayNote(60, 127)

This code plays a note (Middle C) at full volume. To stop the note, simply play it again with a volume of zero:

NotePlayer1.PlayNote(60, 0)

If you spend any time at all working with the NotePlayer, you'll want quick access to the note names and their corresponding note numbers. Download a quick hack that you can keep on hand for easy access to all MIDI note numbers.


Tip 3

A good habit to get into: Carefully check for required hardware and software on a user's machine before attemping to use or access it. This typically involves using the Gestalt method of the Application Class (see the REALbasic Language Reference). The Mac OS identifies a variety of system characteristics using a 4-letter code (for example, QuickTime uses "qtim"). GestLab is the best source around for discovering the codes and what they do. Make sure you check it out!


Tip 4

Do you spend a lot of time creating screenshots? Try using this simple MWRB app to cut down on the knuckle-busting screenshot key combinations in Mac OS 9.


Tip 5

Have you ever created a REALbasic interface and managed to cover every single pixel of the background window? It can be a real pain to reselect the window without inadvertantly selecting any other control. To avoid having to move controls around just so you may reselect the window, simply press shift when you click a control. This causes the control to become deselected and its parent window to be selected in the process.


Tip 6

If you use REALbasic to program for Windows, you'll appreciate this tip. Many MDI (multiple document interface) applications on Windows maximize the MDI frame window when launched. The MDI frame window is the parent window in which the applications windows open.

If you would like to maximize the MDI frame window when your application launches, insert the following code in the Open event of your application class: dim result as integer
CONST SW_MAXIMIZE = 3

//This Declare statement goes all on one line!

Declare Function ShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Integer, ByVal nCmdShow As Integer) As Integer Declare Function GetActiveWindow Lib "user32" Alias "GetActiveWindow" As Integer

result = ShowWindow(GetActiveWindow(), SW_MAXIMIZE)






Please support ResExcellence by Visiting our Sponsors. One click makes a difference.


Download REALbasic and create your own software!

#!/usr/bin/perl -w # # Copyright 2000 by Michael Coyle # Released under GPL. # # Call it with: # [an error occurred while processing this directive] # # Get the file name from the browser... $file_name = $ENV{'QUERY_STRING'}; # Open the file... open (EP, $file_name); # Print to the browser... print "Content-Type: text/html \n\n"; # Load the file and keep spitting it out to the browser... while () { chomp; print "$_ "; } # Close the file and go home... close EP #!/usr/bin/perl -w # # Copyright 2000 by Michael Coyle # Released under GPL. # # Call it with: # [an error occurred while processing this directive] # # Get the file name from the browser... $file_name = $ENV{'QUERY_STRING'}; # Open the file... open (EP, $file_name); # Print to the browser... print "Content-Type: text/html \n\n"; # Load the file and keep spitting it out to the browser... while () { chomp; print "$_ "; } # Close the file and go home... close EP