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 Fri 24 Nov 2017, 02:00
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 18 of 22 [321 Posts]   Goto page: Previous 1, 2, 3, ..., 16, 17, 18, 19, 20, 21, 22 Next
Author Message
mcewanw

Joined: 16 Aug 2007
Posts: 3194
Location: New Zealand

PostPosted: Fri 09 Sep 2016, 08:29    Post subject:  

Anyone know if there is a 'width' attribute for buttons in YAD, and if so, how to use it? (to change the displayed width of buttons)

William

_________________
SomeOfMyWork with links:
dCoreDog
weX, scrox, Precord, Premote, fokSyfEyeR, xhippo-mod, flite_hts_pet
Back to top
View user's profile Send private message Visit poster's website 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1392
Location: Japan

PostPosted: Fri 09 Sep 2016, 10:01    Post subject:  

There is no 'width' attribute for buttons. Button width for all buttons is determined by the width of the widest button. You can add spaces to the button with the longest label to make all buttons wider.
Back to top
View user's profile Send private message 
Geoffrey


Joined: 30 May 2010
Posts: 2308
Location: Queensland

PostPosted: Fri 09 Sep 2016, 17:59    Post subject:  

Buttons in --form --field are the width of the window
Code:
yad --form --field="test1:FBTN" "yad --text='test1'" \
--field="test2:FBTN" "yad --text='test2'" \
--field="test3:FBTN" "yad --text='test3'"
yad-button.jpg
 Description   
 Filesize   8.64 KB
 Viewed   910 Time(s)

yad-button.jpg


_________________
Carolina: Recent Repository Additions

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

Joined: 16 Aug 2007
Posts: 3194
Location: New Zealand

PostPosted: Sat 10 Sep 2016, 18:46    Post subject:  

Thanks for the button width information. Good to know.

William

_________________
SomeOfMyWork with links:
dCoreDog
weX, scrox, Precord, Premote, fokSyfEyeR, xhippo-mod, flite_hts_pet
Back to top
View user's profile Send private message Visit poster's website 
misko_2083


Joined: 08 Nov 2016
Posts: 19

PostPosted: Tue 08 Nov 2016, 10:27    Post subject: multiprogress dialog tip  

Hi everyone,
Check my youtube-dl wrapper for youtube. works for youtube lists and videos. Has two GUIs. I figure someone will find it usefull because it supports multiple downloads at the same time and displays a multiprogress dialog. Cheers

https://github.com/Misko-2083/yt-get/blob/master/yt-get
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1441
Location: Ukraine

PostPosted: Tue 08 Nov 2016, 15:42    Post subject:  

Dear Misko,

Very nice, and nicely coded. I just added a bit of eye candy. Smile

With kind regards,
vovchik
yt-get.tar.gz
Description 
gz

 Download 
Filename  yt-get.tar.gz 
Filesize  5.5 KB 
Downloaded  77 Time(s) 
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1441
Location: Ukraine

PostPosted: Wed 09 Nov 2016, 05:53    Post subject:  

Dear all,

Here is a little YAD-based task killer. I found most of the code somewhere and modded it a bit. It's not too bad, but it is not the fastest thing in the world. It seems to work. Smile

With kind regards,
vovchik
ypid.tar.gz
Description 
gz

 Download 
Filename  ypid.tar.gz 
Filesize  1.37 KB 
Downloaded  76 Time(s) 
Back to top
View user's profile Send private message 
misko_2083


Joined: 08 Nov 2016
Posts: 19

PostPosted: Wed 09 Nov 2016, 23:47    Post subject:  

vovchik wrote:
Dear Misko,

Very nice, and nicely coded. I just added a bit of eye candy. Smile

With kind regards,
vovchik


Vovchik, it looks great. Very Happy
Just found this for the .bashrc
similar to this http://worldwidemann.com/a-gui-file-picker-for-bash-in-six-lines-of-code/
Code:
# Yad gui file selector
# put in .bashrc and call with ctrl+g from terminal
select_files() {
local file files i IFS=' '
local -n l=READLINE_LINE p=READLINE_POINT
while IFS= read -rd '' file; do printf -v 'files[i++]' %q "$file"
done < <(yad --file --multiple --width=600 --height=600 --center | tr '|\n' '\0\0')
files="${files[*]}" l=${l:0:p}$files${l:p} p=$((p+${#files}));
}
bind -x '"\C-g":select_files'

Regards
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1441
Location: Ukraine

PostPosted: Thu 10 Nov 2016, 06:14    Post subject:  

Dear Misko,

Thanks. It's very compact and convenient, and available everywhere. Smile

With kind regards,
vovchik
Back to top
View user's profile Send private message 
step

Joined: 04 May 2012
Posts: 950

PostPosted: Thu 10 Nov 2016, 19:46    Post subject:  

My bash shell returns an error when parsing Misko's script - but I can't find a syntax error anywhere in it. Anyone with the same problem?
Code:

sh: syntax error near unexpected token `<'

That's the "<" before "<("
Code:

# bash --version
GNU bash, version 4.3.42(1)-release (x86_64-unknown-linux-gnu)

_________________
Fatdog64-710|+Packages|Kodi|Findnrun|+forum|gtkmenuplus
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1392
Location: Japan

PostPosted: Sat 12 Nov 2016, 04:22    Post subject:  

step wrote:
My bash shell returns an error when parsing Misko's script - but I can't find a syntax error anywhere in it. Anyone with the same problem?
Code:

sh: syntax error near unexpected token `<'

That's the "<" before "<("
Even without looking into the script the error message is obvious: "<(" would be a bash process substitution which is not available when you invoke bash in POSIX mode. i.e. with a #!/bin/sh shebang.
Use #!/bin/bash instead.
Back to top
View user's profile Send private message 
step

Joined: 04 May 2012
Posts: 950

PostPosted: Sat 12 Nov 2016, 15:33    Post subject:  

MochiMoppel wrote:
pocess substitution which is not available when you invoke bash in POSIX mode. i.e. with a #!/bin/sh shebang.
Use #!/bin/bash instead.
Thanks MochiMoppel. Actually, I was pasting the code directly into terminal, so there was no shebang involved. But I'm pretty sure you hit the nail on its head. There are other ways to enable POSIX mode, so I'll check my setup to ensure that POSIX is disabled.
_________________
Fatdog64-710|+Packages|Kodi|Findnrun|+forum|gtkmenuplus
Back to top
View user's profile Send private message 
april


Joined: 14 Sep 2013
Posts: 1009
Location: Off Lizard Island for a bit

PostPosted: Mon 05 Dec 2016, 05:08    Post subject:  

I have one I want to get going but don't know how .

I'm after a form that comes up with say 8 fields on one line and then the next line down is the same but a different background colour.

Multiple lines , say 1000 and scrolling . Ability to work through each field in order and enter takes it to the next line.

Now it is needed to look exactly like a bank statement and have the same data fields as date number details code debit credit balance and presented(T/F).

If anyone knows Quickbooks I want it to look just like one of their bank entry forms

Anyone ever done similar?
Back to top
View user's profile Send private message Yahoo Messenger 
gyro

Joined: 28 Oct 2008
Posts: 1407
Location: Brisbane, Australia

PostPosted: Sun 22 Jan 2017, 13:46    Post subject:  

I've just discovered yad and I'm trying to use it for a little project I'm working on,
but I have a problem.

I'm using the following code to select a directory:
Code:
INIT_DIR="$(pwd)"
RET_DIR=$(yad --center --borders=6 --title "dircrypt - Select encrypted directory" \
         --file --directory --width=600 --height=400 --filename="$INIT_DIR/")
It all seems to work fine except when I use the "Create Folder" button. After typing in the name of the new folder I hit the "Enter" key, and nothing happens. I expect it to cause the new folder name to be accepted.

I'm doing this on puppy_xenial_7.0.4 using
Code:
yad --version
0.38.1 (GTK+ 2.24.30)
(I downloaded and compiled it.)

Has anyone had a similar problem?
Is it likely to be a bug in this particular version?

Note1: All my other yad dialogs seem to work as expected.

Note2: Before "discovering" yad, I wrote a gtk C program to do the same thing, calling the builtin gtk_file_chooser_dialog. It looks rather similar, except that the "Enter" key works after naming a new folder.

gyro
Back to top
View user's profile Send private message 
Geoffrey


Joined: 30 May 2010
Posts: 2308
Location: Queensland

PostPosted: Sun 22 Jan 2017, 19:39    Post subject:  

gyro, works ok for me with yad
Code:
yad --version
0.36.3 (GTK+ 2.24.23)


yeah the new folder is created by either a mouse click or enter key, the button's do nothing, they need to be give an action

Code:
INIT_DIR="$(pwd)"
RET_DIR=$(yad --center --borders=6 --title "dircrypt - Select encrypted directory" \
        --button="gtk-ok:0" --button="gtk-cancel:1" --file --directory --width=600 --height=400 --filename="$INIT_DIR/")

[[ $? -eq 0 ]] && SOME_ACTION

[[ $? -eq 1 ]] && SOME_OTHER_ACTION

_________________
Carolina: Recent Repository Additions

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 18 of 22 [321 Posts]   Goto page: Previous 1, 2, 3, ..., 16, 17, 18, 19, 20, 21, 22 Next
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.1208s ][ Queries: 14 (0.0073s) ][ GZIP on ]