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 Sun 19 Nov 2017, 16:12
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
gtk: script with variable external
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [3 Posts]  
Author Message
arivas_2005

Joined: 25 Feb 2007
Posts: 191

PostPosted: Tue 26 Sep 2017, 13:49    Post subject:  gtk: script with variable external
Subject description: SOLVED!
 

regards
How to pass an external variable (DATA1)inside the gtk script
see the code Embarassed
Code:
#!/bin/sh
DATA1="John Master"
export script='
<vbox>
  <entry>
    <variable>ENTRY_DATA</variable>
    <input>echo "$(DATA1)"</input>
  </entry>
  <button>
    <label>Refresh</label>
    <action>echo "$(DATA1)"</action>
    <action>refresh:ENTRY_DATA</action>
  </button>
</vbox>'

gtkdialog -p script

pass the value from DATA1 (external) to ENTRY_DATA (internal)-- not work!
It's possible?
in advance thanks!

Last edited by arivas_2005 on Fri 06 Oct 2017, 16:32; edited 2 times in total
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1390
Location: Japan

PostPosted: Tue 26 Sep 2017, 22:50    Post subject: Re: gtk script and variable external  

arivas_2005 wrote:
How to pass an external variable (DATA1)inside the gtk script

export DATA1="John Master"

For testing always run your script from console and pay attention to error messages. "$(DATA1)" causes an error. Remove the () parentheses or - if you like it complicated - replace them with curly braces {}
Back to top
View user's profile Send private message 
fabrice_035

Joined: 28 Apr 2014
Posts: 432

PostPosted: Wed 27 Sep 2017, 05:03    Post subject:  

and next tip, if i can Smile

I suppose you want new entry pass in echo cmd ?

-->

Code:
#!/bin/sh

export DATA1="John Master"

export script='
<vbox>
  <entry>
    <variable>ENTRY_DATA</variable>
      <default>"'$DATA1'"</default>
  </entry>
  <button>
    <label>Refresh</label>
    <action>echo "$ENTRY_DATA"</action>
    <action>refresh:ENTRY_DATA</action>
  </button>
</vbox>'

gtkdialog -p script
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.0316s ][ Queries: 12 (0.0057s) ][ GZIP on ]