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 Thu 27 Nov 2014, 18:03
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
[SOLVED] pass data in variable
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: 100

PostPosted: Mon 26 Nov 2012, 15:36    Post subject:  [SOLVED] pass data in variable  

how I can pass the variable ENTRY1 of a box to another.

Using the following code:

Code:
#! /bin/bash
export MAIN_DIALOG='
 <vbox>
  <entry>
    <default>"Default value"</default>
    <variable>ENTRY1</variable>
  </entry>
  <hbox>
   <button ok></button>
   <button cancel></button>
  </hbox>
 </vbox>
'

gtkdialog --program=MAIN_DIALOG


export MAIN_DIALOG1='
 <vbox>
  <text>
    <label>text:   "'$ENTRY1'"</label>   
  </text>
  <hbox>
   <button ok></button>
   <button cancel></button>
  </hbox>
 </vbox>
'

gtkdialog --program=MAIN_DIALOG1



digit text in gtkdialog1 to see in gtkdialgo2, using the variable ENTRY1

How in the line
<label>text: "'$ENTRY1'"</label>
falls

Greetings

Last edited by arivas_2005 on Tue 27 Nov 2012, 10:49; edited 1 time in total
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1101

PostPosted: Mon 26 Nov 2012, 15:55    Post subject:  

Evaluating will do the job in that case:

Code:
#! /bin/bash

export MAIN_DIALOG='
 <vbox>
  <entry>
    <default>"Default value"</default>
    <variable>ENTRY1</variable>
  </entry>
  <hbox>
   <button ok></button>
   <button cancel></button>
  </hbox>
 </vbox>
'

I=$IFS; IFS=""
for STATEMENTS in  $(gtkdialog --program=MAIN_DIALOG); do
  eval $STATEMENTS
done
IFS=$I

export MAIN_DIALOG1='
 <vbox>
  <text>
    <label>text:   "'$ENTRY1'"</label>   
  </text>
  <hbox>
   <button ok></button>
   <button cancel></button>
  </hbox>
 </vbox>
'

gtkdialog --program=MAIN_DIALOG1

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
arivas_2005

Joined: 25 Feb 2007
Posts: 100

PostPosted: Tue 27 Nov 2012, 10:49    Post subject:  

excelent. thanks
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.0435s ][ Queries: 11 (0.0028s) ][ GZIP on ]