Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 23 Jan 2018, 18:19
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
YAD - Tips
Post new topic   Reply to topic View previous topic :: View next topic
Page 22 of 22 [324 Posts]   Goto page: Previous 1, 2, 3, ..., 20, 21, 22
Author Message
misko_2083


Joined: 08 Nov 2016
Posts: 19

PostPosted: Sun 06 Aug 2017, 20:46    Post subject: yad internet radio player  

Not so much stations in this little internet radio player, but at least got it working. Requres: mpv and yad

The radio stations are in a separate file, and should be in the same folder.
Otherwise, it can be this line in the script:
Code:
export pmrp_stations="stations"
pmrp.tar
Description 
tar

 Download 
Filename  pmrp.tar 
Filesize  20 KB 
Downloaded  68 Time(s) 
pmrp.png
 Description   
 Filesize   80.58 KB
 Viewed   549 Time(s)

pmrp.png

Back to top
View user's profile Send private message 
drxspace

Joined: 28 Jul 2017
Posts: 3

PostPosted: Tue 08 Aug 2017, 06:09    Post subject:  

Hello everyone,

as I've post here: https://groups.google.com/d/msg/yad-common/d4YLAE_3-5o/W0owMLv_FwAJ, I'm facing the same issue. Take for example the next code:
Code:
yad --form --width=320 --height=240 --borders=5 --fixed --center \
       --window-icon="system-software-install" --title="About ArchLinux Packages Viewer" \
       --image="system-software-install" --image-on-top \
       --text="<span font_size='medium' font_weight='bold'>View Lists of Installed Packages</span>\n\
These are packages from all enabled \nrepositories except for base and base-devel \nones. Also, you\'ll find packages that \nare locally installed such as AUR packages." \
       --buttons-layout="center" \
       --button=$"Κλείσιμο!window-close!Κλείνει το παράθυρο:0"


I would like to ask: Why the dialog window/form doesn't obey the --height=N rules?

Thanks for your prompt response to this matter.
Back to top
View user's profile Send private message 
smokey01


Joined: 30 Dec 2006
Posts: 2669
Location: South Australia

PostPosted: Tue 08 Aug 2017, 06:29    Post subject:  

drxspace wrote:
Hello everyone,

as I've post here: https://groups.google.com/d/msg/yad-common/d4YLAE_3-5o/W0owMLv_FwAJ, I'm facing the same issue. Take for example the next code:
Code:
yad --form --width=320 --height=240 --borders=5 --fixed --center \
       --window-icon="system-software-install" --title="About ArchLinux Packages Viewer" \
       --image="system-software-install" --image-on-top \
       --text="<span font_size='medium' font_weight='bold'>View Lists of Installed Packages</span>\n\
These are packages from all enabled \nrepositories except for base and base-devel \nones. Also, you\'ll find packages that \nare locally installed such as AUR packages." \
       --buttons-layout="center" \
       --button=$"Κλείσιμο!window-close!Κλείνει το παράθυρο:0"


I would like to ask: Why the dialog window/form doesn't obey the --height=N rules?

Thanks for your prompt response to this matter.


It seems work to here: I changed the width and height and put the "N" in brackets, not that should make a difference.

My code:
Code:
yad --form --width="350" --height="130" --borders=5 --fixed --center \
       --window-icon="system-software-install" --title="About ArchLinux Packages Viewer" \
       --image="system-software-install" --image-on-top \
       --text="<span font_size='medium' font_weight='bold'>View Lists of Installed Packages</span>\n\
These are packages from all enabled \nrepositories except for base and base-devel \nones. Also, you\'ll find packages that \nare locally installed such as AUR packages." \
       --buttons-layout="center" \
       --button=$"Κλείσιμο!window-close!Κλείνει το παράθυρο:0"


What version of Yad are you using? yad --version
example.png
 Description   
 Filesize   13.32 KB
 Viewed   495 Time(s)

example.png


_________________
Software <-> Distros <-> Tips <-> Newsletters
Back to top
View user's profile Send private message Visit poster's website 
drxspace

Joined: 28 Jul 2017
Posts: 3

PostPosted: Wed 09 Aug 2017, 06:32    Post subject:  

Hello,
thank you for your response.
smokey01 wrote:
What version of Yad are you using? yad --version

I'm running YAD 0.39.0 (GTK+ 3.22.18)

To be honest I've never thought that I could use string type values in these fields.

Anyway in order to address my problem I have to insist with with a different version of the same example.
In this version I removed some of the \n characters because I want my text, if possible, to be dynamically wrapped in the dialog window, also I removed the --fixed option...

Code:
yad --form --width="350" --height="130" --borders=5 --center --window-icon="system-software-install" --title="About ArchLinux Packages Viewer" --image="system-software-install" --image-on-top --text="<span font_size='medium' font_weight='bold'>View Lists of Installed Packages</span>\nThese are packages from all enabled repositories except for base and base-devel ones. Also, you\'ll find packages that are locally installed such as AUR packages." --buttons-layout="center" --button='Κλείσιμο!window-close!Κλείνει το παράθυρο:0'


...and the result was as shown below.

Why this behavior?

Thanks and again
About ArchLinux Packages Viewer.png
 Description   
 Filesize   15.23 KB
 Viewed   453 Time(s)

About ArchLinux Packages Viewer.png

Back to top
View user's profile Send private message 
smokey01


Joined: 30 Dec 2006
Posts: 2669
Location: South Australia

PostPosted: Thu 10 Aug 2017, 08:29    Post subject:  

@drxspace I am currently using yad 0.36.3 (GTK+ 2.24.31)

It may have something to do with gtk+3 or ArchLinux (assuming you are running Arch) as it's working fine here.

_________________
Software <-> Distros <-> Tips <-> Newsletters
Back to top
View user's profile Send private message Visit poster's website 
drxspace

Joined: 28 Jul 2017
Posts: 3

PostPosted: Thu 10 Aug 2017, 12:06    Post subject:  

Hi,
@smokey01 Yes, I'll agree with you it's probably a matter of GTK+ 3
Anyway, if I do not tire you, please have a look at the code below:
Code:
isitTheBlank=$(sed 's/[[:blank:]]*/·/g' <<<$"These are packages from all enabled repositories, except for base and base-devel ones. Also, you\'ll find packages that are locally installed, such as AUR packages.")

yad --form --width="350" --height="130" --borders=5 --center --window-icon="system-software-install" --title="About ArchLinux Packages Viewer" --image="system-software-install" --image-on-top --text="<span font_size='medium' font_weight='bold'>View Lists of Installed Packages</span>\n${isitTheBlank}" --buttons-layout="center" --button='Κλείσιμο!window-close!Κλείνει το παράθυρο:0'


Thank you for the remarks.
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 2047
Location: In The Way

PostPosted: Fri 12 Jan 2018, 10:24    Post subject:  

How to make yad update instead of accumulate when piping data!

Code:
PATTERN='s/^.*Address: ([0-9A-Z:]*)/\n\1/p
s/^.*Quality=([^ ]*).*Signal level=(.*)/\1 \2/p
s/^.*key:([onf]*)/~\1~/p
s/^.*ESSID://p'
mkfifo /tmp/pipe
exec 4<>/tmp/pipe
while true; do echo "`iwlist wlan0 scan | sed -rn "$PATTERN" | tac`" >&4; sleep 5; done &
yad --list --item-separator=';' --columns=5 --column=wlan0 --column=security --column=signal --column=mac --column=save:CHK <&4 &
Back to top
View user's profile Send private message MSN Messenger 
slavvo67

Joined: 12 Oct 2012
Posts: 1480
Location: The other Mr. 305

PostPosted: Fri 12 Jan 2018, 17:54    Post subject:  

Still love YAD.

Guys, maybe you can provide guidance on something....

Take a look at Misko's post, specifically at the bottom buttons. How can I create a list of buttons going vertical and horizontal. Currently, I just get a long line of them going across AND it stretches past my screen width; not pretty. So like the generic OK and Cancel buttons but enhanced to list maybe 5 across and 10 vertical lines.

Thanks for any insight.

Slavvo67
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 2047
Location: In The Way

PostPosted: Sat 13 Jan 2018, 05:43    Post subject:  

specify columns then if you have 16 buttons they will divide into 4x4 etc
Code:
yad --columns=4
Back to top
View user's profile Send private message MSN Messenger 
Display posts from previous:   Sort by:   
Page 22 of 22 [324 Posts]   Goto page: Previous 1, 2, 3, ..., 20, 21, 22
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1139s ][ Queries: 15 (0.0385s) ][ GZIP on ]