From: H.G. Muller Date: Thu, 21 Apr 2011 20:37:56 +0000 (+0200) Subject: Add callback possibility to combobox selection X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=70fcaa9016951f1a0c6f63e62846cb411be48b76;hp=5bd571321c23608ce3f07bf523a8bbf2ddda2210;p=xboard.git Add callback possibility to combobox selection --- diff --git a/xoptions.c b/xoptions.c index a5aac22..2ca6c3b 100644 --- a/xoptions.c +++ b/xoptions.c @@ -602,10 +602,13 @@ void TimeControlProc(w, event, prms, nprms) //--------------------------- Engine-specific options menu ---------------------------------- +typedef void ButtonCallback(int n); + int values[MAX_OPTIONS]; ChessProgramState *currentCps; static Option *currentOption; static Boolean browserUp; +ButtonCallback *comboCallback; void CheckCallback(Widget ww, XtPointer data, XEvent *event, Boolean *b) { @@ -677,6 +680,8 @@ void ComboSelect(w, addr, index) // callback for all combo items values[i] = j; // store in temporary, for transfer at OK XtSetArg(args[0], XtNlabel, _(((char**)currentOption[i].textValue)[j])); XtSetValues(currentOption[i].handle, args, 1); + + if(currentOption[i].min & 1 && !currentCps && comboCallback) (comboCallback)(i); } void CreateComboPopup(parent, name, n, mb) @@ -710,8 +715,6 @@ void CreateComboPopup(parent, name, n, mb) // cloned from Engine Settings dialog (and later merged with it) -typedef void ButtonCallback(int n); - extern WindowPlacement wpComment, wpTags; char *trialSound; static int oldCores, oldPonder;