Revision [32881]

This is an old revision of gtkdialogDocTips1 made by zigbert on 2020-07-28 05:04:52.

 

HomePage > SoftwareIndex Software Index > SoftwareDevelopment Development > gtkdialog gtkdialog > gtkdialogDocTips Tips and Tricks

1. Syntax

The very basics of building a simple gui is told by the links in gtkdialog gtkdialog documentation. You should have played a bit with some examples before you continue.

About QUOTES ( " and ' )
To show content of a variable in the gtkdialog code, we need to quote the variable correctly inside the gtkdialog code.

TEXT='Hello world'

export script='
<text>
 <label>Content of variable is: '"$TEXT"'</label>
</text>'

gtkdialog --program=script


Now in other words - Because this is important!!!

First realize that you put all the gtkdialog code into a variable - ie MAIN_WINDOW or Psync:
export Psync="<window title=\"Psync\"...........</window>"
if you now try to echo Psync you'll get
<window title="Psync"...........</window>
which is correct code. But if you used ' instead of ", like this:
export Psync='<window title=\"Psync\"...........</window>'
you'll get
<window title=\"Psync\"...........</window>
This will give a syntax error, while
export Psync='<window title="Psync"...........</window>'
will give correct syntax.


Now using a variable inside the gtkdialog code like this:
TITLE=Psync
export Psync="<window title=\"$TITLE\"...........</window>"
returns
<window title="Psync"...........</window>
while
export Psync='<window title="$TITLE"...........</window>'
returns
<window title="$TITLE"...........</window>
and not the content of variable TITLE


Now return to the first example about quotes. This example combines the use of ' and ".



Categories
CategoryGtkdialog
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki