A custom File & Folder selector.
Highjacking`s perfectly fine, I like a good discussion...
A forum thread with Yad examples would be good, but perhaps belated.
I Googled it and couldn`t make heads or tails of it, seems poorly organized.
I`m thinking that a higher level wrapper around Gtk-Server would be great.
It`d take someone with GTK+ experience to write the new syntax wrapper.
.
A forum thread with Yad examples would be good, but perhaps belated.
I Googled it and couldn`t make heads or tails of it, seems poorly organized.
I`m thinking that a higher level wrapper around Gtk-Server would be great.
It`d take someone with GTK+ experience to write the new syntax wrapper.
.
Ok hijack it is....
the form dialog sample....
yad --form --field=Entry --field=Password:H --field=Mode:CB --field=Color:CLR --field=Amount:NU --field=Invert:CHK --field=Source:FL --field=Folder:DIR --field=Font:FN --item-separator='|' '' '' 'up|down'
Note the data added at the end for any defaults in order of widgets.
Ok produces
mike|cheese|down|#efac1cb61cb6|12.000000|TRUE|/root/hd.img|/mnt/hda3|Sans 12|
I found gtkserver promising but clumsy in the end.
The yad wiki seems ok but I mainly worked from the command line help.
mike
the form dialog sample....
yad --form --field=Entry --field=Password:H --field=Mode:CB --field=Color:CLR --field=Amount:NU --field=Invert:CHK --field=Source:FL --field=Folder:DIR --field=Font:FN --item-separator='|' '' '' 'up|down'
Note the data added at the end for any defaults in order of widgets.
Ok produces
mike|cheese|down|#efac1cb61cb6|12.000000|TRUE|/root/hd.img|/mnt/hda3|Sans 12|
I found gtkserver promising but clumsy in the end.
The yad wiki seems ok but I mainly worked from the command line help.
mike
- Attachments
-
- form.png
- (17.98 KiB) Downloaded 416 times
Thanks mikeb; This looks exactly like a general purpose GUI maker I wrote in BaCon.
Vertical layout of widgets only in the first version, but simpler syntax.
And the combined return line, I`ve used something like it before.
Yep, clumsy is a good description, and so the idea for a wrapper to enhance it.
Vertical layout of widgets only in the first version, but simpler syntax.
And the combined return line, I`ve used something like it before.
Yep, clumsy is a good description, and so the idea for a wrapper to enhance it.
technosaurus started to fiddle with yet-another-dialog here :A forum thread with Yad examples would be good, but perhaps belated.
I Googled it and couldn`t make heads or tails of it, seems poorly organized.
Zenity/Yad and scripts http://murga-linux.com/puppy/viewtopic.php?t=58306 in August 2010 ( Lupu-5.1.1 / Lupu-5.2 )
yad as keyword in the forum search with focus to the programming section in posts gave me 80 hits .
stu90 | stu91, L18L , RSH | R-S-H are some freaks that used yad in their apps .
Perhaps its a case of puppy does things a certain way and that's that.
But I will play and reap the fruits of such labours lol...... along with saves in ram, 252 sfs, correct sfs layer order, multiuser, etc etc. and lob potentially useful stuff around...at least grub4dos got adopted in the end in spite of protests.
mike back on his bike
But I will play and reap the fruits of such labours lol...... along with saves in ram, 252 sfs, correct sfs layer order, multiuser, etc etc. and lob potentially useful stuff around...at least grub4dos got adopted in the end in spite of protests.
mike back on his bike
Sunburnt, as for functionality of your file management program, may I suggest that it somehow incorporate the functionality of the "tree" program? Perhaps a button that says "Expand all folders" or something like that. Every file manager will expand a particular folder to show the next level of subfolders it contains - if you click on the parent folder. But no file manager I'm aware of will open a folder so that all of its subfolders, and all of their subfolders, are shown expanded down to the bottom level of folders. Tree is the only way I've found to do what I want, and I'm surprised that no file manager can do what Tree can do. It seems like a feature that would be included in all file managers.
Flash; I know of no file browser or tree widget that expands all in a branch either.
Could be useful for rapid tree movement, and also for a graphical tree display.
# My selector app. uses list boxes only, BaCon has no tree like GtkDialog has.
mikeb; Any Linux will do what any other will, with all the dependencies installed...
Karl; At least they look normal compared to Xdialog, it`s ugly as hell.
Yad is a Zenity fork and replacement, Zenity is not developed I think.
# My Puppy version has both Yad and Zenity.
Trying both of them, the option: -filename=/mnt/sda1 only gives a dir dialog.!
And it isn`t even in the dir., it just highlights the dir. to enter it. Really odd...
Could be useful for rapid tree movement, and also for a graphical tree display.
# My selector app. uses list boxes only, BaCon has no tree like GtkDialog has.
mikeb; Any Linux will do what any other will, with all the dependencies installed...
Karl; At least they look normal compared to Xdialog, it`s ugly as hell.
Yad is a Zenity fork and replacement, Zenity is not developed I think.
# My Puppy version has both Yad and Zenity.
Trying both of them, the option: -filename=/mnt/sda1 only gives a dir dialog.!
And it isn`t even in the dir., it just highlights the dir. to enter it. Really odd...
Code: Select all
yad --file-selection --filename=/mnt/sda3
try
yad --file-selection --filename=/mnt/sda3/
I assume without the trailing / it assumes a file locating call instead.... A later version probably checks for file/folder status. I have been twiddling with the code and its as straightforward as you can get for c/gtk so modding is easy even for me.
One side effect of upx is that a dependency check no longer works.
mike
yad --file-selection --filename=/mnt/sda3/
I assume without the trailing / it assumes a file locating call instead.... A later version probably checks for file/folder status. I have been twiddling with the code and its as straightforward as you can get for c/gtk so modding is easy even for me.
Not really talking about code compatability but rather politics.mikeb; Any Linux will do what any other will, with all the dependencies installed...
One side effect of upx is that a dependency check no longer works.
mike
You`re correct about the trailing slash of course.
So... How about the start-up size, it`s tiny on my version of Puppy.???
I see nothing in the Help about setting the start-up size of the dialogs.
# Thanks for the upx tip about dependencies.
For most of the utility type apps. I make it`s not a problem.
So... How about the start-up size, it`s tiny on my version of Puppy.???
I see nothing in the Help about setting the start-up size of the dialogs.
# Thanks for the upx tip about dependencies.
For most of the utility type apps. I make it`s not a problem.
Yes defaults seems to be using minimum space possible......fine for most dialogs but perhaps needs a fallback for this one.
size option is the generic X one of --geometry=400x300+20+20
.... actually at least you don't have to have the default huge gtk version
That's width/height/offsetX/offsetY
or use --height=nn --width=nn instead... there's --center too.
note the
--multiple Allow multiple files to be selected
option... a bonus bunny .
mike
size option is the generic X one of --geometry=400x300+20+20
.... actually at least you don't have to have the default huge gtk version
That's width/height/offsetX/offsetY
or use --height=nn --width=nn instead... there's --center too.
note the
--multiple Allow multiple files to be selected
option... a bonus bunny .
mike
Hi Flash, I just saw a comment from SFR regarding tree displays - is this of any interest:Flash wrote:Tree is the only way I've found to do what I want, and I'm surprised that no file manager can do what Tree can do. It seems like a feature that would be included in all file managers.
http://www.murga-linux.com/puppy/viewto ... e29#718936
greengeek and Flash; All of the WinExplorer type filers have a tree for the left panel.
But this may not have been what Flash was talking about.
mikeb; I don`t know why I didn`t think of that, after all my work with GtkDialog.
Fiddling around I figured out the file filtering, but only for the first filter.
### I don`t understand: --file-filter=NAME | *.png *.jpg
.
But this may not have been what Flash was talking about.
mikeb; I don`t know why I didn`t think of that, after all my work with GtkDialog.
Fiddling around I figured out the file filtering, but only for the first filter.
Code: Select all
yad --file-selection --filename=/mnt/sda3/ --geometry=600x400+20+20 --file-filter=*.png|*.jpg
yad --file-selection --filename=/mnt/sda3/ --geometry=600x400+20+20 --file-filter=*.png *.jpg
.
Ok sussed it
NAME gives a group of file types....
But for your example its
yad --file-selection --filename=/mnt/sda3/ --geometry=600x400+20+20 --file-filter="IMAGES | *.png *.jpg"
I got caught out with the --notification in the same way... when the pipe symbol is used as a deliminator then quotes are essential otherwise bash interprets it as such. The above gives a IMAGES tab which shows png and jpg as desired...
you can specify multiple selectable types (like gimp file dialogs) by --file-filter=*.jpg --file-filter=*.png or NAMED like above. For example that could give a 'show all files' option eg
--file-filter="IMAGES | *.png *.jpg" --file-filter="ALL | *.*"
I saw mention of a 'manual' for yad but it eludes me.
mike
NAME gives a group of file types....
But for your example its
yad --file-selection --filename=/mnt/sda3/ --geometry=600x400+20+20 --file-filter="IMAGES | *.png *.jpg"
I got caught out with the --notification in the same way... when the pipe symbol is used as a deliminator then quotes are essential otherwise bash interprets it as such. The above gives a IMAGES tab which shows png and jpg as desired...
you can specify multiple selectable types (like gimp file dialogs) by --file-filter=*.jpg --file-filter=*.png or NAMED like above. For example that could give a 'show all files' option eg
--file-filter="IMAGES | *.png *.jpg" --file-filter="ALL | *.*"
I saw mention of a 'manual' for yad but it eludes me.
mike
I`m not sure what the group thing is all about, but the double quotes worked with or without it.
Both these lines work:
However it`s touchy about variables.
The geometry has to be separated and double-quoted (--geometry="$yadW"x"$yadH"+"$yadX"+"$yadY").
Strangely the file path doesn`t have to be quoted at all.
This works nicely:
Both these lines work:
Code: Select all
# yad --file-selection --filename=/mnt/sda3/ --geometry=600x400+20+20 --file-filter="IMAGES |*.png *.jpg"
# yad --file-selection --filename=/mnt/sda3/ --geometry=600x400+20+20 --file-filter="*.png *.jpg"
The geometry has to be separated and double-quoted (--geometry="$yadW"x"$yadH"+"$yadX"+"$yadY").
Strangely the file path doesn`t have to be quoted at all.
This works nicely:
Code: Select all
##### Show Yad filer dialog at upper right corner of screen.
##### Path must have ending / eg: /path/
pf=/mnt/sda3/docs/pics/girls/
yadW=600
scrW=`xwininfo -root |grep '\-geo' |sed 's#.* ##;s#x.*##'`
yadX=$((scrW-yadW-5))
ext='*.png *.jpg'
yad --file-selection --filename= --geometry="$yadW"x400+"$yadX"+0 --file-filter="$ext"
Hmm geometry was unquoted for me .. oddness.
grouping..... in the example the dialog would show 'IMAGES' rather than the '*.png *.jpg' eg you could have a dozen extensions but only show IMAGES so avoiding a long list and less confusing for a casual user..
Actually the quotes solve having multiple types I just realised.
I find software like crossword puzzles... you get to know the authors style
mike
grouping..... in the example the dialog would show 'IMAGES' rather than the '*.png *.jpg' eg you could have a dozen extensions but only show IMAGES so avoiding a long list and less confusing for a casual user..
Actually the quotes solve having multiple types I just realised.
I find software like crossword puzzles... you get to know the authors style
mike
Well its Linux...anything goes lol. This weeks kernel says this, next week that, simon says .... consistancy and gtk in particular are sworn enemies.
mike
the list of *.jpg *.png *.gif would be replaced by 'IMAGES' in the dialog. In other words its an alias for a group of file extensions.Are the group files types shown in a list somewhere?
Unless there are spaces in names in the usual unix way.Yeah, the geometry and filter patterns need double quoting.
But the /path/file doesn`t.
mike