XBoard GTK

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Look
Posts: 238
Joined: Thu Jun 05, 2014 12:14 pm
Location: Iran
Full name: Mehdi Amini
Contact:

XBoard GTK

Post by Look » Sat Nov 02, 2019 6:25 pm

Hi,

What is the version of GTK used in XBoard ?

Can I use Glade to add graphics to XBoard ?

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

Re: XBoard GTK

Post by hgm » Sat Nov 02, 2019 9:04 pm

Version 2, IIRC.

I don't know Glade. I suppose it is a tool for designing dialogs with GTK. XBoard does not use it; all its dialogs are generated dynamically from tables. It needed a routine to do that anyway for the Engine Settings dialogs, from the table of options it receives from the engine. I think Glade can only generate dialogs when their layout is known at compile time, so it could not be used for that. Once we had the routine that could generate dialogs from a table at run time, it became sort of trivial to also use it on similar tables for setting GUI options. (Although in the end we added some option types that UCI engines do not have, such as list boxes, canvases and plain text labels.)

I have no idea whether XBoard's current way of generating its dialogs conflicts with Glade or not.

I don't know well enough what you want to do to be able to give sensible advice. What kind of 'graphics' do you want to add?

Look
Posts: 238
Joined: Thu Jun 05, 2014 12:14 pm
Location: Iran
Full name: Mehdi Amini
Contact:

Re: XBoard GTK

Post by Look » Sun Nov 03, 2019 3:36 pm

hgm wrote:
Sat Nov 02, 2019 9:04 pm
Version 2, IIRC.

I don't know Glade. I suppose it is a tool for designing dialogs with GTK. XBoard does not use it; all its dialogs are generated dynamically from tables. It needed a routine to do that anyway for the Engine Settings dialogs, from the table of options it receives from the engine. I think Glade can only generate dialogs when their layout is known at compile time, so it could not be used for that. Once we had the routine that could generate dialogs from a table at run time, it became sort of trivial to also use it on similar tables for setting GUI options. (Although in the end we added some option types that UCI engines do not have, such as list boxes, canvases and plain text labels.)

I have no idea whether XBoard's current way of generating its dialogs conflicts with Glade or not.
I found this Internet page about Glade and GTK. I briefly read it , but I have to study more.
I don't know well enough what you want to do to be able to give sensible advice. What kind of 'graphics' do you want to add?
I remind you this thread. Basically adding "Replay analysis" to XBoard.

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

Re: XBoard GTK

Post by hgm » Sun Nov 03, 2019 5:30 pm

How does that need any new graphics? I thought it was just a matter of adding the played move(s) as a (parentheses-enclosed) 'comment' to the moves in training mode, as long as they differ from the move of the main line or from each other.

That would be a pure back-end change (and thus work in XBoard and WinBoard alike).

Look
Posts: 238
Joined: Thu Jun 05, 2014 12:14 pm
Location: Iran
Full name: Mehdi Amini
Contact:

Re: XBoard GTK

Post by Look » Mon Nov 04, 2019 11:30 am

hgm wrote:
Sun Nov 03, 2019 5:30 pm
How does that need any new graphics? I thought it was just a matter of adding the played move(s) as a (parentheses-enclosed) 'comment' to the moves in training mode, as long as they differ from the move of the main line or from each other.

That would be a pure back-end change (and thus work in XBoard and WinBoard alike).
Ability to have a timer , a button to set whole time and increment , a solution for opening moves and so on.

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

Re: XBoard GTK

Post by hgm » Mon Nov 04, 2019 11:46 am

I have no idea how timers play any role in 'replay analysis'. But Xboard already display two timers, and has a dialog to specify time control that allows you to enter base time and increment. (Not sure how you could do such a thing with a button, though.)

I also have no idea why opening moves need a 'solution', and what solution you have in mind.

Look
Posts: 238
Joined: Thu Jun 05, 2014 12:14 pm
Location: Iran
Full name: Mehdi Amini
Contact:

Re: XBoard GTK

Post by Look » Mon Nov 04, 2019 3:15 pm

hgm wrote:
Mon Nov 04, 2019 11:46 am
I have no idea how timers play any role in 'replay analysis'. But Xboard already display two timers, and has a dialog to specify time control that allows you to enter base time and increment. (Not sure how you could do such a thing with a button, though.)
For instance imagine user set the training timer to 30minutes+5seconds . This means user has to "replay training" (training mode in XBoard) a whole game in that time control. If you exceed time a message could be shown telling like: "You did not finish the game in time." . Also by button I meant , one with text "Set time" which brings user to a widow setting overall time and increment. More buttons could be added , which gives extra useful functionality to "training mode".
I also have no idea why opening moves need a 'solution', and what solution you have in mind.
The point of opening in "training mode" is that in Chess there are lots of strong opening. So unlike middle-game and end-game user can not easily guess what opening is played. ChessBase has radar feature. That shows position in several moves ahead of game. By looking at that hint , user can usually guess opening type and the moves.

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

Re: XBoard GTK

Post by hgm » Mon Nov 04, 2019 4:46 pm

Look wrote:
Mon Nov 04, 2019 3:15 pm
For instance imagine user set the training timer to 30minutes+5seconds . This means user has to "replay training" (training mode in XBoard) a whole game in that time control.
This is exactly what the XBoard clocks (which are permanently displayed) do in a normal game. You should just make the clocks run in training mode as well. This requires no new graphics.
If you exceed time a message could be shown telling like: "You did not finish the game in time." . Also by button I meant , one with text "Set time" which brings user to a widow setting overall time and increment. More buttons could be added , which gives extra useful functionality to "training mode".
Such 'buttons' that bring up dialog windows are normally called menus, and XBoard already has zillions of them. They are on the menu bar. The button you describe already exists, except that it is called "Time Control" rather than "Set Time". If that disgusts you, you could simply change the text on it.

A tiny detail is that the menus are two levels deep; if every minor and seldomly used feature would have its own button on the main menu bar, the main window would be 70% menu bar, leaving only 20% for the chess board...

BTW, adding extra menu items or main menus is rather simple: you just add them in the tables that describe the menus in menu.c (and provide a function for what you want them to do, to which the table refers). Again no need for touching the graphics code.

Messages like informing the user he exceeded his time are normally displayed in the 'message field' above the board. Or, if you want them to be more conspicuous, by an 'Error' or 'Note' popups. Again, the necessary dialog windows already exist. Just invoke them by calling DisplayNote() with the desired text as argument. The XBoard clocks normally display an exclamation point behind the time when the corresponding player flagged.
The point of opening in "training mode" is that in Chess there are lots of strong opening. So unlike middle-game and end-game user can not easily guess what opening is played. ChessBase has radar feature. That shows position in several moves ahead of game. By looking at that hint , user can usually guess opening type and the moves.
It would be in line with the existing functionality of XBoard to use a right mouse click on the board itself for that. When an engine is playing or analysing this would perform 'look-ahead' on the engine's latest PV. As Training Mode does not involve an engine to provide PVs, it would be logical to use it for look-ahead in the game itself. It doesn't require anything more than having the RightClick() handler function in backend.c detect the case, and having it call DrawPosition() with the desired move numbers for the press and the release.

Look
Posts: 238
Joined: Thu Jun 05, 2014 12:14 pm
Location: Iran
Full name: Mehdi Amini
Contact:

Re: XBoard GTK

Post by Look » Sat Nov 09, 2019 1:38 pm

I am trying to compile XBoard in Code::Blocks IDE . I used ./configure command to generate Makefile . Now trying a rebuild I get :

Code: Select all


-------------- Clean: all in xboard_fork (compiler: GNU GCC Compiler)---------------

Executing clean command: make -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile clean
Making clean in po
make[1]: Entering directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/po'
rm -f *.insert-header
rm -f remove-potcdate.sed
rm -f stamp-poT
rm -f core core.* xboard.po xboard.1po xboard.2po *.new.po
rm -fr *.o
make[1]: Leaving directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/po'
make[1]: Entering directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
test -z "xboard.dvi xboard.pdf xboard.ps xboard.html" \
|| rm -rf xboard.dvi xboard.pdf xboard.ps xboard.html
test -z "xboard" || rm -f xboard
rm -rf xboard.t2d xboard.t2p
rm -f *.o
rm -f gtk/*.o
rm -f xaw/*.o
rm -f vti.tmp* ./version.texi.tmp*
make[1]: Leaving directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
Cleaned "xboard_fork - all"

-------------- Build: all in xboard_fork (compiler: GNU GCC Compiler)---------------

Checking if target is up-to-date: make -q -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile all
Running command: make -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile all
make  all-recursive
make[1]: Entering directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
Making all in po
make[2]: Entering directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/po'
make[2]: Leaving directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/po'
make[2]: Entering directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
  CC       backend.o
  
Warning , and at the end :

Code: Select all

CC       gtk/xtimer.o
  CC       gtk/xengineoutput.o
  CCLD     xboard
make[2]: Leaving directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
make[1]: Leaving directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
Process terminated with status 0 (0 minute(s), 4 second(s))
0 error(s), 67 warning(s) (0 minute(s), 4 second(s))
 
What is the problem , as no executable is produced from rebuild.

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

Re: XBoard GTK

Post by hgm » Sat Nov 09, 2019 2:14 pm

That is strange, because it says "0 errors", and warnings alone should not prevent creation of an executable. And I don't see any warnings from the linking phase (CCLD). Are you sure you are lookig for it in the right place? Do you see all the .o files that are produced by the CC commands?

Post Reply