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 Fri 25 Jul 2014, 14:28
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 [3 Posts]  
Author Message
RSH


Joined: 05 Sep 2011
Posts: 2285
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: 2285
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: 2217

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 from previous:   Sort by:   
Page 1 of 1 [3 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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.0039s) ][ GZIP on ]