Proceed to WirelessDevNet Home Page
Publications, e-books, and more! Community Tutorials Store Downloads, tools, & Freebies! IT Career Center News Home
newnav.gif

Newsletters
EMail Address:



   Content
  - Articles
  - Columns
  - Training
  - Library
  - Glossary
 
   Career Center
  - Career Center Home
  - View Jobs
  - Post A Job
  - Resumes/CVs
  - Resource Center
 
   Marketplace
  - Marketplace Home
  - Software Products
  - Wireless Market Data
  - Technical Books
 
   News
  - Daily News
  - Submit News
  - Events Calendar
  - Unsubscribe
  - Delivery Options
 
   Community
  - Discussion Boards
  - Mailing List
  - Mailing List Archives
 
   About Us
  - About WirelessDevNet
  - Wireless Source Disks
  - Partners
  - About MindSites Group
  - Advertising Information
 
INDEX
>Introduction
>Our First Step, A GUI
>Let's Write Some Code
>Pen Events
>Final Steps

Palm OS Programming With NSBasic (cont.)

Let's Write Some Code

Now that we have our basic GUI out of the way, it's time to get to the writing of the code. First, let's take care of the events associated with clicking on our check boxes. A double-click on any object will open a code window where we can place code associated with the click event for the object. It should be noted that the sub object1011() and the end sub do not need to be typed as they are placed by NSBasic. Your object numbers may be different from those displayed here, but you shouldn't worry about this detail.

Type the following code into the window, and we'll look at it in greater detail.


Listing 1


sub object1011()
 If (chkRectangle.status=1) then
 chkCircle.status = nsbUnchecked
 endif
end sub


The code is executed when the Rectangle checkbox is clicked on. It's only real function is to set the corresponding Circle checkbox to unchecked if it is now checked. Listing 2 displays the opposite code for the Circle checkbox click event.


Listing 2


sub object1012()
 If (chkCircle.status=1) then
 chkRectangle.status = nsbUnchecked
 endif 
end sub


The last screen object we need to deal with is the Clear button, which will be used to clear our display area. Listing 3 contains the complete code necessary to erase the graphics and then redraw them, which results in the clearing of the screen.


Listing 3


sub object1006()
 EraseWindow("")
 Redraw
end sub


Next: Pen Events

Sponsors

Search

Eliminate irrelevant hits with our industry-specific search engine!









Wireless Developer Network - A MindSites Group Trade Community
Copyright© 2000-2010 MindSites Group / Privacy Policy
Send Comments to:
feedback@wirelessdevnet.com