Re: [NTLK] the hot dog song?

From: Eric Engle (engleerica_at_yahoo.com)
Date: Sat Nov 08 2003 - 01:42:05 PST


Paul Guyot's hotdog script works almost perfectly. However for some reason
close boxes don't click nor does inserting the caret symbol in notes. The
typewriter clicks fine, so does the popup keyboard. I don't have any extensions
messing with sound. Ideas?

Meanwhile, Paul Guyot sent me some really useful coding tips that I thought
worth translating. I think it belongs in a faq or newtonscript primer
somewhere... Could someone please upload this somewhere?

HOW TO BUILD AN AUTOPART EXTENSION

First, create a new project in NTK.
Then, in menu "Project"/"Project settings" we have to change some project
options.
We must change the Output to "Auto Part".
We need to name the extension. So for example, if you want to name the package
"No Hot Dog", place "No Hot Dog:EricEngle"
in the lines "Symbol" of the registry card "Output Settings" and "Package
Settings".
It is good programming style to check the boxes at the bottom of the window
"Project Settings" to indicate that this package is for newton 2.0 and to
compress the package (Checkbox "Use Compression")

Next, we must create a text file useing NTK (Menu "File"/"New
Text File"). This file will contain the newtonscripts run when the package is
activated and deactivated.
The following code functions, but risks incompatibility with other packages
which access the "Hot Dog" song.

// Method called when the package is activated/installed.
InstallScript := func(partFrame, removeFrame)
begin
// Replace the song with simple clicks.
DefGlobalVar('_clickSong, [GetGlobalVar('soundRegistry).clickBeep]);
end;
// Method called when the pacakge is deactivated/removed.
RemoveScript := func(removeFrame)
begin
// Undefine the clickSong variable and thus get back to built-in
// default.
UndefGlobalVar('_clickSong);
end;

Save the file with the above text in it, add it to the project, then compile
the project. Compile the project via:
 Menu "Project"/"Build Project").

Download and run. Voilą!

Thanks to Paul Guyot who provided this code in French. Pauls English is
excellent, but since he can code and I can't and I can translate I thought this
was a way to thank him.

He also answered a question on ROM: ROM images (the default graphics) can't be
changed. Well, they can but you'd need to burn a new rom... and physically
install it, not likely to happen anytime soon...

> Apparently, you need to put sounds in this array or anything that
> PlaySound will accept (like strings if Macintalk is installed).

=====
What I love about spam is realizing how profitable emotional insecurity can be for those who think they're somehow sexually inadequate. I get spam all the time offering to enlarge my breasts and lengthen my penis. And all I can ask is: which first? At least I know once I decide I will have a profitable future as a TV model...

"To create a new standard takes something that's not just a little bit different. It takes something that's really new and captures people's imaginations. Macintosh meets that standard." -Bill Gates

"Those who would trade liberty for security, deserve neither." - Benjamin
Franklin.
What would _you say to a constitutional amendment to give the president dictatorial powers?
http://www.miami.com/mld/miamiherald/news/nation/6007732.htm

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

-- 
This is the NewtonTalk list - http://www.newtontalk.net/ for all inquiries
List FAQ/Etiquette/Terms: http://www.newtontalk.net/faq.html
Official Newton FAQ: http://www.chuma.org/newton/faq/


This archive was generated by hypermail 2.1.5 : Sat Nov 08 2003 - 11:00:00 PST