How to add an extra-button to Xdialog GUI? (Solved by using pupdialog instead)
Moderator: Forum moderators
- taersh
- Posts: 951
- Joined: Tue Jul 07, 2020 11:13 pm
- Location: Germany
- Has thanked: 53 times
- Been thanked: 120 times
How to add an extra-button to Xdialog GUI? (Solved by using pupdialog instead)
I'm trying to get a Xdialog GUI to have 3 buttons. Xdialog has options --extra-button and --extra-label, but I can't get the 3rd button to show up within the gui. Using --yesno gives only 2 buttons, using --msgbox gives only 1 button, using --infobox closes the GUI immediately.
Is option --extra-button deprecated without mentioning it in the help output?
My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!
- fredx181
- Posts: 3387
- Joined: Tue Dec 03, 2019 1:49 pm
- Location: holland
- Has thanked: 438 times
- Been thanked: 1485 times
- Contact:
Re: Xdialog option --extra-button
dialog has that, not Xdialog AFAIKtaersh wrote:Xdialog has options --extra-button and --extra-label
Fred
- taersh
- Posts: 951
- Joined: Tue Jul 07, 2020 11:13 pm
- Location: Germany
- Has thanked: 53 times
- Been thanked: 120 times
Re: Xdialog option --extra-button
Xdialog v2.3.1 by Thierry Godefroy <xdialog@free.fr> (v1.0 was
written by Alfred at Cyberone Internet <alfred@cyberone.com.au>).
Xdialog home page available at: http://xdialog.dyns.net/
Usage: Xdialog [<common options>] [<transient options>] <box option> ...
Common options:
--wmclass <name>
--rc-file <gtkrc filename>
--backtitle <backtitle>
--title <title>
--allow-close | --no-close
--screen-center | --under-mouse | --auto-placement
--center | --right | --left | --fill
--no-wrap | --wrap
--cr-wrap | --no-cr-wrap
--stderr | --stdout
--separator <character> | --separate-output
--buttons-style default|icon|text
Transient options:
--fixed-font
--password (may be repeated 2 or 3 times before --2inputsbox or --3inputsbox)
--password=1|2 (for --2inputsbox or --3inputsbox)
--editable
--time-stamp | --date-stamp
--reverse
--keep-colors
--interval <timeout>
--timeout <timeout> (in seconds)
--no-tags
--item-help (if used, the {...} parameters are needed in menus/lists widgets)
--default-item <tag>
--icon <xpm filename>
--no-ok
--no-cancel
--no-buttons
--default-no
--wizard
--help <help>
--print <printer> (1)
--check <label> [<status>]
--ok-label <label>
--cancel-label <label>
--extra-button
--extra-label <label>
--beep
--beep-after
--begin <Yorg> <Xorg>
--ignore-eof
--smooth
Box options:
--yesno <text> <height> <width>
--msgbox <text> <height> <width>
--infobox <text> <height> <width> [<timeout>]
--gauge <text> <height> <width> [<percent>]
--progress <text> <height> <width> [<maxdots> [[-]<msglen>]]
--inputbox <text> <height> <width> [<init>]
--2inputsbox <text> <height> <width> <label1> <init1> <label2> <init2>
--3inputsbox <text> <height> <width> <label1> <init1> <label2> <init2> <label3> <init3>
--combobox <text> <height> <width> <item1> ... <itemN>
--rangebox <text> <height> <width> <min value> <max value> [<default value>]
--2rangesbox <text> <height> <width> <label1> <min1> <max1> <def1> <label2> <min2> <max2> <def2>
--3rangesbox <text> <height> <width> <label1> <min1> <max1> <def1> ... <label3> <min3> <max3> <def3>
--spinbox <text> <height> <width> <min value> <max value> <default value> <label>
--2spinsbox <text> <height> <width> <min1> <max1> <def1> <label1> <min2> <max2> <def2> <label2>
--3spinsbox <text> <height> <width> <min1> <max1> <def1> <label1> ... <min3> <max3> <def3> <label3>
--textbox <file> <height> <width>
--editbox <file> <height> <width>
--tailbox <file> <height> <width>
--logbox <file> <height> <width>
--menubox <text> <height> <width> <menu height> <tag1> <item1> {<help1>}...
--checklist <text> <height> <width> <list height> <tag1> <item1> <status1> {<help1>}...
--radiolist <text> <height> <width> <list height> <tag1> <item1> <status1> {<help1>}...
--buildlist <text> <height> <width> <list height> <tag1> <item1> <status1> {<help1>}...
--treeview <text> <height> <width> <list height> <tag1> <item1> <status1> <item_depth1> {<help1>}...
--fselect <file> <height> <width>
--dselect <directory> <height> <width>
--colorsel <text> <height> <width> [<red> <green> <blue>]
--fontsel <font name> <height> <width>
--calendar <text> <height> <width> [<day> <month> <year>]
--timebox <text> <height> <width> [<hours> <minutes> <seconds>]
Special options:
--version (prints version number to stderr and exits).
--print-version (same as above in a cdialog-compatible way).
--print-maxsize (prints maximum menu size in characters and exits).
Note that <height> and <width> are in characters and may be replaced by a single
XSIZExYSIZE[+/-XORG+/-YORG] parameter (like the one passed in the -geometry option
of X) which will represent the size of the Xdialog window in pixels. Specifying
a size of 0 0 (or 0x0) will auto-size Xdialog, while a size of -1 -1 (or -1x-1)
will maximize it.
(1) This Xdialog binary compiled with: lpr -P<printer>
as the print command. If <printer> is "" (an empty string), the -P
option is not used.
My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!
- MochiMoppel
- Posts: 1343
- Joined: Mon Jun 15, 2020 6:25 am
- Location: Japan
- Has thanked: 22 times
- Been thanked: 521 times
Re: How to add an extra-button to Xdialog GUI?
My help output for v2.3.1 does not mention --extra-button, otherwise looks the same as yours. Not mentioned in the documentation either.taersh wrote: Sat Oct 03, 2020 9:35 pmIs option --extra-button deprecated without mentioning it in the help output?
Fred is right. It's an option in dialog, not Xdialog. Don't know why you get this output.
This works for dialog when run from console:
dialog --extra-button --yesno "hello" 0 0
Try to add 'X' and see if it works. Does nothing for me.
- taersh
- Posts: 951
- Joined: Tue Jul 07, 2020 11:13 pm
- Location: Germany
- Has thanked: 53 times
- Been thanked: 120 times
Re: How to add an extra-button to Xdialog GUI?
Works good, does what I need.
My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!
- wiak
- Posts: 4311
- Joined: Tue Dec 03, 2019 6:10 am
- Location: Packing - big job
- Has thanked: 70 times
- Been thanked: 1296 times
- Contact:
Re: How to add an extra-button to Xdialog GUI?
http://murga-linux.com/puppy/viewtopic. ... c72#499840
Above link is referred to in pupdialog by BarryK here:
https://bkhome.org/archive/blog2/201109 ... ith-x.html
Using gtkdialog solutions is surely over-the-top bloated for simple few buttons scenarios though? Of course, relying on patched Xdialog is not useful for anyone using non-patched Xdialog, so maybe pupdialog is the way to go (especially if it does fall back to using straight dialog when no X?) and, on second thoughts, I guess 'bloat' is relative - nowadays, that level of bloat (introduced by gtkdialog) is probably insignificant but the question would be: 'does gtkdialog itself have a future?'.
https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;
- MochiMoppel
- Posts: 1343
- Joined: Mon Jun 15, 2020 6:25 am
- Location: Japan
- Has thanked: 22 times
- Been thanked: 521 times
Re: How to add an extra-button to Xdialog GUI?
The patched version as linked by wiak and included in fossapup64 does work with certain Xdialog boxes, e.g. --inputboxtaersh wrote: Sat Oct 03, 2020 9:35 pmI'm trying to get a Xdialog GUI to have 3 buttons. Xdialog has options --extra-button and --extra-label, but I can't get the 3rd button to show up within the gui. Using --yesno gives only 2 buttons, using --msgbox gives only 1 button, using --infobox closes the GUI immediately.
- taersh
- Posts: 951
- Joined: Tue Jul 07, 2020 11:13 pm
- Location: Germany
- Has thanked: 53 times
- Been thanked: 120 times
Re: How to add an extra-button to Xdialog GUI?
Pupdialog does what I need and it's in all Puppies by default.
Also I don't want to argue if gtkdialog has a future, as this to answer is probably beyond my future.

Gtkdialog being bloated?

Really, what kind of computer are you running?
64Kb RAM?

My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!
- MochiMoppel
- Posts: 1343
- Joined: Mon Jun 15, 2020 6:25 am
- Location: Japan
- Has thanked: 22 times
- Been thanked: 521 times
Re: How to add an extra-button to Xdialog GUI?
Maybe you should tell us what you need it for. Pupdialog has very limited options and even crashes when --extra-button is used with --inputbox. Hardly a substitute for Xdialog.Pupdialog does what I need and it's in all Puppies by default.
- 01micko
- Posts: 135
- Joined: Mon Jul 13, 2020 4:08 am
- Location: Qld
- Has thanked: 5 times
- Been thanked: 66 times
- Contact:
Re: How to add an extra-button to Xdialog GUI?
Well I made a patch for @jamesbond to consider for his Xdialog chiselapp repo
The latest Xdialog source tarball is at the FatDog repo so if you're feeling adventurous you grab that, apply the following attached diff and compile it. Works with all the tests in the source code.
Code: Select all
Xdialog --extra-button --extra-label "foo" --ok-label "bar" --cancel-label "baz" --yesno 'Who do you want to be? Foo, Bar or Baz?' 0 0
- Attachments
-
- Xdialog-exbtn-yesno.diff.gz
- (517 Bytes) Downloaded 53 times
- taersh
- Posts: 951
- Joined: Tue Jul 07, 2020 11:13 pm
- Location: Germany
- Has thanked: 53 times
- Been thanked: 120 times
Re: How to add an extra-button to Xdialog GUI?
I just need the three buttons with --yesno to make a selection like in the patched Xdialog example at the above post.MochiMoppel wrote: Mon Oct 05, 2020 3:40 amMaybe you should tell us what you need it for. Pupdialog has very limited options and even crashes when --extra-button is used with --inputbox. Hardly a substitute for Xdialog.Pupdialog does what I need and it's in all Puppies by default.
For more complex stuff like --inputbox etc.pp. I'm using gtkdialog directly.
My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!
-
- Posts: 721
- Joined: Tue Aug 11, 2020 3:02 pm
- Location: The Pale Blue Dot
- Has thanked: 125 times
- Been thanked: 409 times
Re: How to add an extra-button to Xdialog GUI? (Solved by using pupdialog instead)
I did it slightly differently.
Here's the patch that gets committed.
The updated source is dated 2020.10 and is available from here or you can clone it from chiselapp.com as 01micko pointed out earlier.
Thanks again 01micko for the pointer.
Code: Select all
Index: src/interface.c
==================================================================
--- src/interface.c
+++ src/interface.c
@@ -774,10 +774,12 @@
if (Xdialog.cancel_button)
set_button(CANCEL , hbuttonbox, 1, FALSE);
set_button(NEXT, hbuttonbox, 0, TRUE);
} else {
set_button(YES, hbuttonbox, 0, !Xdialog.default_no);
+ if (Xdialog.extra_button)
+ set_button(EXTRA, hbuttonbox, 5, FALSE);
button = set_button(NO , hbuttonbox, 1, Xdialog.default_no);
if (Xdialog.default_no)
gtk_widget_grab_focus(button);
}
} else
- Attachments
-
- xdialog-extra-button.patch.gz
- (287 Bytes) Downloaded 63 times