This page is about Xaw client
First, small part of doc/HACKING: (written so long ago, I think)
Client GUI - Athena
One client GUI is written using athena-widgets. A few comments on this could prove useful for anyone wishing to write new dialogs or improve on the current ones.
When you create new widgets for a dialog, like:
players_form = XtVaCreateManagedWidget("playersform", formWidgetClass, players_dialog_shell, NULL);
then put the widget properties in the app-default file 'Freeciv', instead of hardcoding them. For the widget created above, the following entries in the app-default file applies:
*playersform.background: lightblue *playersform.resizable: true *playersform.top: chainTop *playersform.bottom: chainBottom *playersform.left: chainLeft *playersform.right: chainRight
Pixcomm and Canvas:
The Pixcomm is a subclassed Command-widget, which can displays a Pixmap instead of a string, on top of a button(command). The Pixcomm widget should be used all places where this kind of high-level functionality is required.
The Canvas widget is more low-level. One have to write an expose(redraw) event-handler for each widget. The widget generates events on resize and mousebuttons.
[Reading any Xt documentation, will tell you how powerful widget
subclassing is. So I went trough great troubles subclassing the
command widget. It was not before long I got mails from unhappy Xaw3d
(and derives) users, that the client keeps crashing on them. Turns
out that subclassing from any widgets but Core, chains the new
widgets to libXaw. In hindsight I should just subclassed the Canvas
widget and add more highlevel functionality. -PU]
Some notes: 1. app-default 'Freeciv' file contains lines like
2. Since Vasco wrote multibyte charset support for Xaw client, it is interesting, can we use an entry
and what we have to write here? (Before, it was 'Freeciv*playersformlabel.font: 6x13')
Two things I (evyscr) am trying to do now:
- 1. Understand the Xaw client code
- 2. Make some standards (like common dialog model)
And, of course, there should be main goal: to make Xaw client better.
Xaw client code traveler letters
Once I found, that closing the 'Wonders of the World' report by window manager (x) button is a trying to close whole civclient. To fix this I deep into freeciv code.
Letter 1: Modal and non-modal windows
All dialog shells now are of two classes: 'transientShellWidgetClass' or 'topLevelShellWidgetClass'.
transientShellWidgetClass will create modal window (which deactivate main_window). topLevelShellWidgetClass will create, heh, top-level window (without deactivating of main_window).
Several dialogs have 'raise' or 'make_modal' parameter, which determines, what class will be the window. (I think, that all dialogs should have this parameter).
All these things are usually in create_<dialog-name>_dialog funtion.
If window is modal, than in popup_<dialog-name>_dialog should be next line:
(I place it just after creating the dialog_shell)
And if window is modal, there should be next in popdown_<dialog-name>_dialog:
Now I don't know, which way is better.