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 Thu 27 Nov 2014, 04:37
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 Posts_count  
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_website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7083
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_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0408s ][ Queries: 12 (0.0036s) ][ GZIP on ]