Re: [NTLK] Help with programming

From: Michael Burks (dumbstart_at_satx.rr.com)
Date: Sat Jul 26 2003 - 12:52:51 PDT


This almost answers my question, the last thing I need to know is . . . do I
use SetValue to change the icon, and if so, how do I add the new icon to the
project?

>In the first case, the question is just: how do I programmatically
>change the picture of an object based on protoPictureButton.

>And the answer is: changing the icon slot and then call RedoChildren
>does the trick.

>Now, for changing when the button is being pressed (i.e. while you
>hold the pen, instead of system's default hilite) is a little bit
>more tricky. I would suggest to not go protoPictureButton but instead
>use a clPictureView you have access to.

>The rational is that (I think) protoPictureButton is itself a complex
>structure. That's why RedoChildren does the trick: it's made of the
>frame and the picture.

>So, you'll change the picture of this clPictureView in the
>viewClickScript method. Then you'll ask the picture to redraw itself
>by dirting it. NewtonOS normally only redraw stuff at the end of the
>event loop. There is a trick to force it to do it. Check the Q&As:
>http://www.unna.org/unna/apple/documentation/developer/QAs->2.x/html/lockre
fr.htm

>>2. I understand how to hilite a button viewName:hilite(), but when I
>>try to change the hilite from one button to another (by calling hilite()
>>twice, once to turn off the originally hilited button, and twice to hilite
>>the newly pressed button), it won't hilite the newly pressed button.

>Why do you call it twice?

I want to have a button hilite when it is clicked, only until another button
is clicked. Then I want the un-hilite the old button, and hilite the newly
clicked button. I had to call it two times, once for each button. I am
unable to figure out how a button can be clicked and remain hilited. I can
hilite other objects but not itself.

>>I keep programming (in my free time) simple games for the Newton, things I
>>know that my friends and I would enjoy, and now I'm stuck.

>It's ok, you knocked at the right door. There is a mailing list for
>developers at yahoo but it's quiet or maybe even dead. There is also
>a newsgroup for developers called comp.sys.newton.programmer. Several
>developers scan it for helping people and there is little traffic.
>Just in case you'd feel bad about posting such questions on
>NewtonTalk.

>Nobody codes on the Newton for a living.

Not only do I not code I just sell books at Borders, that and be in love
with my High school sweetheart, the Apple Newton. Couldn't have one then,
but I certainly have one now. What I was going to do is start up a new
Yahoo club, write up a few tutorials for Newton programming, pictures
step-by-step guides. I'm not the most qualified person, but I feel that I
have enough love for my Original green tablet that I could at least try.

>Why can't we test all these? ;)

And if anyone would like to test these I did start the yahoo group, mostly
so I can access my programming from my house and my girlfriends place. You
can visit it at http://groups.yahoo.com/group/originalgreentablet/ you can
download the few works in progress from there, and check out the database
for projects that I have on the horizon. I owe most of the tech docs that I
have posted to Roger Milne, a gracious and kind Newton user.

Thanks for your help so far, it's been very prompt and useful. So, how do I
reference those icons?

Michael

-- 
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 : Sun Jul 27 2003 - 09:00:01 PDT