PROBLEM
- In coding GtkDialog, attributes often extend far more than a comfortable screen width.
Having many attributes off-screen, accessible only by scrolling, is error-prone and the editor's word-wrapping may not improve readability.
Using the bash backslash (\) for line-continuation introduces perceptional "noise" that some find distracting.
Using an editor, such as Geany, set to strip trailing spaces leaves no spaces between attributes and thus generates an error. (Indentation tabs and spaces apparently are ignored.)
- However, experimentation has revealed that there are actually several options for achieving line-continuation in tags.
As is documented and used in several standard examples, no line-continuation characters are needed for the common case of assigning the string of code to an environment variable as in...
Code: Select all
export MAIN_DIALOG='
<entry
file-monitor="true"
fs-action="file"
fs-folder=""
fs-filters-mime="text/plain|text/html"
fs-title="File Select"
space-expand="true"
space-fill="true">'
- However, if the editor is set to strip trailing spaces, echoing the code fails...
Code: Select all
echo '
<entry
file-monitor="true"
fs-action="file"
fs-folder=""
fs-filters-mime="text/plain|text/html"
fs-title="File Select"
space-expand="true"
space-fill="true">' >>gtk_code_file
- ERROR : gtkdialog: Error in line ___, near token 'string': syntax error
• The well-known bash backslash (\) works as expected as long as it is preceded by a space to separate the attributes, as in...
Code: Select all
echo ' \
<entry \
file-monitor="true" \
fs-action="file" \
fs-folder="" \
fs-filters-mime="text/plain|text/html" \
fs-title="File Select" \
space-expand="true" \
space-fill="true">' >>gtk_code_file
Code: Select all
echo '<entry ...
file-monitor="true" ,
fs-action="file" ,
fs-folder="" .
fs-filters-mime="text/plain|text/html" ,
fs-title="File Select" ,
space-expand="true" ,
space-fill="true">' >>gtk_code_file
Code: Select all
echo '<entry _
file-monitor="true"_
fs-action="file"_
fs-folder=""_
fs-filters-mime="text/plain|text/html"_
fs-title="File Select"_
space-expand="true"_
space-fill="true">' >>gtk_code_file
- This file may be the "motherload" of info for those struggling with the GTK+ signal and event system... https://git.gnome.org/browse/gtk+/plain ... system.txt