roma0104 / gtkdialog

Automatically exported from code.google.com/p/gtkdialog
GNU General Public License v2.0
0 stars 0 forks source link

gtkdialog create global variable/destroy global variable #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
From what I have read, gtkdialog does not support making/destroying global 
variables.
In Puppy, as a workaround variables are passed out of a function to an external 
file to be read back in for use in MAIN_DIALOG.
Being able to define a global variable in a function for use by the script 
would be great.

Although, from what I can find on the web, gtk does not support global 
variables.

Comments?

This also seems to be the problem with passing a variable from a function back 
to MAIN_DIALOG.

Original issue reported on code.google.com by johnmeye...@gmail.com on 3 Sep 2011 at 7:56

GoogleCodeExporter commented 9 years ago
This is beyond what I can explain as you these are fundamental characteristcs 
of the shell and not Gtkdialog, so I recommend reading this document:

http://tldp.org/LDP/abs/html/subshells.html

"Variables in a subshell are not visible outside the block of code in the 
subshell. They are not accessible to the parent process, to the shell that 
launched the subshell. These are, in effect, variables local to the child 
process."

When Gtkdialog executes the shell commands in <action> and <input> statements 
it does so in a subshell, therefore to communicate information between the 
subshell and the parent shell -- the shell that originally executed Gtkdialog 
-- requires the use of a file. You call it a "workaround", other people might 
call it the solution.

Original comment by thunor...@hotmail.com on 3 Sep 2011 at 11:23

GoogleCodeExporter commented 9 years ago
You've created another "issue" since I replied here so I take it this is 
finished with and I'll close it.

Original comment by thunor...@hotmail.com on 4 Sep 2011 at 10:56

GoogleCodeExporter commented 9 years ago

Original comment by thunor...@hotmail.com on 6 Sep 2011 at 11:15