YAD - Tips

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
rg66
Posts: 1158
Joined: Mon 23 Jul 2012, 05:53
Location: Vancouver, BC Canada / Entebbe, Uganda Africa!?!

Re: right click hidden files option

#61 Post by rg66 »

seaside wrote:Try this.

Create below file and put at " /root/.config/gtk-2.0/gtkfilechooser.ini"

Code: Select all

# /root/.config/gtk-2.0/gtkfilechooser.ini
[Filechooser Settings]
ShowHidden=true
All gtkfilechooser calls should now show hidden files.

Cheers,
s
Works like a charm, thanks seaside
X-slacko-5b1 - X-tahr-2.0 - X-precise-2.4
[url=http://smokey01.com/rg66/]X-series repo[/url]

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#62 Post by slavvo67 »

Good idea if you don't mind having YAD show all your hidden files / folders. I guess if you just want to see them for one particular YAD program and not the others, the right click option is still the way to go.

Thank you all for the suggestions, though. I have a feeling there will eventually be a fix in YAD for this.

User avatar
rg66
Posts: 1158
Joined: Mon 23 Jul 2012, 05:53
Location: Vancouver, BC Canada / Entebbe, Uganda Africa!?!

#63 Post by rg66 »

Just discovered that you can use markup for buttons.

Code: Select all

yad --button="<b><span color='red'>Test</span></b>" --button="<b><span color='blue'>Test</span></b>"
Attachments
yad.jpg
(5.84 KiB) Downloaded 2906 times
X-slacko-5b1 - X-tahr-2.0 - X-precise-2.4
[url=http://smokey01.com/rg66/]X-series repo[/url]

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#64 Post by slavvo67 »

Thanks RG66. Another worthy addition to the test scripts.

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#65 Post by slavvo67 »

For those that might not be aware, YAD supports columns since about version 25. Importantly, if you write a script with the --columns= and run it unknowingly on a puppy with an older version of YAD; it will make a mess.

Quick example below:

yad --title='Website Choice' --text='Paste Site or Sites Here' --form --columns=2 --field='Website Name 1' --form --field='Website Name 2' --form --field='Website Name 3' --form --field='Website Name 4' --form --field='Website Name 5' --form --field='Website Name 6' --form --field='Website Name 7' --form --field='Website Name 8' --form --field='Left Blank' --form --field='Name or Comment' --form --field='Name or Comment' --form --field='Name or Comment' --form --field='Name or Comment' --form --field='Name or Comment'

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

yad-0.31.0

#66 Post by Bert »

Hi all,

I've compiled the latest yad (0.31.0).

I shouldn't be compiling as I am not a developer. But frustration sometimes is the mother of invention :wink:

On my hardware, Puppy Precise (5.7.1 or 5.7.2) proved to be by far the most reliable puppy. But it comes with a very old yad version (0.12.4, or something like that).

More frustration: the slacko yad-0.27.pet, kindly offered by rg66 on page 4 of this thread, does not work in Puppy Precise.

So I compiled yad 0.31.0 in Puppy Precise, to enable Precise users to enjoy the most recent YAD. It might work in other puppy's, but I haven't tested that.

So...no guarantees, except that it works well in Puppy 5.7.1 and derivates.

[EDIT[The download is no longerhere. (superseded by better and more recent version by stemsee[/edit]
Last edited by Bert on Sun 11 Oct 2015, 20:03, edited 1 time in total.
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

stemsee

#67 Post by stemsee »

It is working great on dpup wheezy! Cheers!

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#68 Post by Bert »

Thanks for testing and reporting back stemsee 8)
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#69 Post by Bert »

It seems Victor Ananjevsky keeps adding wonderful stuff to his yad treasure chest...and then lets us search for the key :lol: Many of the new capabilities sound great, but it's not easy to discover how to use them.

Here's part of the "NEWS" file, found in the sources:
Version 0.31.0
- add separators to list dialog
- use YAD_OPTIONS variable for specify default yad arguments
- add --no-rules-hint option to list dialog
- add parameters for controlling palletes in color selection
- remove some entries from settings file
- set default open command and date format through the settings file
- add additional filter settings for file selection dialogs
- apply filter and preview settings to all of file selection dialogs
- fix settings custom icon theme

Version 0.30.1
- fix parsing paned orientation

Version 0.30.0
- add paned dialog
- add --parent-win option to make dialog transient for special window
- add --uri-color option for setting text color of URIs in text-info dialog

Version 0.29.1
- fix build without HTML dialog

Version 0.29.0
- fix focus problems in html dialog
- set default encoding from locale for html widget
- fix quoted output in form dialog
- add --no-escape option to prevent close dialog when Esc is pressed
- show gtk version within --version and about dialog
- fix build with gcc 5.x

Version 0.28.1
- fix incorrect rows output order in form dialog

Version 0.28.0
- add HTML dialog
- add different output formats for color dialog
- add mnemonic feature for field labels in form and entry dialogs
- add completion entry as field type in form dialog
- add output by rows in form dialog when layout with several columns is used
- fix labels in multiprogress dialog
- fix print to file in print dialog
- fix setup arguments for double-click action in list dialog
- update man page

Version 0.27.0
- add --hidden option to notification icon
- add --tooltip-column option to list dialog
- add --gtkrc option
- fix detection of expandind columns in list dialog
- fix markup handling
- add YAD_XID variable for dialogs children
- code cleanup for remove deprecated api

Version 0.26.1
- fix output in list dialog for check and radiolists
- fix button alignment in form dialog
- don't add last item separator in multifile field of form dialog

Version 0.26.0
- double-click actions in list dialog can change values in current row
- impove handling of markup text in list dialog
- add FBTN field type (relief buttons) to form dialog
- add buttons with custom icons
- add labels with icons for tab labels in notebook dialog
- remove --align option for notebook dialog
- numeric entries aligned to the right side

Version 0.25.1
- use normal window hints for dialog windows
- fix menu in notification icon (issue #196)

Version 0.25.0
- add --menu option for notification icon
- add --maximized and --fullscreen options
- unify --listen option for different kind of dialogs
- replace --stdin option by --listen in icon dialog

Vesrion 0.24.1
- fix parsing menu in notification dialog

Version 0.24.0
- add --auto-close option for multi-progress dialog
- add --image-path option
- add --no-click option to list dialog
- allow clear text in text-info dialog with ^L
- new translations
- bug fixes

Version 0.23.1
- wait for child termination in notebook dialog
- honour custom width and height settings in unresizable dialogs

Version 0.23.0
- add --quoted-output option for file, form and list dialogs
- add default values for combo-box field in form dialog
- fix dialogs responses when working in notebook mode

Version 0.22.1
- fix resize of dialog text
- fix usage of stock items in popup menu of notification icon

Version 0.22.0
- add scale field to form dialog
- fix form layout on gtk+-3.0
- fix borders around child dialogs in notebook
- fix handle stdin for icons dialog in compact mode
- fix dialog text alignment
- add italian translation
- update man page

Version 0.21.0
- add optional scrollbars for form dialog
- add "duplicate row" menu entry for editable lists
- some fixes in man page

Version 0.20.3
- update slovak translation
- use double-ckick for selecting date in form dialog
- fix check field layout in form dialog for gtk3

Version 0.20.2
- fix tooltips in list dialog

Version 0.20.1
- fix --kill-parent option

Version 0.20.0
- default value for combo-box can be specified by --entry-text from one of existings entries in list
- add --single-click option for icon dialog
- add log window to progress dialog
- fix geometry settings for unresizable windows
- fix layout on gtk3
- add custom signals for --kill-parent option

Version 0.19.1
- use current path as a default folder for file selection dialogs
- fix parsing .desktop files in icons dialog

Version 0.19.0
- add preview to file dialog
- recognize link type in .desktop files for icon dialog
- make icon description selectable in icon browser
- fix quoting special characters when pass data to the command in list and dnd dialogs

Version 0.18.0
- add notebook dialog
- add --button-layout option
- use markup for bar labels in multiprogress dialog
- make --align works for multi-progress too
- fix --geometry behavior
- fix wrap for multiline text fields in form dialog
- add radio and hidden column types in list dialog
- add @disabled@ value to form dialog
- add precisions to form and entry numeric fields
- add --listen option to list and text dialogs

Version 0.17.1.1
- fix --listen mode of notification

Version 0.17.1
- fix build with gtk+ < 2.22
- add wrapping to multiline text field in form dialog
- fix search in text-info dialog
- fix handling empty strings in --listen mode of notification
- add traditional chinese translation

Version 0.17.0
- add search in --text-info dialog (activate by pressing Ctrl+S)
- add multiline text field to form dialog
- add multiply directory selection to form dialog
- add --rest option for specify extra command-line options through the external file
- add new setting "ignore_unknown_options"
- list dialog now can handle command-line and stdin data at the same time
- sending "^L" to list dialog will clear the list

Version 0.16.3
- fix text settings in text-info dialog on gtk3
- fix --percentage option in progress dialog
- recognize special characters like \n in form labels

Version 0.16.2
- always set first item as active for combo-box in entry dialog
- fix includes in print for build with gtk3

Version 0.16.1
- add initial sorting to yad icon browser
- remove some deprecated calls
- fix build with gtk+-3.0

Version 0.16.0
- add printing dialog
- add callbacks for dialog buttons
- add icons for popup menu in notification icon
- add french translation
- make Return works for combo-boxes in entry dialog
- change notification behavior. if --listen is specified, left click on icon
doesn't close it
- add --text-align option for aligning dialog text

Version 0.15.1
- fix grid placement in form dialog
- fix popup menu in editable lists
- fix escaping markup text
- update man page

Version 0.15.0
- add multiple progress bars dialog
- add field control for buttons in form dialog
- keep current directory in auxiliary file selectors in form dialog
- add tooltips for form buttons
- add new field types: SFL for create new file and CDIR for create new dir
- add --tooltip option for dnd dialog
- fix setting initial value for numeric field in form dialog
- add --print-xid option
- for progress dialog the default button is gtk-close now
- user can specify gtk version in ./configure script
- new yad icons (special thanks to Bogdan Lisovich)

Version 0.14.2
- fix broken dialog text placement

Version 0.14.1
- fix build with gtk3

Version 0.14.0
- add regex search to list dialog
- add --page option for scale dialog
- add marks to scale dialog
- add expander for main widget
- bug fixes

Version 0.13.0
- fixes for icons in entry dialog
- add icons for editable combo-boxes in entry dialog
- add new field types for form dialog - labels and buttons
- fix blinking behavior in notification icon
- some improvements in user-defined double-click action for list dialog
- dialog text can be selected if --selectable-labels specified
- fix image clipping in gtk+-3.0
- fix tooltips in list dialog
- fix wrapping dialog's text
- add --border option for set margins around dialog widgets
- add names for widgets for customize dialog look&feel through .gtkrc
- fix handling window icon
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#70 Post by Bert »

slavvo67 wrote:For those that might not be aware, YAD supports columns since about version 25. Importantly, if you write a script with the --columns= and run it unknowingly on a puppy with an older version of YAD; it will make a mess.

Quick example below:

yad --title='Website Choice' --text='Paste Site or Sites Here' --form --columns=2 --field='Website Name 1' --form --field='Website Name 2' --form --field='Website Name 3' --form --field='Website Name 4' --form --field='Website Name 5' --form --field='Website Name 6' --form --field='Website Name 7' --form --field='Website Name 8' --form --field='Left Blank' --form --field='Name or Comment' --form --field='Name or Comment' --form --field='Name or Comment' --form --field='Name or Comment' --form --field='Name or Comment'
Hi slavvo67,

Thanks for the "--columns=" example!

To make things easier, I think "--form" needs to be written only once:

Code: Select all

yad --title='Website Choice' --text='Paste Site or Sites Here' --form --columns=2 --field='Website Name 1' --field='Website Name 2' --field='Website Name 3' --field='Website Name 4' --field='Website Name 5' --field='Website Name 6'  --field='Website Name 7' --field='Website Name 8' --field='Left Blank' --field='Name or Comment' --field='Name or Comment' --field='Name or Comment' --field='Name or Comment' --field='Name or Comment'
Thanks again. I'd never seen a '--columns=' example before!
Attachments
image-1.png
(24.06 KiB) Downloaded 2778 times
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#71 Post by slavvo67 »

Please refer to Smokey01's first post for a quick YAD manual. Of course, it doesn't take into account all the additions.

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#72 Post by smokey01 »

Not yet but the plan is to include them.

Cheers.

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#73 Post by Bert »

Yes, I have smokey01's tutorial available.
In fact, smokey01's initiative gave me the courage to reconsider learning YAD. :wink: Earlier attempts just drove me crazy...

When I'm in another OS than Puppy, I can still read the Yad-Tips in the browser. Nice.

So, thanks for your work smokey01! Scripting, bash, etc. are not my forte, but if I discover something new in yad, I will certainly share it here. :)
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

Custom icons and tooltips for buttons

#74 Post by Bert »

This is new to me: custom icons and tooltips for buttons:

Code: Select all

#!/bin/bash
#
yad --button="Worldsoup!/usr/local/lib/X11/themes/JQ8raised/www48.png:fbtn!" \
       --button="Hi there!gtk-preferences" \
       --button="Hello!/usr/local/lib/X11/pixmaps/phone48.png!hellohello?" \
       --button="Byebye!/usr/local/lib/X11/themes/Moka/shutdown24.png!see you later" \
EDIT: I made a mistake.. at the end of the first button line the ":fbtn" and the "!" are not needed. The ":fbtn" is for form-field-buttons and the "!" is only needed when followed by a tooltip. For normal buttons the structure is simple: "Text!Icon!Tooltip"

So the above code should be:

Code: Select all

yad --button="Worldsoup!/usr/local/lib/X11/themes/JQ8raised/www48.png" \
       --button="Hi there!gtk-preferences" \
       --button="Hello!/usr/local/lib/X11/pixmaps/phone48.png!hellohello?" \
       --button="Byebye!/usr/local/lib/X11/themes/Moka/shutdown24.png!see you later" 
[/EDIT]
Available in YAD 0.26.0 and higher.
Attachments
image-1.png
(18.23 KiB) Downloaded 2767 times
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

"form-field-button"

#75 Post by Bert »

A quick example of "form-field-buttons"

Code: Select all

#!/bin/sh

yad --form \
       --field="PETS!/root/spot/spot.png!Isn't tha spot? :fbtn" \
       --field="STEP!/root/spot/spot2.png:fbtn" \
       --field="PETS"
Attachments
yad-form-field-button.png
(23.59 KiB) Downloaded 2738 times
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#76 Post by slavvo67 »

Hi Bert:

Regarding your post 2 items up, I don't believe those buttons wrap around if you continue adding buttions. I created something similar that went off my screen to the right from having too many buttons. Perhaps there's a fix but for me, a truly annoying fact.

Slavvo67

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

Re: "form-field-button"

#77 Post by Geoffrey »

Bert wrote:A quick example of "form-field-buttons"

Code: Select all

#!/bin/sh

yad --form \
       --field="PETS!/root/spot/spot.png!Isn't tha spot? :fbtn" \
       --field="STEP!/root/spot/spot2.png:fbtn" \
       --field="PETS"
Bert,

I compiled yad

Code: Select all

yad --version
0.31.0 (GTK+ 2.24.8)
The script doesn't show any buttons with images, I only get the PETS field.
Attachments
yad-field.png
(7.76 KiB) Downloaded 1319 times
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#78 Post by Bert »

slavvo67 wrote:Hi Bert:

Regarding your post 2 items up, I don't believe those buttons wrap around if you continue adding buttions. I created something similar that went off my screen to the right from having too many buttons. Perhaps there's a fix but for me, a truly annoying fact.

Slavvo67
Hi Slavvo67,

Yes, I think you are right. This is about adding custom button icons and button tooltips to the "traditional" yad window, which normally only has just a couple of buttons.

Perhaps using the "yad-form-field-buttons" would allow what you're looking for? (maybe combined with columns?) Just guessing, I haven't tried it.
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

Re: "form-field-button"

#79 Post by Bert »

Geoffrey wrote:Bert,

I compiled yad

Code: Select all

yad --version
0.31.0 (GTK+ 2.24.8)
The script doesn't show any buttons with images, I only get the PETS field.
That's strange...you should at least see the top button too, the one labeled "PETS". The second button is based on an image I made, so that's not available to you. But even with this second button you should see its text ("STEP") and the yad icon, which always appears when an icon can not be found.

Maybe the GTK version is important? I have this:

Code: Select all

yad --version
0.31.0 (GTK+ 2.24.10)
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

User avatar
rg66
Posts: 1158
Joined: Mon 23 Jul 2012, 05:53
Location: Vancouver, BC Canada / Entebbe, Uganda Africa!?!

Re: "form-field-button"

#80 Post by rg66 »

Bert wrote:That's strange...you should at least see the top button too, the one labeled "PETS". The second button is based on an image I made, so that's not available to you. But even with this second button you should see its text ("STEP") and the yad icon, which always appears when an icon can not be found.
It doesn't work properly if you copy/paste into the terminal but does if you run it from a script.
Attachments
Screenshot.jpg
(12.99 KiB) Downloaded 1293 times
Last edited by rg66 on Thu 01 Oct 2015, 12:48, edited 1 time in total.
X-slacko-5b1 - X-tahr-2.0 - X-precise-2.4
[url=http://smokey01.com/rg66/]X-series repo[/url]

Post Reply