GtkDialog - tips
Sorry to say, but evidently when Puppy Licid 520 was made, that file went by the wayside. It just does not exist in Puppy Lucid 520.
It is interesting that it took this long for me to find out.
As a matter of fact, /usr/X11R7/lib does not exist or do any of the contents that would have been in that directory and any subdirectories in it.
It is interesting that it took this long for me to find out.
As a matter of fact, /usr/X11R7/lib does not exist or do any of the contents that would have been in that directory and any subdirectories in it.
Thank you puppyluvr.
The file was just where you said it was.
But that brings me to a question.
Why did the directory structure change in Lucid?
I thought "out-of-the-box" Puppy versions would, or should I say should have the same directory structure as to file placement for the files that come with Puppy.
The file was just where you said it was.
But that brings me to a question.
Why did the directory structure change in Lucid?
I thought "out-of-the-box" Puppy versions would, or should I say should have the same directory structure as to file placement for the files that come with Puppy.
But if they are built from another distro's packages they would need to use its filesystem layout, to be compatible with it.
Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
gtimer
This animated process indicator graphic makes use of the gtkdialog timer feature. Usage:
myfunction() {
gtimer
code .....
kill -9 `ps | grep GTIMER | grep -v grep | awk '{print $1}'`
}
myfunction() {
gtimer
code .....
kill -9 `ps | grep GTIMER | grep -v grep | awk '{print $1}'`
}
- Attachments
-
- gtimer-2.0.pet
- (1.19 KiB) Downloaded 451 times
-
- gtimer.png
- (5.56 KiB) Downloaded 1410 times
Last edited by jpeps on Wed 21 Aug 2013, 06:25, edited 1 time in total.
Make the gui scalable
>> Did you know that it is possible to make gtkdialog windows fully scalable? That means to be able to drag the window corner, and make the gui bigger.
As long as a <tree>, <table>, <list> or <edit> widget is enclosed ONLY by 1 <hbox> OR <vbox>, the widget will remain scalable both horizontally and vertically. Pfind, Pmusic and Pprocess uses various solutions of this.
>> We have of course a trick to scale more complex guis too...
A <hbox> or <vbox> supports the attribute; scrollable, which resets the hbox/vbox definition. You can enclose a widget by 1 <hbox/vbox> inside the scrollable box. The following example explains my words. Remove the scrollable attribute to see how it normally will act.
>> Did you know that it is possible to make gtkdialog windows fully scalable? That means to be able to drag the window corner, and make the gui bigger.
As long as a <tree>, <table>, <list> or <edit> widget is enclosed ONLY by 1 <hbox> OR <vbox>, the widget will remain scalable both horizontally and vertically. Pfind, Pmusic and Pprocess uses various solutions of this.
>> We have of course a trick to scale more complex guis too...
A <hbox> or <vbox> supports the attribute; scrollable, which resets the hbox/vbox definition. You can enclose a widget by 1 <hbox/vbox> inside the scrollable box. The following example explains my words. Remove the scrollable attribute to see how it normally will act.
Code: Select all
#!/bin/sh
export DIALOG='<window default_width="500" default_height="300">
<vbox>
<text><label>How to scale a complex gui</label></text>
<hbox scrollable="true">
<edit></edit>
<edit></edit>
</hbox>
</vbox>
</window>'
gtkdialog -p DIALOG
Hi everyone,
I need some help please. I have tried to solve this for two days and I'm baffled. Using a tip from earlier in this thread this dialog was constructed with comments. Only in bash 4.1, I get this warning
“./Pupsave-backup: line 409: warning: here-document at line 305 delimited by end-of-file (wanted `EOV')
I need some help please. I have tried to solve this for two days and I'm baffled. Using a tip from earlier in this thread this dialog was constructed with comments. Only in bash 4.1, I get this warning
“./Pupsave-backup: line 409: warning: here-document at line 305 delimited by end-of-file (wanted `EOV')

- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
i notice you are using EOV instead of EOF ... is that because an EOF is in one of your variables?
cat normally outputs until EOF (octal \004 ... it can be forced with echo -e "\004")
cat normally outputs until EOF (octal \004 ... it can be forced with echo -e "\004")
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].
2byte: "Sometimes it's hard to see the wood for the trees..."
Simplify the code by removing all the flesh and then add it bit by bit back on to the skeleton.Of course there may be a problem in bash4.1?
Does this ring any bells?
If not maybe this may throw some light on the problem.
HTH
Potong
Simplify the code by removing all the flesh and then add it bit by bit back on to the skeleton.
Code: Select all
# export PUPSAVE_HOT_BKP=$(cat <<EOV | sed -e 's/#.*//' # allow comments in gui
EOV)
# echo "$PUPSAVE_HOT_BKP"
# export PUPSAVE_HOT_BKP=$(cat <<EOV | sed -e 's/#.*//' # allow comments in gui
<window title="Hot Backup for Frugal Pups" icon-name="gtk-convert" default_width="400">
EOV)
# echo "$PUPSAVE_HOT_BKP"
<window title="Hot Backup for Frugal Pups" icon-name="gtk-convert" default_width="400">
# export PUPSAVE_HOT_BKP=$(cat <<EOV | sed -e 's/#.*//' # allow comments in gui
<window title="Hot Backup for Frugal Pups" icon-name="gtk-convert" default_width="400">
<vbox>
EOV)
# echo "$PUPSAVE_HOT_BKP"
<window title="Hot Backup for Frugal Pups" icon-name="gtk-convert" default_width="400">
<vbox>
#...
Does this ring any bells?
If not maybe this may throw some light on the problem.
HTH
Potong
Thanks guys
potong, your links led to the solution.
Sometimes the simplest things ...
potong, your links led to the solution.
The solution?A here-document is supposed to be
terminated by a line containing the delimiter followed by a newline
Code: Select all
</window>
EOV
)

Thunor has enlightened us with a huge speed improvement for complex guis. I have updated first post - Speed issues
______________________________________________________________________
>> For an unknown reason, it is much faster to start your gtkdialog-xml-code from a file than from a variable.
gtkdialog --file=filename
gtkdialog --program=variable
The file alternative is highly recommended if your xml-code is getting complex.
______________________________________________________________________
>> For an unknown reason, it is much faster to start your gtkdialog-xml-code from a file than from a variable.
gtkdialog --file=filename
gtkdialog --program=variable
The file alternative is highly recommended if your xml-code is getting complex.
I hope I have it right, but I have written a gtkdialog script that uses a progress bar in its actions. It was written to restore 2byte's backed up pupsave files, but you can use it to copy a file to another destination.
I ran into a problem after uploading it and found that I had not allowed sufficient time for the copy to start and so a check of the destination file size failed and caused errors in the execution of the script.
Anyway, if you want to try it and see how I got a progress bar to work, just get the file from "Additional Software - utilities". It is under the heading of "Restore Pupsave file....".
I did this as a challenge as I had not seen any actual applications that used a progress bar.
The examples to me do not count because they only increment numbers to make the bar advance with no provision as to how one would use it in an application.
If it bombs for you, open the script in a text editor such as geany and increase the sleep value on line 25.
I ran into a problem after uploading it and found that I had not allowed sufficient time for the copy to start and so a check of the destination file size failed and caused errors in the execution of the script.
Anyway, if you want to try it and see how I got a progress bar to work, just get the file from "Additional Software - utilities". It is under the heading of "Restore Pupsave file....".
I did this as a challenge as I had not seen any actual applications that used a progress bar.
The examples to me do not count because they only increment numbers to make the bar advance with no provision as to how one would use it in an application.
If it bombs for you, open the script in a text editor such as geany and increase the sleep value on line 25.
Anyone have a theory on how this could happen? Something using file i/o being faster than memory?zigbert wrote:Thunor has enlightened us with a huge speed improvement for complex guis. I have updated first post - Speed issues
______________________________________________________________________
>> For an unknown reason, it is much faster to start your gtkdialog-xml-code from a file than from a variable.
gtkdialog --file=filename
gtkdialog --program=variable
The file alternative is highly recommended if your xml-code is getting complex.
Wait... perhaps it's because Gtkdialog reloads the entire program whenever called, whereas - if from a file it's displayed immediately?
Cheers,
s
UPDATE!
The Restore Pupsave utility I uploaded may not handle just copying a file since it was written to remove the date-time from a backed up pupsave file.
It uses sed to remove the last 19 characters in the filename after the source path is removed.
I wanted to pass that along to all that try to use it to copy files.
The Restore Pupsave utility I uploaded may not handle just copying a file since it was written to remove the date-time from a backed up pupsave file.
It uses sed to remove the last 19 characters in the filename after the source path is removed.
I wanted to pass that along to all that try to use it to copy files.
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
I've found the issue and it's fixed in r308.seaside wrote:Anyone have a theory on how this could happen? Something using file i/o being faster than memory?
Wait... perhaps it's because Gtkdialog reloads the entire program whenever called, whereas - if from a file it's displayed immediately?
Cheers,
s
The problem was that strlen() was being called for every char read from memory to check that a char wasn't being read past the end, but this was pointless anyway since an environment variable is null terminated which is being checked for too.
Reading from a file or stdin are both fine though and it'd be a good idea to stick to these methods for complex apps until everyone is using at least r308.
Something else I've found: loading my rather large app from an environment variable is causing bash to display an error message: "./myapp: line 192: /usr/sbin/gtkdialog: Argument list too long", so I have to load from a file or stdin anyway. The limit I am experiencing which bash won't accept above is somewhere around 123KB.
Regards,
Thunor
comboboxtext searching?
Hello,
Today I discovered gtkdialog while building a minimal GUI around a commandline application I use frequently. I've got pretty much everything working except two things.
The first is behaviour I've come to expect of all comboboxes I've come across, and it is to be able to search the entry you are looking for by typing the first few characters. It appears that "comboboxtext" areas in Gtkdialog don't have this functionality built-in, not even the advanced demos do it.
So, is there any way to do it, either by setting some property or clever action-binding?
The second is quite simple, I just can't figure out a way so that the dialogue's "OK" button gets pressed when the user presses Enter while the comboboxtext area is focused. I didn't see any actions that can be bound to the Enter key.
So, again, is there some way to do this?
I imagine I could do without, but it's a bit slow searching the entry you want (amongst a few dozens) without help from the keyboard :/
PS: Thanks for a very interesting and flexible application
Today I discovered gtkdialog while building a minimal GUI around a commandline application I use frequently. I've got pretty much everything working except two things.
The first is behaviour I've come to expect of all comboboxes I've come across, and it is to be able to search the entry you are looking for by typing the first few characters. It appears that "comboboxtext" areas in Gtkdialog don't have this functionality built-in, not even the advanced demos do it.
So, is there any way to do it, either by setting some property or clever action-binding?
The second is quite simple, I just can't figure out a way so that the dialogue's "OK" button gets pressed when the user presses Enter while the comboboxtext area is focused. I didn't see any actions that can be bound to the Enter key.
So, again, is there some way to do this?
I imagine I could do without, but it's a bit slow searching the entry you want (amongst a few dozens) without help from the keyboard :/
PS: Thanks for a very interesting and flexible application
I was looking for some simple on screen 600 pixel ruler but nothing I found was simple so
here is as simple as it gets
there is vertical ruler included also
here is as simple as it gets
there is vertical ruler included also
- Attachments
-
- gtk-movable-ruler.png
- (13.77 KiB) Downloaded 1265 times
-
- ruler.tar.gz
- (8.67 KiB) Downloaded 477 times
IIRC gruler used to be written in C (rather than ruby), and would have met your criteriabig_bass wrote:I was looking for some simple on screen 600 pixel ruler but nothing I found was simple so
Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER