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 28 Jun 2017, 17:03
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Trying for script to execute Xdialog options (Solved).
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [6 Posts]  
Author Message
nic007


Joined: 13 Nov 2011
Posts: 2038
Location: Cradle of Humankind

PostPosted: Fri 09 Jun 2017, 08:27    Post subject:  Trying for script to execute Xdialog options (Solved).  

I want to use xdialog's combobox. Basically it creates a menu list where one can highlight an item and then select OK to run a specific command (there is also a Cancel button). I can create the combobox but need help with the script to run the commands. Let's say the three items in the menu are JOHN PETE KURT. If I select JOHN from menu and click OK, I want to run the command EAT. If selection is PETE then command KICK. If selection KURT then command CATCH. Thanks.
Last edited by nic007 on Fri 09 Jun 2017, 17:21; edited 1 time in total
Back to top
View user's profile Send private message 
DPUP5520

Joined: 16 Feb 2011
Posts: 807

PostPosted: Fri 09 Jun 2017, 09:44    Post subject:  

hey nic007 take a look at this topic here maybe it can help you solve the issues you're having http://murga-linux.com/puppy/viewtopic.php?t=109790
_________________
PupRescue 2.5
Puppy Crypt 528
Back to top
View user's profile Send private message 
Moose On The Loose


Joined: 24 Feb 2011
Posts: 727

PostPosted: Fri 09 Jun 2017, 10:24    Post subject: Re: Need help with script to execute Xdialog (Combobox) options.  

nic007 wrote:
I want to use xdialog's combobox. Basically it creates a menu list where one can highlight an item and then select OK to run a specific command (there is also a Cancel button). I can create the combobox but need help with the script to run the commands. Let's say the three items in the menu are JOHN PETE KURT. If I select JOHN from menu and click OK, I want to run the command EAT. If selection is PETE then command KICK. If selection KURT then command CATCH. Thanks.


Are you having trouble with the detecting which was clicked or the running the commands?
Back to top
View user's profile Send private message 
nic007


Joined: 13 Nov 2011
Posts: 2038
Location: Cradle of Humankind

PostPosted: Fri 09 Jun 2017, 10:53    Post subject: Re: Need help with script to execute Xdialog (Combobox) options.  

Moose On The Loose wrote:
nic007 wrote:
I want to use xdialog's combobox. Basically it creates a menu list where one can highlight an item and then select OK to run a specific command (there is also a Cancel button). I can create the combobox but need help with the script to run the commands. Let's say the three items in the menu are JOHN PETE KURT. If I select JOHN from menu and click OK, I want to run the command EAT. If selection is PETE then command KICK. If selection KURT then command CATCH. Thanks.


Are you having trouble with the detecting which was clicked or the running the commands?

I'm not sure, perhaps both.
Back to top
View user's profile Send private message 
smokey01


Joined: 30 Dec 2006
Posts: 2558
Location: South Australia

PostPosted: Fri 09 Jun 2017, 11:08    Post subject:  

Is this what you want?
Code:
#!/bin/sh
answer=`Xdialog --stdout --title "Title" --combobox "text" 0 0 "JOHN" "PETE" "KURT"`
case "$answer" in
        JOHN)
        echo EAT
        ;;
        PETE)
        echo KICK
        ;;
        KURT)
        echo CATCH
        ;;
 esac


If EAT, KICK and CATCH are real commands change echo to exec.

_________________
Software <-> Distros <-> Tips <-> Newsletters
Back to top
View user's profile Send private message Visit poster's website 
nic007


Joined: 13 Nov 2011
Posts: 2038
Location: Cradle of Humankind

PostPosted: Fri 09 Jun 2017, 17:19    Post subject:  

Thank you, smokey01
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [6 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.0497s ][ Queries: 14 (0.0082s) ][ GZIP on ]