yad, gtkdialog, any Qt similar type apps?

For discussions about programming, and for programming questions and advice


Moderator: Forum moderators

Post Reply
User avatar
wiak
Posts: 3673
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 57 times
Been thanked: 1028 times
Contact:

yad, gtkdialog, any Qt similar type apps?

Post by wiak »

I just posted how masterpdfedit 4.3.61 also worked in WDL_Arch64 using Qt5 libs (along with sane):

Code: Select all

pacman -Sy sane qt5-base qt5-svg

https://github.com/dotxyteam/CommandUI
The thought crossed my mind (as it does now and then) that it would be easier to build smaller distros if only we used only GTK or Qt, but not both.

The usefulness of MasterPDFeditor, however, makes some Qt libs inevitable on any system I use in practice, and no doubt I use some other Qt-based apps regularly also.

As far as I recall, Puppy used to avoid Qt and stick to GTK, but then, aside from masterpdfeditor, Simple Screen Recorder obtained a big fan club so Qt became installed by default on some Pups. Of course I use simple old bash/gtkdialog/ffmpeg weX for my own screen capture and web cam and audio needs - partly because weX is just a small bash script, I wrote it, and it allows webcam video embedding in the screen capture, which SSR does not - same quality, but yeah, pause control doesn't work (except for audio-only recording) since controlling ffmpeg (which buffers the video stream) externally rather than tapping into its actual code the way SSR does.

Anyway, what if I wanted to build a Qt-only distro (i.e. not using GTK at all)??? Can it be done? Is there anything like yad, or gtkdialog for Qt objects/widgets/whatever? I don't know - I have never looked and surely if there was it would already be getting used here. Certainly it is possible not to have Qt on your system - as long as you avoid apps that need it.

Anyone know of any yad-type app that uses Qt instead of underlying GTK (or maybe that isn't possible?). PyDialog noted as discontinued for example. KDialog - lots of deps - no idea how powerful/useful??

Confusing, but referring to this PyDialog: https://github.com/blackPantherOS/pydialoghttps://github.com/dotxyteam/CommandUI
https://github.com/dotxyteam/CommandUI
Or maybe often better to use a text-based user-interface TUI, like whiptail? (whiptail uses slang/libnewt I think, dialog, on the otherhand, uses ncurses):

whiptail(1) is a lightweight replacement for dialog(1), to provide dialog boxes for shell scripts. It is built on the newt windowing library rather than the ncurses library, allowing it to be smaller in embedded environments such as installers, rescue disks, etc.

whiptail is designed to be drop-in compatible with dialog, but has less features: some dialog boxes are not implemented, such as tailbox, timebox, calendarbox, etc.

https://www.redhat.com/sysadmin/use-whiptail

Here's a list of the primary box options available for whiptail:if (whiptail --title "Is it Tuesday?" --yesno "Is today Tuesday?" 8 78); then
echo "Happy Tuesday, exit status was $?."
else
echo "Maybe it will be Tuesday tomorrow, exit status was $?."https://github.com/dotxyteam/CommandUI/ ... s/test.stt

fi

--title
--infobox
--msgbox
--yesno
whiptail is designed to be drop-in compatible with dialog, but has less features: some dialog boxes are not implemented, such as tailbox, timebox, calendarbox, etc.

--inputboxdialog --title "Confirmation" --yesno "Are you sure to delete this file?" 10 40dialog --title "Confirmation" --yesno "Are you sure to delete this file?" 10 40
--passwordbox
--menu
--textbox
--checklist
--radiolist
--gauge[/quote]

Hmmm, I could possibly code a version of my weX screen/webcam/audio capture tool to use whiptail...

NOTE: On WDL_Arch64, whiptail is a tiny download. It is in package libnewt:

Code: Select all

pacman -S libnewt

(??? I'm not sure if Java-based at all...??? but see some java under src directory)https://github.com/dotxyteam/CommandUI/ ... s/test.stt

Code: Select all

Packages (2) slang-2.3.2-2  libnewt-0.52.21-5
whiptail is designed to be drop-in compatible with dialog, but has less features: some dialog boxes are not implemented, such as tailbox, timebox, calendarbox, etc.[/quote]

Total Download Size:   0.84 MiB
Total Installed Size:  3.52 MiB

whiptail is designed to be drop-in compatible with dialog, but has less features: some dialog boxes are not implemented, such as tailbox, timebox, calendarbox, etc.[/quote]
Might be worth starting a thread on using whiptail. From redhat link above (just tried via cut and paste into a terminal):
whiptail is designed to be drop-in compatible with dialog, but has less features: some dialog boxes are not implemented, such as tailbox, timebox, calendarbox, etc.

Code: Select all

if (whiptail --title "Is it Tuesday?" --yesno "Is today Tuesday?" 8 78); then
    echo "Happy Tuesday, exit status was $?."
else
    echo "Maybe it will be Tuesday tomorrow, exit status was $?."
fi

Okay, so per usual TUI outputs, not particularly pretty... but low on resource usage for small distros. Alternatively, just use dialog (seems better to me, but I don't know whiptail at all)?

Or something called CommandUI looks interesting (nicer looking output) but apparently Java based... Well, I use Java runtime lib for LibreOffice on my system anyway... Haven't found a tutorial yet.

https://github.com/dotxyteam/CommandUI

Hmmm... I wonder if the following is a CommandUI test file example (frightening if it is - tho gtkdialog is frightening if you make one big test program)?: https://github.com/dotxyteam/CommandUI/ ... s/test.stt

wiak

Attachments
whiptail_Ex1.png
whiptail_Ex1.png (6.01 KiB) Viewed 904 times

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

justnow
Posts: 3
Joined: Sun Aug 15, 2021 5:44 pm
Has thanked: 6 times

Re: yad, gtkdialog, any Qt similar type apps?

Post by justnow »

wiak wrote: Wed Jul 21, 2021 4:28 am

Anyone know of any yad-type app that uses Qt instead of underlying GTK

https://github.com/martynets/dialogbox

The dialogbox application is a scriptable engine which provides a fully customizable GUI dialog box with various widgets. The desired dialog box is built and modified by commands read on the standard input when the end-user actions are reported on standard output. It implements the idea of a GUI <-> text filter tool.

The main purpose of this application is to provide GUI functionality to shell scripts or any other pure console applications capable to communicate with a child process via its standard input/output.

This is a Qt application and it introduces all the power of Qt to shell scripts from command buttons through stylesheets and animations.

Software Requirements

This application is designed using Qt libraries, and you can select if to compile using the QT 4.8 or Qt 5 library. It must be portable across systems supported by the Qt libraries, but the author tested it in GNU/Linux environment only.

To compile the application from the source code the following packages must also be installed on a GNU/Linux system - build-time dependencies:
g++
make
libqt4-dev (only if compiling for QT 4.8 library)
qtbase5-dev (only if compiling for QT 5 library)

____
For what it's worth, also available from antiX as a (debian10_buster) .deb package
http://repo.antixlinux.com/buster/pool/ ... dialogbox/
The related source code for the package is maintained in one of the git project repositories here: https://gitlab.com/nXecure /...

User avatar
wiak
Posts: 3673
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 57 times
Been thanked: 1028 times
Contact:

Re: yad, gtkdialog, any Qt similar type apps?

Post by wiak »

justnow wrote: Sun Aug 15, 2021 5:56 pm
wiak wrote: Wed Jul 21, 2021 4:28 am

Anyone know of any yad-type app that uses Qt instead of underlying GTK

https://github.com/martynets/dialogbox

The dialogbox application is a scriptable engine which provides a fully customizable GUI dialog box with various widgets. The desired dialog box is built and modified by commands read on the standard input when the end-user actions are reported on standard output. It implements the idea of a GUI <-> text filter tool.

The main purpose of this application is to provide GUI functionality to shell scripts or any other pure console applications capable to communicate with a child process via its standard input/output.

This is a Qt application and it introduces all the power of Qt to shell scripts from command buttons through stylesheets and animations.

Software Requirements

This application is designed using Qt libraries, and you can select if to compile using the QT 4.8 or Qt 5 library. It must be portable across systems supported by the Qt libraries, but the author tested it in GNU/Linux environment only.

To compile the application from the source code the following packages must also be installed on a GNU/Linux system - build-time dependencies:
g++
make
libqt4-dev (only if compiling for QT 4.8 library)
qtbase5-dev (only if compiling for QT 5 library)

____
For what it's worth, also available from antiX as a (debian10_buster) .deb package
http://repo.antixlinux.com/buster/pool/ ... dialogbox/
The related source code for the package is maintained in one of the git project repositories here: https://gitlab.com/nXecure /...

Very interesting indeed. Exactly what I was looking for. I note first public release was 2016, but not much development recently. However, most recent dev work has allowed it to be compiled for QT5. I will try it sometime, and possibly report back if any particular comment to make in terms of gtkdialog comparison.

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

User avatar
wiak
Posts: 3673
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 57 times
Been thanked: 1028 times
Contact:

Re: yad, gtkdialog, any Qt similar type apps?

Post by wiak »

Just tried dialogbox. Downloaded the deb and extracted it in WDL_Arch64. It's a small binary (116 kB). Of course it needs Qt libs, which I already had on my WDL system. Here is the result of ldd /usr/local/bin/dialogbox to show the main dependencies, followed by the bash script for one of the demos I ran along with an attached image of the GUI result. The code is under 'demos' on the github site https://github.com/martynets/dialogbox/ ... ster/demos:

Code: Select all

@bootstrap dialog_for_qt]$ ldd /usr/local/bin/dialogbox
	linux-vdso.so.1 (0x00007ffc8e5a6000)
	libQt5Widgets.so.5 => /usr/lib/libQt5Widgets.so.5 (0x00007f53ba729000)
	libQt5Gui.so.5 => /usr/lib/libQt5Gui.so.5 (0x00007f53ba04f000)
	libQt5Core.so.5 => /usr/lib/libQt5Core.so.5 (0x00007f53b9af6000)
	libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f53b9ad5000)
	libGL.so.1 => /usr/lib/libGL.so.1 (0x00007f53b9a4f000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f53b9839000)
	libm.so.6 => /usr/lib/libm.so.6 (0x00007f53b96f3000)
	libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f53b96d8000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007f53b950c000)
	libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007f53b94d5000)
	libz.so.1 => /usr/lib/libz.so.1 (0x00007f53b94bb000)
	libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007f53b93e6000)
	libmd4c.so.0 => /usr/lib/libmd4c.so.0 (0x00007f53b93ce000)
	libsystemd.so.0 => /usr/lib/libsystemd.so.0 (0x00007f53b9309000)
	libdouble-conversion.so.3 => /usr/lib/libdouble-conversion.so.3 (0x00007f53b92f2000)
	libicui18n.so.69 => /usr/lib/libicui18n.so.69 (0x00007f53b8fcb000)
	libicuuc.so.69 => /usr/lib/libicuuc.so.69 (0x00007f53b8dd8000)
	libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f53b8dd1000)
	libpcre2-16.so.0 => /usr/lib/libpcre2-16.so.0 (0x00007f53b8d43000)
	libzstd.so.1 => /usr/lib/libzstd.so.1 (0x00007f53b8c34000)
	libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007f53b8aff000)
	/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f53bae1b000)
	libGLdispatch.so.0 => /usr/lib/libGLdispatch.so.0 (0x00007f53b8a47000)
	libGLX.so.0 => /usr/lib/libGLX.so.0 (0x00007f53b8a14000)
	libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007f53b893e000)
	libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007f53b8919000)
	librt.so.1 => /usr/lib/librt.so.1 (0x00007f53b890e000)
	liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f53b88e6000)
	liblz4.so.1 => /usr/lib/liblz4.so.1 (0x00007f53b88c3000)
	libcap.so.2 => /usr/lib/libcap.so.2 (0x00007f53b88b8000)
	libgcrypt.so.20 => /usr/lib/libgcrypt.so.20 (0x00007f53b8779000)
	libicudata.so.69 => /usr/lib/libicudata.so.69 (0x00007f53b6c20000)
	libpcre.so.1 => /usr/lib/libpcre.so.1 (0x00007f53b6ba9000)
	libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f53b6a68000)
	libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007f53b6a55000)
	libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x00007f53b6a2c000)
	libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f53b6a02000)
	libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f53b69fd000)
	libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f53b69f5000)

Code: Select all

#!/bin/bash

flag=0

while IFS=$'=' read key value
do
  case $key in
    cb1)
      if [ "$value" == "1" ]
      then
        echo Option 1 is checked
      else
        echo Option 1 is unchecked
      fi
      ;;
    txt1)
      echo Text entered: $value
      ;;
    okay)
      flag=1
      echo User clicked Ok pushbutton
      ;;
    cancel)
      flag=1
      echo User clicked Cancel pushbutton
      ;;
  esac
done < <(
dialogbox <<EODEMO
add label "<small>This script demonstrates unidirectional communication with the dialogbox application." note
set note stylesheet "qproperty-textInteractionFlags: NoTextInteraction;"
add separator
add checkbox "&Option 1" cb1
add textbox "&Text field" txt1 "text to edit"
add frame horizontal
add stretch
add pushbutton O&k okay apply exit
add pushbutton &Cancel cancel exit
end frame
set title "Demo 2"
set okay default
set cb1 focus
EODEMO
)

if [ "$flag" == "0" ]
then
  echo User closed the window
fi

exit 0

wiak

Attachments
demo2.png
demo2.png (40.82 KiB) Viewed 772 times

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

Post Reply

Return to “Programming”