From fd137f5c6464e66277c5e427c6cebca1b6527fd8 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Thu, 18 Oct 2012 21:57:50 +0200 Subject: [PATCH] Add access routines to checkboxes and FocusOnWidget The handler of the filter field needs it to return focus to the listbox. --- xoptions.c | 17 +++++------------ 1 files changed, 5 insertions(+), 12 deletions(-) diff --git a/xoptions.c b/xoptions.c index 928d28d..2043e40 100644 --- a/xoptions.c +++ b/xoptions.c @@ -232,21 +232,13 @@ SetWidgetText (Option *opt, char *buf, int n) void GetWidgetState (Option *opt, int *state) { -#ifdef TODO_GTK - Arg arg; - XtSetArg(arg, XtNstate, state); - XtGetValues(opt->handle, &arg, 1); -#endif + *state = gtk_toggle_button_get_active(opt->handle); } void SetWidgetState (Option *opt, int state) { -#ifdef TODO_GTK - Arg arg; - XtSetArg(arg, XtNstate, state); - XtSetValues(opt->handle, &arg, 1); -#endif + gtk_toggle_button_set_active(opt->handle, state); } void @@ -346,6 +338,7 @@ FocusOnWidget (Option *opt, DialogClass dlg) #ifdef TODO_GTK XtSetKeyboardFocus(shells[dlg], opt->handle); #endif + gtk_widget_grab_focus(opt->handle); } void @@ -604,8 +597,8 @@ void AddHandler (Option *opt, DialogClass dlg, int nr) { switch(nr) { - case 0: - case 1: + case 0: // history (now uses generic textview callback) + case 1: // comment (likewise) case 2: break; case 3: // input box g_signal_connect(opt->handle, "key-press-event", G_CALLBACK (ICSKeyEvent), NULL); break; // Input Box -- 1.7.0.4