Page 1 of 1

Improvements and remodification on GTK+ and gtkdialog

Posted: Sat 01 Oct 2016, 07:25
by mistfire
Gtkdialog is good however the problem was there is no fixed-single a window (a window that has a close button only) and no window with title bar only. Not only that gtkdialog is poor on managing user control alignment and position but they are good in adjusting the position when the window changed size

Is there any hack to modify gtkdialog in order to create a form with a close button only o no close button at all? And also to add alignments on user controls?

Posted: Sat 01 Oct 2016, 14:24
by B.K. Johnson
I'm not sure you are using "form" and "window" interchangeably. That said, you can obtain a window without a button using the no-buttons command. I have not tried it in a form.

Posted: Sat 01 Oct 2016, 15:44
by zigbert
B.K. Johnson wrote:I'm not sure you are using "form" and "window" interchangeably. That said, you can obtain a window without a button using the no-buttons command. I have not tried it in a form.
Can you specify this...?

Posted: Sat 01 Oct 2016, 16:16
by B.K. Johnson
@zigbert
I erred. :oops: It was not gtk, but yad I was thinking of. Like this:

Code: Select all

yad --title="Yad Message Box" --width=200 --height=150 --fixed --text="center" --skip-taskbar --window-icon="gtk-dialog-info" \
--text="<big><b>
This is a Yad message box
</b></big>" --no-buttons --timeout="3" 

Posted: Sat 01 Oct 2016, 21:56
by mistfire
@B.K. Johnson forms and window are the same and interchangable. The buttons that I talked about was the control buttons (minimize, maximize and close)

@zigbert are you in charge in Gtkdialog here in puppy?

It is possible to produce a Gtkdialog windows like these (take a look at the title bars)?

Message box
Image

Dialog Window
Image

No Control Buttons on title bar
Image

Re: Improvements and remodification on GTK+ and gtkdialog

Posted: Sun 02 Oct 2016, 02:10
by Geoffrey
mistfire wrote:Gtkdialog is good however the problem was there is no fixed-single a window (a window that has a close button only) and no window with title bar only. Not only that gtkdialog is poor on managing user control alignment and position but they are good in adjusting the position when the window changed size

Is there any hack to modify gtkdialog in order to create a form with a close button only o no close button at all? And also to add alignments on user controls?

Code: Select all

<window resizable="false" skip_taskbar_hint="true" decorated="true">

Code: Select all

export MAIN_DIALOG='
<window icon-name="gtk-info" resizable="false" skip_taskbar_hint="true" decorated="true">
	<vbox>
	<hbox>
	<pixmap><input file stock="gtk-info"></input></pixmap> 
	<text><label>Do you really want to continue?</label></text>
	</hbox>
	<hbox homogeneous="true">
	<button ok></button>
	</hbox>
	</vbox>
</window>'

gtkdialog --program=MAIN_DIALOG

Posted: Sun 02 Oct 2016, 04:10
by ebisu
Geoffrey, what window manager are you using? JWM shows all control buttons.

Posted: Sun 02 Oct 2016, 05:06
by Geoffrey
ebisu wrote:Geoffrey, what window manager are you using? JWM shows all control buttons.
XFCE, ah ok, the theme might be a problem too.

Posted: Sun 02 Oct 2016, 08:37
by zigbert
mistfire wrote:@zigbert are you in charge in Gtkdialog here in puppy?
No, I don't think we have anyone in charge here. The gtkdialog code is moved to github
mistfire wrote:It is possible to produce a Gtkdialog windows like these (take a look at the title bars)?
Will you please show some example code? It would be great to learn this.

Re: Improvements and remodification on GTK+ and gtkdialog

Posted: Sun 02 Oct 2016, 08:42
by zigbert
Geoffrey wrote:

Code: Select all

<window resizable="false" skip_taskbar_hint="true" decorated="true">
I can't see any option describing buttons in the titlebar

skip_taskbar_hint="true" : Show app in the taskbar
decorated="true" : Show window decoration
resizable="false" : Do not allow user to resize the window

Re: Improvements and remodification on GTK+ and gtkdialog

Posted: Sun 02 Oct 2016, 09:27
by Geoffrey
zigbert wrote:I can't see any option describing buttons in the titlebar
Works with XFCE as it controls the decoration layout, if the window skips the taskbar then minimized icon is not shown,
like wise for the maximize button if the window can't be resized, it's dependent on the features of the WM.

Re: Improvements and remodification on GTK+ and gtkdialog

Posted: Sun 02 Oct 2016, 11:31
by ebisu
Geoffrey wrote:Works with XFCE as it controls the decoration layout, if the window skips the taskbar then minimized icon is not shown, like wise for the maximize button if the window can't be resized, it's dependent on the features of the WM.
It should primarily be dependent on the instructions of the application. Gtkdialog's skip_taskbar_hint="true" sets_NET_WM_STATE(ATOM) = _NET_WM_STATE_SKIP_TASKBAR and the WM skips the taskbar. If gtkdialog also wants to skip the minimize button and all other ways to minimize it should tell this to the WM and should not include _NET_WM_ACTION_MINIMIZE in the list of allowed actions, however gtkdialog does. It is not the job of the WM to interpret "skip taskbar" as "no minimize button" if the application allows _NET_WM_ACTION_MINIMIZE.

Geany does it better. Most dialogs skip the taskbar and show no minimize button. If you run xprop to check the window properties you can see that _NET_WM_ACTION_MINIMIZE is not in the list of allowed actions.

Re: Improvements and remodification on GTK+ and gtkdialog

Posted: Sun 02 Oct 2016, 20:31
by Geoffrey
@ebisu,

I installed slacko-6.3.2-uefi.iso to try jwm, the result I got was that all the buttons appeared and selecting the maximize sent
the gui to the top left of the screen with a reduced size, showing half of the OK button, selecting the minimized resulted in the gui disappearing from screen.

I don't normally use jwm, so I'm unfamiliar with it's settings, but it does seem to be the culprit.
X-Slacko 4.2 based on slacko-6.3.2 (32bit) works fine displaying decoration.

Posted: Mon 03 Oct 2016, 05:03
by MochiMoppel
JWM's inability to maximize is the only fault I can find. I'm sure that it wasn't a priority to create window options when developing gtkdialog. Gtkdialog still lacks much more important features (and btw: YAD can't hide control buttons either), but it should be possible to add those features for anyone determined and able enough.

There is a work around when using JWM2.3. Newly introduced group options allow to suppress minimize,maximize and close functionality which also prevents the corresponding control buttons.

If this is not desirable for every gtkdialog then a unique window name should be set so that JWM's group filter can identify the dialog, e.g.

Code: Select all

gtkdialog --name=GtkNoButtons --program=MAIN_DIALOG
The group setting could look like this:

Code: Select all

<Group>
	<Name>GtkNoButtons</Name>
	<Option>nomin</Option>
	<Option>nomax</Option>
	<Option>noclose</Option>
</Group>
The result is very user-friendly. I like it when a dialog provides unambiguous choices: