~ubuntu-branches/ubuntu/wily/tk8.6/wily

« back to all changes in this revision

Viewing changes to generic/tkListbox.c

  • Committer: Package Import Robot
  • Author(s): Sergei Golovan
  • Date: 2013-10-05 11:59:47 UTC
  • mfrom: (8.1.5 experimental)
  • Revision ID: package-import@ubuntu.com-20131005115947-fuy2i0zetr6iuyn3
Added the libtk8.6-dbg package with libtk8.6 debug symbols in it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
392
392
                            Tcl_Obj *const objv[], int index);
393
393
static int              ListboxDeleteSubCmd(Listbox *listPtr,
394
394
                            int first, int last);
395
 
static void             DestroyListbox(char *memPtr);
 
395
static void             DestroyListbox(void *memPtr);
396
396
static void             DestroyListboxOptionTables(ClientData clientData,
397
397
                            Tcl_Interp *interp);
398
398
static void             DisplayListbox(ClientData clientData);
1428
1428
 
1429
1429
static void
1430
1430
DestroyListbox(
1431
 
    char *memPtr)               /* Info about listbox widget. */
 
1431
    void *memPtr)               /* Info about listbox widget. */
1432
1432
{
1433
 
    register Listbox *listPtr = (Listbox *) memPtr;
 
1433
    register Listbox *listPtr = memPtr;
1434
1434
    Tcl_HashEntry *entry;
1435
1435
    Tcl_HashSearch search;
1436
1436
 
1444
1444
    }
1445
1445
 
1446
1446
    if (listPtr->listVarName != NULL) {
1447
 
        Tcl_UntraceVar(listPtr->interp, listPtr->listVarName,
 
1447
        Tcl_UntraceVar2(listPtr->interp, listPtr->listVarName, NULL,
1448
1448
                TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
1449
1449
                ListboxListVarProc, listPtr);
1450
1450
    }
1552
1552
 
1553
1553
    oldExport = listPtr->exportSelection;
1554
1554
    if (listPtr->listVarName != NULL) {
1555
 
        Tcl_UntraceVar(interp, listPtr->listVarName,
 
1555
        Tcl_UntraceVar2(interp, listPtr->listVarName, NULL,
1556
1556
                TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
1557
1557
                ListboxListVarProc, listPtr);
1558
1558
    }
1629
1629
                if (Tcl_SetVar2Ex(interp, listPtr->listVarName, NULL,
1630
1630
                        listVarObj, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG)
1631
1631
                        == NULL) {
1632
 
                    if (oldListObj == NULL) {
1633
 
                        Tcl_DecrRefCount(listVarObj);
1634
 
                    }
1635
1632
                    continue;
1636
1633
                }
1637
1634
            }
1648
1645
            }
1649
1646
 
1650
1647
            listPtr->listObj = listVarObj;
1651
 
            Tcl_TraceVar(listPtr->interp, listPtr->listVarName,
1652
 
                    TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
 
1648
            Tcl_TraceVar2(listPtr->interp, listPtr->listVarName,
 
1649
                    NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
1653
1650
                    ListboxListVarProc, listPtr);
1654
1651
        } else if (listPtr->listObj == NULL) {
1655
1652
            listPtr->listObj = Tcl_NewObj();
2601
2598
            if (listPtr->flags & REDRAW_PENDING) {
2602
2599
                Tcl_CancelIdleCall(DisplayListbox, clientData);
2603
2600
            }
2604
 
            Tcl_EventuallyFree(clientData, DestroyListbox);
 
2601
            Tcl_EventuallyFree(clientData, (Tcl_FreeProc *) DestroyListbox);
2605
2602
        }
2606
2603
    } else if (eventPtr->type == ConfigureNotify) {
2607
2604
        int vertSpace;
3244
3241
    double first, last;
3245
3242
    int result;
3246
3243
    Tcl_Interp *interp;
 
3244
    Tcl_DString buf;
3247
3245
 
3248
3246
    if (listPtr->yScrollCmd == NULL) {
3249
3247
        return;
3269
3267
 
3270
3268
    interp = listPtr->interp;
3271
3269
    Tcl_Preserve(interp);
3272
 
    result = Tcl_VarEval(interp, listPtr->yScrollCmd, " ", firstStr, " ",
3273
 
            lastStr, NULL);
 
3270
    Tcl_DStringInit(&buf);
 
3271
    Tcl_DStringAppend(&buf, listPtr->yScrollCmd, -1);
 
3272
    Tcl_DStringAppend(&buf, " ", -1);
 
3273
    Tcl_DStringAppend(&buf, firstStr, -1);
 
3274
    Tcl_DStringAppend(&buf, " ", -1);
 
3275
    Tcl_DStringAppend(&buf, lastStr, -1);
 
3276
    result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
 
3277
    Tcl_DStringFree(&buf);
3274
3278
    if (result != TCL_OK) {
3275
3279
        Tcl_AddErrorInfo(interp,
3276
3280
                "\n    (vertical scrolling command executed by listbox)");
3307
3311
    int result, windowWidth;
3308
3312
    double first, last;
3309
3313
    Tcl_Interp *interp;
 
3314
    Tcl_DString buf;
3310
3315
 
3311
3316
    if (listPtr->xScrollCmd == NULL) {
3312
3317
        return;
3334
3339
 
3335
3340
    interp = listPtr->interp;
3336
3341
    Tcl_Preserve(interp);
3337
 
    result = Tcl_VarEval(interp, listPtr->xScrollCmd, " ", firstStr, " ",
3338
 
            lastStr, NULL);
 
3342
    Tcl_DStringInit(&buf);
 
3343
    Tcl_DStringAppend(&buf, listPtr->xScrollCmd, -1);
 
3344
    Tcl_DStringAppend(&buf, " ", -1);
 
3345
    Tcl_DStringAppend(&buf, firstStr, -1);
 
3346
    Tcl_DStringAppend(&buf, " ", -1);
 
3347
    Tcl_DStringAppend(&buf, lastStr, -1);
 
3348
    result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
 
3349
    Tcl_DStringFree(&buf);
3339
3350
    if (result != TCL_OK) {
3340
3351
        Tcl_AddErrorInfo(interp,
3341
3352
                "\n    (horizontal scrolling command executed by listbox)");
3381
3392
        if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) {
3382
3393
            Tcl_SetVar2Ex(interp, listPtr->listVarName, NULL,
3383
3394
                    listPtr->listObj, TCL_GLOBAL_ONLY);
3384
 
            Tcl_TraceVar(interp, listPtr->listVarName,
3385
 
                    TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
 
3395
            Tcl_TraceVar2(interp, listPtr->listVarName,
 
3396
                    NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
3386
3397
                    ListboxListVarProc, clientData);
3387
3398
            return NULL;
3388
3399
        }