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 26 Nov 2014, 11:14
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 Posts_count  
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

Edited_time_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:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0681s ][ Queries: 12 (0.0270s) ][ GZIP on ]