yad icon indicating copy to clipboard operation
yad copied to clipboard

Combine FBTN with CB with columns=2?

Open frostworx opened this issue 3 years ago • 2 comments

Currently, I use the main buttons on the bottom for calling internal functions Those buttons use space of course, so the minimal width of some windows is already too big. Now I wonder if combining a :FBTN with a :CB "live" using columns=2 could work somehow (so basically as an alternative for a :FCB)

Mockup example: yad --form --columns=2 --field="Function":CB "function1\!function2\!function3" --field="Execute":FBTN "bash -c $SELECTION_FROM_CB_FIELD" (When clicking Execute the Function is supposed to be started at once - optional closing the current window would be great)

I'd like to avoid having to choose a function in :CB and launch it with a regular bottom button, because this would be confusing. Using multiple :FBTN would be not the best solution in this case, because this specific window is supposed to be as comprehensible as possible.

Would be great if someone could help

frostworx avatar Apr 26 '21 09:04 frostworx

is that what you want?

#! /bin/bash

function hndl {
    echo "Choosed function - $1"
    kill -USR2 $YAD_PID
}
export -f hndl

yad --button="yad-close:1" --use-interp --form --columns=2 \
    --field="Function":CB "function1\!function2\!function3" \
    --field="Execute":FBTN "hndl '%1'"

v1cont avatar Apr 30 '21 16:04 v1cont

Wow, thank you very much, that is exactly what I wanted! I already solved my initial problem, by moving all functions as buttons into my main menu, but it is great to know, that this function is already available, and I will make use of it for sure :) I hope my questions are not too annoying, but I really could not find this anywhere (either it is hidden pretty good or I have serious search problems :)) Thank you very much for your continuous help!

frostworx avatar Apr 30 '21 16:04 frostworx