Posted: Thu 31 May 2018, 11:13
They are part of gtk, and you can't add more just by putting images somewhere.
READ-ONLY Archive
https://oldforum.puppylinux.com/
Yes.disciple wrote:They are part of gtk, and you can't add more just by putting images somewhere.
Code: Select all
#!/bin/sh
gtk-update-icon-cache -f -i /usr/share/icons/hicolor
Code: Select all
<window title="weX" icon-name="wex48" resizable="false">
Code: Select all
<button>
<input file icon="wex48"></input>
<variable>WHATEVER</variable>
<action>command_string</action>
</button>
Code: Select all
<button tooltip-text="$(gettext 'RECORD/CONTINUE RECORD')">
<input file>/usr/local/share/pixmaps/wex/wex_record.png</input>
Code: Select all
<action>sh -c "command &"</action>
Code: Select all
<action>command</action>
Not yet, Fred, been too busy and since considering minor code tweeks and not actually using github during my developments I'm not quite ready to push the source code there yet. But will happen soon enough. There is one particular area of code in gtkdialog I want to double-check how it works, just in case I've missed something, and also I want to convert a couple of my apps just as a double check. I've been converting precord, which has quite a lot of bash-related export code so a good test - haven't quite finished it yet. After that I'll push up the source code since it will be ready for proper testing and recompiling and pull requests and so on.fredx181 wrote: One thing I wonder about, looking at your DebianDog/gtkwialog repository:
I see 7 commits from you containing change of Readme and some more, but are the differences for gtkwialog compared to original gtkdialog there ?
pu
Fred
I will have to therefore make a slight modification to Precord to workaround that remaining dash-related issue.you cannot call bash functions from <input> tags, only from <action> tags if underlying system shell is dash. There may be similar limitation; just remember -a and -b modes are specifically mainly related to <action>tag commandline_string opertion
Code: Select all
#! /bin/bash
hello (){
echo "hello world"
}
export -f hello
export MAIN_DIALOG='
<vbox>
<entry>
<variable>ANYTHING</variable>
<input>hello</input>
</entry>
</vbox>
'
gtkwialog -b --program=MAIN_DIALOG
Yep, I'll add that to tomorrows list. If there is an <input> issue it can always be worked around as I managed with Precord.fredx181 wrote:Hi wiak, I had a look at pburn and it seems the only exported function is in /usr/local/pburn/box_tail and it has "tailing" exported to a <input>.... line
If you have time, can you have a look ?
Fred
Code: Select all
#! /bin/bash
printf '
#!/bin/bash
echo "hello world"
' >/tmp/hello
chmod +x /tmp/hello
export MAIN_DIALOG="
<vbox>
<entry>
<variable>ANYTHING</variable>
<input>/tmp/hello</input>
</entry>
</vbox>
"
gtkwialog -b --program=MAIN_DIALOG
Code: Select all
cat >/tmp/hello <<'here_hello_function'
#! /bin/bash
echo "hello world"
here_hello_function
chmod +x /tmp/hello
Code: Select all
<action>. '$PROGPATH'/func -search</action>
Code: Select all
<action>bash -c ". '$PROGPATH'/func -search"</action>
Yes, that could be the issue you've come across. Of course if '<action>commandstrings' contain bashisms they are going to need bash -c (with gtkwialog -b mode) to interpret them), so not just for export -f cases, that's true.fredx181 wrote: I suspect at least some <action> or <input> lines are containing other bashism's than exported functions, but not sure.
Hence '<action>commandstring' entries that need filename expansion or such need to include an appropriate (sh -c or bash -c) shell command at the front.Parses a command line into an argument vector, in much the same way the shell would, but without many of the expansions the shell would perform (variable expansion, globs, operators, filename expansion, etc. are not supported).