From owner-freebsd-bugs Thu Jul 30 14:00:07 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA22067 for freebsd-bugs-outgoing; Thu, 30 Jul 1998 14:00:07 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA21986 for ; Thu, 30 Jul 1998 14:00:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id OAA17920; Thu, 30 Jul 1998 14:00:00 -0700 (PDT) Received: from tim.xenologics.com (tim.xenologics.com [194.77.5.24]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA20150 for ; Thu, 30 Jul 1998 13:53:14 -0700 (PDT) (envelope-from seggers@semyam.dinoco.de) Received: (from uucp@localhost) by tim.xenologics.com (8.8.5/8.8.8) with UUCP id WAA29878 for FreeBSD-gnats-submit@freebsd.org; Thu, 30 Jul 1998 22:51:03 +0200 (MET DST) Received: (from seggers@localhost) by semyam.dinoco.de (8.8.8/8.8.8) id WAA12487; Thu, 30 Jul 1998 22:45:32 +0200 (CEST) (envelope-from seggers) Message-Id: <199807302045.WAA12487@semyam.dinoco.de> Date: Thu, 30 Jul 1998 22:45:32 +0200 (CEST) From: Stefan Eggers Reply-To: seggers@semyam.dinoco.de To: FreeBSD-gnats-submit@FreeBSD.ORG Cc: seggers@semyam.dinoco.de X-Send-Pr-Version: 3.2 Subject: bin/7453: libdialog: small change to DITEM_RECREATE behavior Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 7453 >Category: bin >Synopsis: libdialog: small change to DITEM_RECREATE behavior >Confidential: no >Severity: non-critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Jul 30 14:00:00 PDT 1998 >Last-Modified: >Originator: Stefan Eggers >Organization: none >Release: FreeBSD 3.0-CURRENT i386 >Environment: -current from a few days ago. >Description: When using a checkbox a DITEM_RECREATE from a fire callback caused the values of choice and scroll to be set back to 0. This resulted in the user getting to the top of the list. This behavior conflicts with what I intend to do with my changes to sysinstall which introduce display of which packages get added as a dependency. See the separate PR. The most simple change is making checkboxes behave a little bit different now. They retain the old position - nothing else gets changed in the logic. The only alternative I see is changing the includes files and add a flag similar to DITEM_RECREATE but retaining the old position. If that is the prefered solution to this interface problem I will make patches for that, too. >How-To-Repeat: Just try the sysinstall patches w/o this patch. It's very annoying to use anything having a dependency! >Fix: Index: checklist.c =================================================================== RCS file: /usr2/FreeBSD/CVSROOT/src/gnu/lib/libdialog/checklist.c,v retrieving revision 1.33 diff -u -r1.33 checklist.c --- checklist.c 1997/10/12 12:09:45 1.33 +++ checklist.c 1998/07/30 20:35:25 @@ -45,6 +45,7 @@ unsigned char **items = NULL; dialogMenuItem *ditems; int list_width, check_x, item_x; + int remember_position, remember_choice, remember_scroll; /* Allocate space for storing item on/off status */ if ((status = alloca(sizeof(int) * abs(cnt))) == NULL) { @@ -53,8 +54,17 @@ exit(-1); } + remember_position = 0; + remember_choice = 0; /* avoid useless warnings from compiler */ + remember_scroll = 0; /* avoid useless warnings from compiler */ draw: choice = scroll = button = 0; + if (remember_position) + { + remember_position = 0; + choice = remember_choice; + scroll = remember_scroll; + } /* Previous calling syntax, e.g. just a list of strings? */ if (cnt >= 0) { items = it; @@ -349,6 +359,9 @@ break; } else if (st & DITEM_RECREATE) { + remember_position = 1; + remember_choice = choice; + remember_scroll = scroll; delwin(list); delwin(dialog); dialog_clear(); >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message