FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

push list, but not quite...

 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Mac
View previous topic :: View next topic  
Author Message
glasspusher
Newbie


Joined: 11 Apr 2005
Posts: 6
Location: Oakland, California

PostPosted: Tue Jan 23, 2007 8:20 pm    Post subject: push list, but not quite... Reply with quote

Hi,
I've gotten a new phone. After unlocking it (take that, Cingular!)and installing Clicker, I've gotten the bug to add more Applescript functionality to my telescope controller. One thing I was looking to do is better display of information on the phone with Clicker. After rummaging around the fora here and looking at iTunes scripts, I have gotten a pretty good handle on the

tell current terminal
push (make new list screen with properties{yadda yadda...

script command and such. Is there any way to just display a list without requiring a selection from the user, or what looks like piling up stuff on the phone when I update the list and then push it on again (or push a dialog). I can't seem to "pop" a list after a push. Would constant "pushing" of stuff to SEC helper end up crashing clicker on the phone?

What is best practice for updating the phone's display with useful info while making user interaction to said display strictly optional?

Thanks!

Dave
Back to top
View user's profile Send private message AIM Address
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Tue Jan 23, 2007 8:32 pm    Post subject: Reply with quote

Hi Dave,

It is not advisable to use the list widget for this (for the exact reasons you're mentioning). You'd end up stacking a potentially very large number of widgets (btw: the phone client wouldn't crash, but I think "getting out" of all the stacked lists would be a problem; and it's just not "sound" usage of the list).

At this time, your only option is to build a list widgets of sorts using the keypad widget (it, and its derivative widgets) is the only widget that can be updated without user interaction.

Another alternative, which may or may not be suitable for you would be to have a "refresh" item in your list. This would require some user interaction.

A third alternative would be to have a keypad widget show when there's a new list to be had (and perhaps other vital stats); pressing a button would bring up the list.

Either way, a spontaneously updating list is not possible to achieve at this point. :-( If there are other (substantive) reasons why we need have one, it may be added in a future version.

Best.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
glasspusher
Newbie


Joined: 11 Apr 2005
Posts: 6
Location: Oakland, California

PostPosted: Tue Jan 23, 2007 9:48 pm    Post subject: Reply with quote

Hi Jonas,
thanks for the reply. I'm not looking ot update a list, just have something that has a few lines of text that can be updated on the screen and accept input, but the input would be strictly optional. It might not have to accept input as long as it doesn't impede other processes of the phone client from getting input?

I was just playing with
tell current terminal
set my_keypad to make new keypad screen
tell my_keypad
make new text row with properties {textual...
end tell
push my_keypad
end tell

...but again, I'm pushing stuff to do this. Is this a good way to do stuff or not?

thanks.

Dave
Back to top
View user's profile Send private message AIM Address
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Tue Jan 23, 2007 10:56 pm    Post subject: Reply with quote

Dave,

You'll want to push the keypad widget once only. Then, in the "update" callback, you can modify the contents of the rows to your liking. If the boilerplate script doesn't give you enough "meat", have a peek at the iTunes script.

Best.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
glasspusher
Newbie


Joined: 11 Apr 2005
Posts: 6
Location: Oakland, California

PostPosted: Wed Jan 24, 2007 12:19 am    Post subject: Reply with quote

Ah, I think I've got it. Thanks, Jonas.

Dave
Back to top
View user's profile Send private message AIM Address
Sei
Newbie


Joined: 07 Mar 2007
Posts: 1

PostPosted: Wed Mar 07, 2007 1:35 am    Post subject: Reply with quote

I need help with something very similar to this, I want to turn my phone into an external display for system stats etc a la LCDProc.

I've made a new widget based on the keypad but I'm lost on the update kepad code, how exactly would I go about replacing the default 'one, two, three' lines with my new info? I tried:

[code:1]
on update keypad the_keypad
set CPUstat to do shell script "/usr/bin/nice -n 20 /bin/ps -axrCSOpcpu | /usr/bin/awk '{s+=$2;}END{print s}'"
tell my_keypad
make new text row with properties {textual content:"CPU Usage", horizontal alignment:left, font size:small}
make new text row with properties {textual content:"CPUstat", horizontal alignment:center, font size:medium}
end tell


end update keypad[/code:1]

Can anyone put me out of my misery by pointing out the likely obvious error?

Sei
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Mac All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group