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 Wed 26 Nov 2014, 19:14
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Question about XDialog
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Tue 17 Jan 2012, 05:47    Post_subject:  Question about XDialog  

How to get which button is clicked in XDialog?

Code:
   Xdialog --title "$WTITLE"   --wrap --screen-center --center --yesno "$WMWHAT"   8 40 60

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send_private_message 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Tue 17 Jan 2012, 06:17    Post_subject:  

Solved!

Code:
DIALOG=Xdialog

$DIALOG --title "$WTITLE" --wrap --screen-center --center --yesno "$WMWHAT" 8 40
if [ "$?" -eq "1" ]; then

 job to do...

fi

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send_private_message 
amigo

Joined: 02 Apr 2007
Posts: 2278

PostPosted: Tue 17 Jan 2012, 13:15    Post_subject:  

Sometimes a case statement is best:
Code:

case $1 in
 0) ;; # OK/YES was clicked
 1) ;; # NO was clicked
 255) ;; # The window was destroyed by clicking on the 'x'
esac
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
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.0476s ][ Queries: 12 (0.0122s) ][ GZIP on ]