Is there a way to make Xboard stay in training mode?

Discussions about Winboard/Xboard. News about engines or programs to use with these GUIs (e.g. tournament managers or adapters) belong in this sub forum.

Moderator: Andres Valverde

Is there a way to make Xboard stay in training mode?

Postby Roman Hartmann » 12 Nov 2007, 11:19

Hi,
how can I force Xboard to stay in Training mode when loading the next game from a pgn-file?
I can load the first game with Training mode enabled but as soon as I load the next game I have to enable Training mode again. I'm under Linux and the shortcuts I created with .Xdefaults (and .Xresources) to bypass this problem don't work unfortunately.
Is there a way to make it stay in training mode?

Maybe it's more clear what I try to do if you see the command I'm already using:
Code: Select all
xboard -size small -noChessProgram True -mode Training -lgf /home/roman/Chess/polgar.pgn -lgi 306 -td -1

Works fine for the first game (or position) but Training mode is disabled if the next game is loaded ...

best regards
Roman

PS: I did not yet fumble around with the sources as there is certainly a way to make it behave like I would it to.
User avatar
Roman Hartmann
 
Posts: 155
Joined: 11 Oct 2004, 14:21

Re: Is there a way to make Xboard stay in training mode?

Postby H.G.Muller » 12 Nov 2007, 14:26

Roman Hartmann wrote:PS: I did not yet fumble around with the sources as there is certainly a way to make it behave like I would it to.

From the source it seems that loading a game (in backend.c, LoadGame()) will always do a Reset, which changes the mode to 'BeginningOfGame'. It does remember the oldGameMode, though. So at the end of this routine you would have tot test for this old mode being 'TrainingMode', and restore it (and call SetTrainingModeOn() to tailor the menu ) on leaving that function.

If you reach the end of a training game (in backed.c, UserMoveEvent()), it also swicthes off training mode, and ou might not wat that too.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Is there a way to make Xboard stay in training mode?

Postby Roman Hartmann » 12 Nov 2007, 19:18

Thanks for your information regarding the internals of xboard.
I did manipulate the sources in the meantime and now it fits my needs much better.
By diving in the sources I also spotted a little bug in xboard.c related to the training mode.

Code: Select all
...
    { "EditGameProc", EditGameProc },
    { "EditPositionProc", EditPositionProc },
    { "TrainingProc", EditPositionProc },
    { "ShowGameListProc", ShowGameListProc },
...

should be:
Code: Select all
    { "EditGameProc", EditGameProc },
    { "EditPositionProc", EditPositionProc },
    { "TrainingProc", TrainingProc },
    { "ShowGameListProc", ShowGameListProc }



Roman
User avatar
Roman Hartmann
 
Posts: 155
Joined: 11 Oct 2004, 14:21


Return to Winboard and related Topics

Who is online

Users browsing this forum: No registered users and 23 guests

cron