Gtkdialog examples from DEVX
Gtkdialog examples from DEVX
The example /usr/doc/gtkdialog/examples/07.02-list_actions script maxes out my processor when I run it and I have to kill it.
I tried making another button and putting the echo line there.
The program would then be ok until I clicked that button and again max out the processor.
So, any ideas as to why?
I tried making another button and putting the echo line there.
The program would then be ok until I clicked that button and again max out the processor.
So, any ideas as to why?
Thank you for the reply.
I also tried modifying the script by putting the echo line in an action call using the ok button to call it.
Then I tried adding xmessage without the echo.
There was no change as to processor maxing out and xmessage failed to display any output.
So I will keep playing round with it.
For now, I know not to use that form of list in any programs.
I also tried modifying the script by putting the echo line in an action call using the ok button to call it.
Then I tried adding xmessage without the echo.
There was no change as to processor maxing out and xmessage failed to display any output.
So I will keep playing round with it.
For now, I know not to use that form of list in any programs.
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
could you paste the example - I am not at a Puppy box to check it, but I can examine the script - it probably just needs a sleep 1 inserted somewhere in a loop. This one may have already been discussed in the gtkdialog tips thread.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
You ask for the original example file and here it is 07.02-list_actions
I already tried moving the action line to be acted on by the OK button.
Code: Select all
#! /bin/bash
export MAIN_DIALOG='
<vbox>
<list>
<variable>LIST</variable>
<item>First item</item>
<item>Second item</item>
<item>Third item</item>
<action>echo Chosen item is $LIST</action>
</list>
<hbox>
<button ok></button>
<button cancel></button>
</hbox>
</vbox>
'
gtkdialog3 --program=MAIN_DIALOG
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
hmm - I would use a "combobox" for that instead of a list - I have a template for combobox in the how to section
http://www.murga-linux.com/puppy/viewtopic.php?t=45474
then you will either need to eval MAIN_DIALOG after exit for the value of $COMBO1 or set up and action within the dialog window such as
Xdialog --infobox $COMBO1 0 0
http://www.murga-linux.com/puppy/viewtopic.php?t=45474
Code: Select all
<combobox>
<variable>COMBO1</variable>
<item>item 1</item>
<item>item 2</item>
</combobox>
Xdialog --infobox $COMBO1 0 0
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
I realize their are work arounds for the example program.
But.....
Why are there example programs in the /usr/share/doc/gtkdialog3/examples directory that just do not work.
Isn't an example supposed to work?
Also, can one find out where the example program is at fault and correct it?
Is it a matter of a debug option?
Everything seems fine till the <action>echo Chosen item is $LIST</action>
line is executed.
As to what is happening, that is to find out.
And the echo never takes place even when run from a terminal.
But.....
Why are there example programs in the /usr/share/doc/gtkdialog3/examples directory that just do not work.
Isn't an example supposed to work?
Also, can one find out where the example program is at fault and correct it?
Is it a matter of a debug option?
Everything seems fine till the <action>echo Chosen item is $LIST</action>
line is executed.
As to what is happening, that is to find out.
And the echo never takes place even when run from a terminal.
yes that also drived me crazy for many times maybe memoving would be better...8-bit wrote:I realize their are work arounds for the example program.
But.....
Why are there example programs in the /usr/share/doc/gtkdialog3/examples directory that just do not work.
Isn't an example supposed to work?
not really, but with the following, it does work and echos the choosen value...Also, can one find out where the example program is at fault and correct it?
Code: Select all
#! /bin/bash
export MAIN_DIALOG='
<vbox>
<list>
<variable>LIST</variable>
<item>First item</item>
<item>Second item</item>
<item>Third item</item>
</list>
<hbox>
<button ok></button>
<button cancel></button>
</hbox>
</vbox>
'
I=$IFS; IFS=""
for STATEMENTS in $(gtkdialog3 --program MAIN_DIALOG); do
eval $STATEMENTS
done
IFS=$I
if [ "$EXIT" = "OK" ]; then
echo "Chosen item is $LIST."
else
echo "You pressed the Cancel button."
fi
PUPPY SEARCH: http://wellminded.com/puppy/pupsearch.html
aragon,
It appears to work because it exits to show $LIST.
But I have an option for you.
When creating a GUI, why have it use the echo command?
That entails running it from a terminal to see the output of the echo command.
Instead, just replace "echo" with "xmessage".
Then the output will be displayed in a GUI type message box.
It appears to work because it exits to show $LIST.
But I have an option for you.
When creating a GUI, why have it use the echo command?
That entails running it from a terminal to see the output of the echo command.
Instead, just replace "echo" with "xmessage".
Then the output will be displayed in a GUI type message box.
sure, but i wanted to leave it as it has been in the example...8-bit wrote:aragon,
It appears to work because it exits to show $LIST.
But I have an option for you.
When creating a GUI, why have it use the echo command?
That entails running it from a terminal to see the output of the echo command.
Instead, just replace "echo" with "xmessage".
Then the output will be displayed in a GUI type message box.
but usually this is to give parameter to an external comand.
aragon
PUPPY SEARCH: http://wellminded.com/puppy/pupsearch.html