Re: [Freeciv-Dev] [patch] GUI-independant option code
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Sune Kirkeby <sune@xxxxxxxxxxxxx> wrote:
> Here is a patch that takes the (client) option list out of the
> gui-* directories, so new options only have to be added in
> one place. Note that new options still have to be added in
> data/Freeciv, I guess it would be possible to be a little
> clever about this and and modify the X resources (that is what
> they are right?) at run or compile time, but one thing at a time.
> Also the patch changes the names of
> the option*label and opiton*toggle resources in data/Freeciv
> to be the same as in the code, this allows the Xaw GUI to
> runtime get the resources names, instead of using some form
> of hardcoded lookup table. Does that cause troubles anywhere?
In similar cases elsewhere (eg, the messages options, city report
config, city options) the approach has been to not use data/Freeciv
(or not so much), and do things dynamically in code, eg:
(in gui-xaw/messagedlg.c)
label = XtVaCreateManagedWidget("label",
labelWidgetClass,
is_col1?col1:col2,
XtNlabel, message_text[sorted[i]],
XtNfromVert, top_line?
is_col1?colhead1:colhead2:last_label,
NULL);
This approach departs from the idea of "everything configurable
via data/Freeciv", but I don't think that's very often used
(or in some aspects practical), and I think its preferable to
have "one place to add/change options".
(Note: I've checked in the patch in its current form; this is
discussion for any future changes.)
Regards,
-- David
|
|