Question about XDialog

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

Question about XDialog

#1 Post by RSH »

How to get which button is clicked in XDialog?

Code: Select all

	Xdialog --title "$WTITLE"   --wrap --screen-center --center --yesno "$WMWHAT"   8 40 60
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#2 Post by RSH »

Solved!

Code: Select all

DIALOG=Xdialog

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

 job to do...

fi
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#3 Post by amigo »

Sometimes a case statement is best:

Code: Select all

case $1 in
 0) ;; # OK/YES was clicked
 1) ;; # NO was clicked
 255) ;; # The window was destroyed by clicking on the 'x'
esac

Post Reply