Dynamic field type in form + Notebook issue

779 views
Skip to first unread message

Fabio M.

unread,
Mar 1, 2013, 5:14:44 AM3/1/13
to yad-c...@googlegroups.com
Hi guys,

I have 2 issues with Yad, let me describe here:

First one, I'm trying to create a form with a dynamic field type,
something similar to a "conditional format". What I have in mind is,
starting from a form like this:

yad --form --field="Question:CB" "Don't provide info!Provide the
following info" --field="Answer:RO" "Insert info here:"

making the --field="Answer:LBL" automatically and dynamically shifting
to --field"Answer:text" when ComboBox selected option is the second
(Provide the following info) instead of the first (Don't provide
info).

If you have some idea, just let me know :)

Second issue, when I use a Notebook dialog (basically the example on
the man) I bump into a "yad: cannot create shared memory for key
12345" error message. I can't guess what I'm doing wrong.

I'm using Yad last version from svn, in a bash environment.

Fabio

Victor Ananjevsky

unread,
Mar 1, 2013, 5:36:27 AM3/1/13
to yad-c...@googlegroups.com
В Fri, 1 Mar 2013 11:14:44 +0100
"Fabio M." <fabio.m...@gmail.com> писал:

> Hi guys,
>
> I have 2 issues with Yad, let me describe here:
>
> First one, I'm trying to create a form with a dynamic field type,
> something similar to a "conditional format". What I have in mind is,
> starting from a form like this:
>
> yad --form --field="Question:CB" "Don't provide info!Provide the
> following info" --field="Answer:RO" "Insert info here:"
>
> making the --field="Answer:LBL" automatically and dynamically shifting
> to --field"Answer:text" when ComboBox selected option is the second
> (Provide the following info) instead of the first (Don't provide
> info).
>
> If you have some idea, just let me know :)
>

this is impossible right now. i don't handle changes in form fields.
only buttons fields can change the current values of a form



> Second issue, when I use a Notebook dialog (basically the example on
> the man) I bump into a "yad: cannot create shared memory for key
> 12345" error message. I can't guess what I'm doing wrong.
>
> I'm using Yad last version from svn, in a bash environment.
>
> Fabio

can you create a piece of shared memory with ipcmk -M 1024?

>
> --
> You received this message because you are subscribed to the Google Groups "yad-common" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to yad-common+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>


--
Victor Ananjevsky <anan...@gmail.com>

Fabio M.

unread,
Mar 1, 2013, 6:34:54 AM3/1/13
to yad-c...@googlegroups.com
> this is impossible right now. i don't handle changes in form fields.
> only buttons fields can change the current values of a form

So I could do a dynamic shift by a button? can you please share an example?


> can you create a piece of shared memory with ipcmk -M 1024?

I've tried right now, with no luck :(

Here's the result:
ipcmk -M 1024
Shared memory id: 2261013
./test.sh
yad: cannot create shared memory for key 12345: file exists


Thanks for the support :)

Fabio

Victor Ananjevsky

unread,
Mar 1, 2013, 7:04:09 AM3/1/13
to yad-c...@googlegroups.com
В Fri, 1 Mar 2013 12:34:54 +0100
"Fabio M." <fabio.m...@gmail.com> писал:

> > this is impossible right now. i don't handle changes in form fields.
> > only buttons fields can change the current values of a form
>
> So I could do a dynamic shift by a button? can you please share an example?


#! /bin/sh

yad --form \
--field="Button1:btn" '@echo "3:button 1 is pressed"' \
--field="Button2:btn" '@echo "3:button 2 is pressed"'\
--field="Answer" "initial"

all button values, started from '@' means to parse output of command,
and if some strings starts with 'N:', sets the value of field N to
appropriate string. in a command you may use substitution '%N' for
getting a current value of N'th field

>
>
> > can you create a piece of shared memory with ipcmk -M 1024?
>
> I've tried right now, with no luck :(
>
> Here's the result:
> ipcmk -M 1024
> Shared memory id: 2261013
> ./test.sh
> yad: cannot create shared memory for key 12345: file exists
>

can you show me output of ipcs -m, and try to use a different key, not 12345?

>
> Thanks for the support :)
>
> Fabio
>

Fabio M.

unread,
Mar 4, 2013, 4:25:46 AM3/4/13
to yad-c...@googlegroups.com
> #! /bin/sh
[cut]
> getting a current value of N'th field

Thanks :)


> can you show me output of ipcs -m, and try to use a different key, not 12345?

I've fixed this, it was a ridiculous typo -_-

Again, thanks a lot for the support! And of course keep on with this
great project :)

Bye,
Fabio

Ashish Srivastava

unread,
Nov 16, 2016, 6:18:14 AM11/16/16
to yad-common
                                                                                                                       
Hi. I'm still getting this error :

     ./myscript.sh
   yad: cannot create shared memory for key 12345: file exists

   As you asked this question:
   "can you create a piece of shared memory with ipcmk -M 1024? "

I've tried right now, and here's the result:
 
 root:# ipcmk -M 1024
 
 Shared memory id: 2261013
 
root:# ./myscript.sh
yad: cannot create shared memory for key 12345: file exists
 
  Can you please help me out with this?

   Thanks.

Mohanish Goel

unread,
Jul 22, 2017, 1:42:21 PM7/22/17
to yad-common
#! /bin/sh                                                                                                                
                                                                                                                           
yad --form \                                                                                                              
    --field="Button1:btn" '@echo "3:button 1 is pressed"' \                                                                
    --field="Button2:btn" '@echo "3:button 2 is pressed"'\                                                                
    --field="Answer" "initial"
Hi,
Is it possible to parse more than one output to different fields of the form. This is what I'm trying to do

yad --form \
    --field="Customer name" ""\
    --field="Click here if registered owner is same as above":BTN "@echo '3:%1' && @echo '4:Self'" \
    --field="Registered owner" "" \
    --field="Relation of customer with registered owner":CB 'Friend!Father!Mother!Wife!Son!Daughter'

What I need here is, on clicking the button, parse the value of field one to the third field and value of field fourth as the string "Self". Unfortunately, using && operator doesn't work.
Is there a correct way to do that?
Thanks in advance.

John G

unread,
Jul 31, 2017, 12:26:05 PM7/31/17
to yad-common
yad --form \
   
--field="Customer name" "" \

   
--field="Click here if registered owner is same as above":BTN '@bash -c "echo 3:%1; echo 4:Self"' \
   
--field="Registered owner" "" \
   
--field="Relation of customer with registered owner":CB 'Friend!Father!Mother!Wife!Son!Daughter!Self'




Mohanish Goel

unread,
Jul 31, 2017, 3:15:30 PM7/31/17
to yad-c...@googlegroups.com
Thanks.
Though this works as asked, parsing the string "Self" to a combo-box appends it to the list of combo-box options, while keeping the string "Friend" as the field text.
Is there any solution to this?

YAD version: 0.27.0

Julio C. Neves

unread,
Aug 1, 2017, 8:58:18 AM8/1/17
to yad-c...@googlegroups.com
Haverá YouTube tried "^self"?

--
You received this message because you are subscribed to the Google Groups "yad-common" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yad-common+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mohanish Goel

unread,
Aug 2, 2017, 2:38:26 AM8/2/17
to yad-c...@googlegroups.com
Tried it.
Doesn't work.
Reply all
Reply to author
Forward
0 new messages