XBoard interactive help

Discussion of anything and everything relating to chess playing software and machines.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
User avatar
hgm
Posts: 23724
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

XBoard interactive help

Post by hgm » Thu Mar 10, 2016 11:40 am

I am experimenting with a new feature in XBoard, and would like to have some feedback from users to see if it is useful. The idea is to make XBoard's manual file more accessible. Almost noone takes the trouble to read manual files, and, quite frankly, XBoard as grown so extensive, and consequently its man page so long, that I cannot really blame them.

So the idea is to make right-clicking on the names of controls in menu dialogs, or on the menu items themselves, provide direct access to the relevant paragraph in the manual, displaying the text in a popup window. In the experimental implementation I just have it scan the manual file for a header line containing the same text as written next to the dialog control, and as the item headers in the manual usually equal the name of the control or menu item this already works for the majority of cases.

If we decide to go on with this it would just be a matter of re-writing the manual (organizing it more systematically) so that it works in all cases. A nice enhancement could be to apply the lookup of controls clicked in the Engine Settings dialogs in the manual page of the corresponding engine, rather than in XBoard's own manual page.

The XBoard version that does this can be found in the 'help' branch of my on-line source repository:

http://hgm.nubati.net/cgi-bin/gitweb.cg ... heads/help

Only the GTK build (which should be the default build in this version) does this.

styx
Posts: 338
Joined: Tue Mar 13, 2012 8:59 pm
Location: Germany

Re: XBoard interactive help

Post by styx » Fri Mar 11, 2016 12:35 am

12 hours ago H.G.Muller Suppress echo of password in ICS Chat window (GTK)
Is this the right commit? I'm not sure what to download and where to klick. Is the "snapshot" the right link?

If so, it's not working right for me. I downloaded it, compiled it and I cannot right-click in the menu for any help.

User avatar
hgm
Posts: 23724
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: XBoard interactive help

Post by hgm » Fri Mar 11, 2016 6:37 am

That is the right commit, and clicking 'snapshot' should indeed give you the tar ball. Right clicking should work on items in the menus, after you open those menus. And on the texts in menu dialogs that open after you clicked those menu items. Not on the menu names in the menu bar itself.

styx
Posts: 338
Joined: Tue Mar 13, 2012 8:59 pm
Location: Germany

Re: XBoard interactive help

Post by styx » Fri Mar 11, 2016 11:20 am

I did that: nothing happens after right clicking.

But I have to mention that I did not installed it. I just compiled it and started it out of the directory. There were other errors like "no pieces were showing". I had to manually set the SVG directory to display them.

User avatar
hgm
Posts: 23724
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: XBoard interactive help

Post by hgm » Fri Mar 11, 2016 12:09 pm

Ah, that could explain it! I programmed it such that when it cannot open the manual file (which it expects at /usr/local/share/man/man6/xboard.6 ), it does nothing at all. And if you never installed an XBoard from source before, there wouldn't be anything there. (Installing from the distro repositories would place the file at /usr/share/man/man6/xboard.6 .)

JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 12:23 am

Re: XBoard interactive help

Post by JoshPettus » Fri Mar 11, 2016 12:54 pm

I'm afraid it didn't work for me either :(

just a quick look at the code but I think it should be in dialog.c

Code: Select all

char *manFile = DATADIR "/../man/man6/xboard.6
not

Code: Select all

char *manFile = DATADIR "/../../man/man6/xboard.6
Based on where the DATADIR is located in the osx app. (I didn't think we made any changes to DATADIR for the app and based the internal structure on the linux install to simplify the build script.)


On the other hand, the ICS password worked great on GTK! (haven't tried XAW yet). Really minor thing is it still stores your password keystrokes in the history, so if you hit up arrow, it will be displayed.

User avatar
hgm
Posts: 23724
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: XBoard interactive help

Post by hgm » Fri Mar 11, 2016 1:18 pm

JoshPettus wrote:I'm afraid it didn't work for me either :(

just a quick look at the code but I think it should be in dialog.c

Code: Select all

char *manFile = DATADIR "/../man/man6/xboard.6
not

Code: Select all

char *manFile = DATADIR "/../../man/man6/xboard.6
Based on where the DATADIR is located in the osx app. (I didn't think we made any changes to DATADIR for the app and based it on the linux install to simplify the build script.)
DATADIR for me (installing from source) is /usr/local/share/games/xboard. So I have to use twice ".." to undo the xboard and the games, to be left with /usr/local/share, on which it then builds the /usr/local/share/man/man6/xboard.6 .

I agree that this was just an ugly hack, and that a proper solution would be to make $(mandir) available to XBoard during compiling as a preprocessor macro.

On the other hand, the ICS password worked great on GTK! (haven't tried XAW yet). Really minor thing is it still stores your password keystrokes in the history, so if you hit up arrow, it will be displayed.
Oops! I guess I should have EchoOn() also clear the last line from the command history.

JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 12:23 am

Re: XBoard interactive help

Post by JoshPettus » Fri Mar 11, 2016 1:28 pm

Ah, I guess I did change it somehow. I dropped the games folder. (not sure why now..) I guess I worked around it and didn't bite me until now..

User avatar
hgm
Posts: 23724
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: XBoard interactive help

Post by hgm » Fri Mar 11, 2016 1:40 pm

Well, I suppose we will have to find a ./configure solution for this. I think ./configure does set a 'mandir' variable; it would just be a matter of passing it to the compiler as -DMANDIR=$(mandir), and then using it in the source code.

What bites me is that Fairy-Max installs itself with a gzipped man file (fairymax.6.gz). Apparently the man command also understands that, but XBoard would have to unzip it first if it wants to consult it. So I guess I will switch to installing the manual as plain text.

It would be really nice if this help function would also work on the Engine Settings dialogs, by consulting the man files of the currently loaded engines.

I pushed a commit to fix the password recall, BTW.

JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 12:23 am

Re: XBoard interactive help

Post by JoshPettus » Fri Mar 11, 2016 1:44 pm

Why gziped? Is the man file really that large?

Post Reply