From 70fcaa9016951f1a0c6f63e62846cb411be48b76 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Thu, 21 Apr 2011 22:37:56 +0200 Subject: [PATCH] Add callback possibility to combobox selection --- xoptions.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) 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; -- 1.7.0.4