Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 20 Oct 2014, 01:15
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Providing feedback in scripts - Tip
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [2 Posts]  
Author Message
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Fri 07 Oct 2005, 21:06    Post subject:  Providing feedback in scripts - Tip  

This is not cutting edge, but it's development and it didn't fit anywhere else.

I've seen that Barry's scripts execute the 'please wait..' xmessage before doing something time consuming.

The problem I saw is that the script "killall xmessage" will kill other scripts with xmessage windows open.

I found this while looking for a way to provide feedback in my vncserver-wizard. So I saw how Barry was doing it and took the idea one step further to only close the window I want to close. Here is the generic form:

Code:

# Show the wait message
xmessage -bg "#b3bfab" -center -name "wait" -title "A title" \
   -buttons "" "Doing something. Please wait ..." & echo $! > /tmp/msg1PID

# Do some task that takes some time
dosomething

# Kill the window we started abobe
kill `cat /tmp/msg1PID`


or

Code:

# Show the wait message
xmessage -bg "#b3bfab" -center -name "wait" -title "A title" \
   -buttons "" "Doing something. Please wait ..." &

# Save the window's process ID
MSG_PID=$!

# Do some task that takes some time
dosomething

# By killing the process we in fact close the window
kill $MSG_PID
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Fri 07 Oct 2005, 22:08    Post subject:  

Yes, thanks for that suggestion,
my scripts do need to be fixed.
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [2 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
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 can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0399s ][ Queries: 11 (0.0031s) ][ GZIP on ]