Tk Source Code

Check-in [c83c6499]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Improved patch formatting. No functional change
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip-441
Files: files | file ages | folders
SHA1:c83c64991b7871c71fbb60aab00a6c9644895a5b
User & Date: fvogel 2016-01-11 14:32:00
Context
2016-01-11
16:23
Polished listbox justification demo check-in: b976a36c user: fvogel tags: tip-441
14:32
Improved patch formatting. No functional change check-in: c83c6499 user: fvogel tags: tip-441
13:23
merged trunk check-in: d9f9c7f5 user: fvogel tags: tip-441
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tkListbox.c.

161
162
163
164
165
166
167
168
169

170
171
172
173
174
175
176
...
273
274
275
276
277
278
279


280
281
282
283
284
285
286
...
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
...
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
....
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
....
2067
2068
2069
2070
2071
2072
2073

2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085

2086

2087
2088

2089

2090
2091
2092
2093
2094
2095
2096
2097
....
2637
2638
2639
2640
2641
2642
2643
2644





2645
2646
2647
2648
2649
2650
2651
....
2657
2658
2659
2660
2661
2662
2663
2664





2665
2666
2667
2668
2669
2670
2671
....
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673

3674
3675
3676
3677


3678
3679
3680
3681
3682
3683
3684
3685
    char *xScrollCmd;		/* Command prefix for communicating with
				 * horizontal scrollbar. NULL means no command
				 * to issue. Malloc'ed. */
    int state;			/* Listbox state. */
    Pixmap gray;		/* Pixmap for displaying disabled text. */
    int flags;			/* Various flag bits: see below for
				 * definitions. */
    Tk_Justify justify;         /* Justification */
    int oldMaxOffset;           /* Used in scrolling for right/center justification */

} Listbox;

/*
 * How to encode the keys for the hash tables used to store what items are
 * selected and what the attributes are.
 */

................................................................................
	 Tk_Offset(Listbox, highlightBgColorPtr), 0, 0, 0},
    {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
	 DEF_LISTBOX_HIGHLIGHT, -1, Tk_Offset(Listbox, highlightColorPtr),
	 0, 0, 0},
    {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness",
	 "HighlightThickness", DEF_LISTBOX_HIGHLIGHT_WIDTH, -1,
	 Tk_Offset(Listbox, highlightWidth), 0, 0, 0},


    {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
	 DEF_LISTBOX_RELIEF, -1, Tk_Offset(Listbox, relief), 0, 0, 0},
    {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground",
	 DEF_LISTBOX_SELECT_COLOR, -1, Tk_Offset(Listbox, selBorder),
	 0, DEF_LISTBOX_SELECT_MONO, 0},
    {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth",
	 "BorderWidth", DEF_LISTBOX_SELECT_BD, -1,
................................................................................
	 TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING, "-yscrollcommand", "yScrollCommand", "ScrollCommand",
	 DEF_LISTBOX_SCROLL_COMMAND, -1, Tk_Offset(Listbox, yScrollCmd),
	 TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING, "-listvariable", "listVariable", "Variable",
	 DEF_LISTBOX_LIST_VARIABLE, -1, Tk_Offset(Listbox, listVarName),
	 TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
	DEF_LISTBOX_JUSTIFY, -1, Tk_Offset(Listbox, justify), 0, 0, 0},
    {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0}
};

/*
 * The itemAttrOptionSpecs table defines the valid configuration options for
 * listbox items
 */
................................................................................
static void		ListboxWorldChanged(ClientData instanceData);
static int		NearestListboxElement(Listbox *listPtr, int y);
static char *		ListboxListVarProc(ClientData clientData,
			    Tcl_Interp *interp, const char *name1,
			    const char *name2, int flags);
static void		MigrateHashEntries(Tcl_HashTable *table,
			    int first, int last, int offset);
static int      GetMaxOffset(Listbox *listPtr);

/*
 * The structure below defines button class behavior by means of procedures
 * that can be invoked from generic window code.
 */

static const Tk_ClassProcs listboxClass = {
................................................................................
	    return result;
	}

	stringRep = Tcl_GetStringFromObj(el, &stringLen);
	Tk_GetFontMetrics(listPtr->tkfont, &fm);
	pixelWidth = Tk_TextWidth(listPtr->tkfont, stringRep, stringLen);

    x = listPtr->inset + listPtr->selBorderWidth - listPtr->xOffset;
	y = ((index - listPtr->topIndex)*listPtr->lineHeight)
		+ listPtr->inset + listPtr->selBorderWidth;
	results[0] = Tcl_NewIntObj(x);
	results[1] = Tcl_NewIntObj(y);
	results[2] = Tcl_NewIntObj(pixelWidth);
	results[3] = Tcl_NewIntObj(fm.linespace);
	Tcl_SetObjResult(interp, Tcl_NewListObj(4, results));
................................................................................
		prevSelected = 0;
	    }
	}

	/*
	 * Draw the actual text of this item.
	 */

    Tcl_ListObjIndex(listPtr->interp, listPtr->listObj, i, &curElement);
    stringRep = Tcl_GetStringFromObj(curElement, &stringLen);
    Tk_ComputeTextLayout(listPtr->tkfont,
            stringRep, stringLen, 0,
            listPtr->justify, TK_IGNORE_NEWLINES, &totalLength, &height);

	Tk_GetFontMetrics(listPtr->tkfont, &fm);
	y += fm.ascent + listPtr->selBorderWidth;

    if (listPtr->justify == TK_JUSTIFY_LEFT) {
        x = listPtr->inset + listPtr->selBorderWidth - listPtr->xOffset;
    } else if (listPtr->justify == TK_JUSTIFY_RIGHT) {

        x = width - totalLength - listPtr->inset - listPtr->selBorderWidth - listPtr->xOffset + GetMaxOffset(listPtr) - 1;

    } else {
        x = (width + GetMaxOffset(listPtr))/2 - totalLength/2 - listPtr->xOffset;

    }

	Tk_DrawChars(listPtr->display, pixmap, gc, listPtr->tkfont,
		stringRep, stringLen, x, y);

	/*
	 * If this is the active element, apply the activestyle to it.
	 */

	if ((i == listPtr->active) && (listPtr->flags & GOT_FOCUS)) {
................................................................................
	} else {
	    listPtr->partialLine = 0;
	}
	listPtr->flags |= UPDATE_V_SCROLLBAR|UPDATE_H_SCROLLBAR;
	ChangeListboxView(listPtr, listPtr->topIndex);
        if (listPtr->justify == TK_JUSTIFY_RIGHT) {
            maxOffset = GetMaxOffset(listPtr);
            if (maxOffset != listPtr->oldMaxOffset && listPtr->oldMaxOffset > 0) {  // window has shrunk





                if (maxOffset > listPtr->oldMaxOffset) {
                    tmpOffset = maxOffset - listPtr->oldMaxOffset;
                } else {
                    tmpOffset = listPtr->oldMaxOffset - maxOffset;
                }
                tmpOffset -= tmpOffset % listPtr->xScrollUnit;
                if ((tmpOffset + listPtr->xOffset) > maxOffset) {
................................................................................
                listPtr->xOffset += tmpOffset;
            } else {
                listPtr->xOffset = maxOffset;
            }
            listPtr->oldMaxOffset = maxOffset;
        } else if (listPtr->justify == TK_JUSTIFY_CENTER) {
            maxOffset = GetMaxOffset(listPtr);
            if (maxOffset != listPtr->oldMaxOffset && listPtr->oldMaxOffset > 0) {  // window has shrunk





                tmpOffset2 = maxOffset / 2;
                if (maxOffset > listPtr->oldMaxOffset) {
                    tmpOffset = maxOffset/2 - listPtr->oldMaxOffset/2;
                } else {
                    tmpOffset = listPtr->oldMaxOffset/2 - maxOffset/2;
                }
                tmpOffset -= tmpOffset % listPtr->xScrollUnit;
................................................................................
}
 
/*
 *----------------------------------------------------------------------
 *
 * GetMaxOffset --
 *
 * Passing in a listbox pointer, returns the maximum offset for the box
 *
 * Results:
 *       Listbox's maxOffset
 *
 * Side effects:
 *       None
 *
 *----------------------------------------------------------------------
*/

static int GetMaxOffset(register Listbox *listPtr)
{
    int maxOffset;



    maxOffset = listPtr->maxWidth - (Tk_Width(listPtr->tkwin) - 2*listPtr->inset - 2*listPtr->selBorderWidth) + listPtr->xScrollUnit - 1;
    if (maxOffset < 0) {
        maxOffset = 0;
    }
    maxOffset -= maxOffset % listPtr->xScrollUnit;

    return maxOffset;
}







|
|
>







 







>
>







 







<
<







 







|







 







|







 







>
|
|
|
<
|




|
|
|
>
|
>
|
|
>
|
>
|







 







|
>
>
>
>
>







 







|
>
>
>
>
>







 







|


|


|



>
|



>
>
|







161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
...
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
...
309
310
311
312
313
314
315


316
317
318
319
320
321
322
...
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
....
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
....
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078

2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
....
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
....
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
....
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
    char *xScrollCmd;		/* Command prefix for communicating with
				 * horizontal scrollbar. NULL means no command
				 * to issue. Malloc'ed. */
    int state;			/* Listbox state. */
    Pixmap gray;		/* Pixmap for displaying disabled text. */
    int flags;			/* Various flag bits: see below for
				 * definitions. */
    Tk_Justify justify;         /* Justification. */
    int oldMaxOffset;           /* Used in scrolling for right/center
                                 * justification. */
} Listbox;

/*
 * How to encode the keys for the hash tables used to store what items are
 * selected and what the attributes are.
 */

................................................................................
	 Tk_Offset(Listbox, highlightBgColorPtr), 0, 0, 0},
    {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
	 DEF_LISTBOX_HIGHLIGHT, -1, Tk_Offset(Listbox, highlightColorPtr),
	 0, 0, 0},
    {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness",
	 "HighlightThickness", DEF_LISTBOX_HIGHLIGHT_WIDTH, -1,
	 Tk_Offset(Listbox, highlightWidth), 0, 0, 0},
    {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
	DEF_LISTBOX_JUSTIFY, -1, Tk_Offset(Listbox, justify), 0, 0, 0},
    {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
	 DEF_LISTBOX_RELIEF, -1, Tk_Offset(Listbox, relief), 0, 0, 0},
    {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground",
	 DEF_LISTBOX_SELECT_COLOR, -1, Tk_Offset(Listbox, selBorder),
	 0, DEF_LISTBOX_SELECT_MONO, 0},
    {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth",
	 "BorderWidth", DEF_LISTBOX_SELECT_BD, -1,
................................................................................
	 TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING, "-yscrollcommand", "yScrollCommand", "ScrollCommand",
	 DEF_LISTBOX_SCROLL_COMMAND, -1, Tk_Offset(Listbox, yScrollCmd),
	 TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING, "-listvariable", "listVariable", "Variable",
	 DEF_LISTBOX_LIST_VARIABLE, -1, Tk_Offset(Listbox, listVarName),
	 TK_OPTION_NULL_OK, 0, 0},


    {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0}
};

/*
 * The itemAttrOptionSpecs table defines the valid configuration options for
 * listbox items
 */
................................................................................
static void		ListboxWorldChanged(ClientData instanceData);
static int		NearestListboxElement(Listbox *listPtr, int y);
static char *		ListboxListVarProc(ClientData clientData,
			    Tcl_Interp *interp, const char *name1,
			    const char *name2, int flags);
static void		MigrateHashEntries(Tcl_HashTable *table,
			    int first, int last, int offset);
static int		GetMaxOffset(Listbox *listPtr);

/*
 * The structure below defines button class behavior by means of procedures
 * that can be invoked from generic window code.
 */

static const Tk_ClassProcs listboxClass = {
................................................................................
	    return result;
	}

	stringRep = Tcl_GetStringFromObj(el, &stringLen);
	Tk_GetFontMetrics(listPtr->tkfont, &fm);
	pixelWidth = Tk_TextWidth(listPtr->tkfont, stringRep, stringLen);

	x = listPtr->inset + listPtr->selBorderWidth - listPtr->xOffset;
	y = ((index - listPtr->topIndex)*listPtr->lineHeight)
		+ listPtr->inset + listPtr->selBorderWidth;
	results[0] = Tcl_NewIntObj(x);
	results[1] = Tcl_NewIntObj(y);
	results[2] = Tcl_NewIntObj(pixelWidth);
	results[3] = Tcl_NewIntObj(fm.linespace);
	Tcl_SetObjResult(interp, Tcl_NewListObj(4, results));
................................................................................
		prevSelected = 0;
	    }
	}

	/*
	 * Draw the actual text of this item.
	 */

        Tcl_ListObjIndex(listPtr->interp, listPtr->listObj, i, &curElement);
        stringRep = Tcl_GetStringFromObj(curElement, &stringLen);
        Tk_ComputeTextLayout(listPtr->tkfont, stringRep, stringLen, 0,

                listPtr->justify, TK_IGNORE_NEWLINES, &totalLength, &height);

	Tk_GetFontMetrics(listPtr->tkfont, &fm);
	y += fm.ascent + listPtr->selBorderWidth;

        if (listPtr->justify == TK_JUSTIFY_LEFT) {
            x = listPtr->inset + listPtr->selBorderWidth - listPtr->xOffset;
        } else if (listPtr->justify == TK_JUSTIFY_RIGHT) {
            x = width - totalLength - listPtr->inset -
                    listPtr->selBorderWidth - listPtr->xOffset +
                    GetMaxOffset(listPtr) - 1;
        } else {
            x = (width + GetMaxOffset(listPtr))/2 - totalLength/2 -
                    listPtr->xOffset;
        }

        Tk_DrawChars(listPtr->display, pixmap, gc, listPtr->tkfont,
		stringRep, stringLen, x, y);

	/*
	 * If this is the active element, apply the activestyle to it.
	 */

	if ((i == listPtr->active) && (listPtr->flags & GOT_FOCUS)) {
................................................................................
	} else {
	    listPtr->partialLine = 0;
	}
	listPtr->flags |= UPDATE_V_SCROLLBAR|UPDATE_H_SCROLLBAR;
	ChangeListboxView(listPtr, listPtr->topIndex);
        if (listPtr->justify == TK_JUSTIFY_RIGHT) {
            maxOffset = GetMaxOffset(listPtr);
            if (maxOffset != listPtr->oldMaxOffset && listPtr->oldMaxOffset > 0) {

                /*
                 * Window has shrunk.
                 */

                if (maxOffset > listPtr->oldMaxOffset) {
                    tmpOffset = maxOffset - listPtr->oldMaxOffset;
                } else {
                    tmpOffset = listPtr->oldMaxOffset - maxOffset;
                }
                tmpOffset -= tmpOffset % listPtr->xScrollUnit;
                if ((tmpOffset + listPtr->xOffset) > maxOffset) {
................................................................................
                listPtr->xOffset += tmpOffset;
            } else {
                listPtr->xOffset = maxOffset;
            }
            listPtr->oldMaxOffset = maxOffset;
        } else if (listPtr->justify == TK_JUSTIFY_CENTER) {
            maxOffset = GetMaxOffset(listPtr);
            if (maxOffset != listPtr->oldMaxOffset && listPtr->oldMaxOffset > 0) {

                /*
                 * Window has shrunk.
                 */

                tmpOffset2 = maxOffset / 2;
                if (maxOffset > listPtr->oldMaxOffset) {
                    tmpOffset = maxOffset/2 - listPtr->oldMaxOffset/2;
                } else {
                    tmpOffset = listPtr->oldMaxOffset/2 - maxOffset/2;
                }
                tmpOffset -= tmpOffset % listPtr->xScrollUnit;
................................................................................
}
 
/*
 *----------------------------------------------------------------------
 *
 * GetMaxOffset --
 *
 *	Passing in a listbox pointer, returns the maximum offset for the box.
 *
 * Results:
 *	Listbox's maxOffset.
 *
 * Side effects:
 *	None.
 *
 *----------------------------------------------------------------------
*/
static int GetMaxOffset(
    register Listbox *listPtr)
{
    int maxOffset;

    maxOffset = listPtr->maxWidth -
            (Tk_Width(listPtr->tkwin) - 2*listPtr->inset -
            2*listPtr->selBorderWidth) + listPtr->xScrollUnit - 1;
    if (maxOffset < 0) {
        maxOffset = 0;
    }
    maxOffset -= maxOffset % listPtr->xScrollUnit;

    return maxOffset;
}

Changes to macosx/tkMacOSXDefault.h.

255
256
257
258
259
260
261

262
263
264
265
266
267
268
269
270
271
272
#define DEF_LISTBOX_EXPORT_SELECTION	"1"
#define DEF_LISTBOX_FONT		"TkTextFont"
#define DEF_LISTBOX_FG			BLACK
#define DEF_LISTBOX_HEIGHT		"10"
#define DEF_LISTBOX_HIGHLIGHT_BG	NORMAL_BG
#define DEF_LISTBOX_HIGHLIGHT		BLACK
#define DEF_LISTBOX_HIGHLIGHT_WIDTH	"0"

#define DEF_LISTBOX_RELIEF		"solid"
#define DEF_LISTBOX_SCROLL_COMMAND	""
#define DEF_LISTBOX_LIST_VARIABLE	""
#define DEF_LISTBOX_JUSTIFY		"left"
#define DEF_LISTBOX_SELECT_COLOR	SELECT_BG
#define DEF_LISTBOX_SELECT_MONO		BLACK
#define DEF_LISTBOX_SELECT_BD		"0"
#define DEF_LISTBOX_SELECT_FG_COLOR	SELECT_FG
#define DEF_LISTBOX_SELECT_FG_MONO	WHITE
#define DEF_LISTBOX_SELECT_MODE		"browse"
#define DEF_LISTBOX_SET_GRID		"0"







>



<







255
256
257
258
259
260
261
262
263
264
265

266
267
268
269
270
271
272
#define DEF_LISTBOX_EXPORT_SELECTION	"1"
#define DEF_LISTBOX_FONT		"TkTextFont"
#define DEF_LISTBOX_FG			BLACK
#define DEF_LISTBOX_HEIGHT		"10"
#define DEF_LISTBOX_HIGHLIGHT_BG	NORMAL_BG
#define DEF_LISTBOX_HIGHLIGHT		BLACK
#define DEF_LISTBOX_HIGHLIGHT_WIDTH	"0"
#define DEF_LISTBOX_JUSTIFY		"left"
#define DEF_LISTBOX_RELIEF		"solid"
#define DEF_LISTBOX_SCROLL_COMMAND	""
#define DEF_LISTBOX_LIST_VARIABLE	""

#define DEF_LISTBOX_SELECT_COLOR	SELECT_BG
#define DEF_LISTBOX_SELECT_MONO		BLACK
#define DEF_LISTBOX_SELECT_BD		"0"
#define DEF_LISTBOX_SELECT_FG_COLOR	SELECT_FG
#define DEF_LISTBOX_SELECT_FG_MONO	WHITE
#define DEF_LISTBOX_SELECT_MODE		"browse"
#define DEF_LISTBOX_SET_GRID		"0"

Changes to unix/tkUnixDefault.h.

217
218
219
220
221
222
223

224
225
226
227
228
229
230
231
232
233
234
#define DEF_LISTBOX_EXPORT_SELECTION	"1"
#define DEF_LISTBOX_FONT		"TkDefaultFont"
#define DEF_LISTBOX_FG			BLACK
#define DEF_LISTBOX_HEIGHT		"10"
#define DEF_LISTBOX_HIGHLIGHT_BG	NORMAL_BG
#define DEF_LISTBOX_HIGHLIGHT		BLACK
#define DEF_LISTBOX_HIGHLIGHT_WIDTH	"1"

#define DEF_LISTBOX_RELIEF		"sunken"
#define DEF_LISTBOX_SCROLL_COMMAND	""
#define DEF_LISTBOX_LIST_VARIABLE	""
#define DEF_LISTBOX_JUSTIFY		"left"
#define DEF_LISTBOX_SELECT_COLOR	SELECT_BG
#define DEF_LISTBOX_SELECT_MONO		BLACK
#define DEF_LISTBOX_SELECT_BD		"0"
#define DEF_LISTBOX_SELECT_FG_COLOR	BLACK
#define DEF_LISTBOX_SELECT_FG_MONO	WHITE
#define DEF_LISTBOX_SELECT_MODE		"browse"
#define DEF_LISTBOX_SET_GRID		"0"







>



<







217
218
219
220
221
222
223
224
225
226
227

228
229
230
231
232
233
234
#define DEF_LISTBOX_EXPORT_SELECTION	"1"
#define DEF_LISTBOX_FONT		"TkDefaultFont"
#define DEF_LISTBOX_FG			BLACK
#define DEF_LISTBOX_HEIGHT		"10"
#define DEF_LISTBOX_HIGHLIGHT_BG	NORMAL_BG
#define DEF_LISTBOX_HIGHLIGHT		BLACK
#define DEF_LISTBOX_HIGHLIGHT_WIDTH	"1"
#define DEF_LISTBOX_JUSTIFY		"left"
#define DEF_LISTBOX_RELIEF		"sunken"
#define DEF_LISTBOX_SCROLL_COMMAND	""
#define DEF_LISTBOX_LIST_VARIABLE	""

#define DEF_LISTBOX_SELECT_COLOR	SELECT_BG
#define DEF_LISTBOX_SELECT_MONO		BLACK
#define DEF_LISTBOX_SELECT_BD		"0"
#define DEF_LISTBOX_SELECT_FG_COLOR	BLACK
#define DEF_LISTBOX_SELECT_FG_MONO	WHITE
#define DEF_LISTBOX_SELECT_MODE		"browse"
#define DEF_LISTBOX_SET_GRID		"0"

Changes to win/tkWinDefault.h.

220
221
222
223
224
225
226

227
228
229
230
231
232
233
234
235
236
237
#define DEF_LISTBOX_EXPORT_SELECTION	"1"
#define DEF_LISTBOX_FONT		"TkDefaultFont"
#define DEF_LISTBOX_FG			NORMAL_FG
#define DEF_LISTBOX_HEIGHT		"10"
#define DEF_LISTBOX_HIGHLIGHT_BG	NORMAL_BG
#define DEF_LISTBOX_HIGHLIGHT		HIGHLIGHT
#define DEF_LISTBOX_HIGHLIGHT_WIDTH	"1"

#define DEF_LISTBOX_RELIEF		"sunken"
#define DEF_LISTBOX_SCROLL_COMMAND	""
#define DEF_LISTBOX_LIST_VARIABLE	""
#define DEF_LISTBOX_JUSTIFY		"left"
#define DEF_LISTBOX_SELECT_COLOR	SELECT_BG
#define DEF_LISTBOX_SELECT_MONO		BLACK
#define DEF_LISTBOX_SELECT_BD		"0"
#define DEF_LISTBOX_SELECT_FG_COLOR	SELECT_FG
#define DEF_LISTBOX_SELECT_FG_MONO	WHITE
#define DEF_LISTBOX_SELECT_MODE		"browse"
#define DEF_LISTBOX_SET_GRID		"0"







>



<







220
221
222
223
224
225
226
227
228
229
230

231
232
233
234
235
236
237
#define DEF_LISTBOX_EXPORT_SELECTION	"1"
#define DEF_LISTBOX_FONT		"TkDefaultFont"
#define DEF_LISTBOX_FG			NORMAL_FG
#define DEF_LISTBOX_HEIGHT		"10"
#define DEF_LISTBOX_HIGHLIGHT_BG	NORMAL_BG
#define DEF_LISTBOX_HIGHLIGHT		HIGHLIGHT
#define DEF_LISTBOX_HIGHLIGHT_WIDTH	"1"
#define DEF_LISTBOX_JUSTIFY		"left"
#define DEF_LISTBOX_RELIEF		"sunken"
#define DEF_LISTBOX_SCROLL_COMMAND	""
#define DEF_LISTBOX_LIST_VARIABLE	""

#define DEF_LISTBOX_SELECT_COLOR	SELECT_BG
#define DEF_LISTBOX_SELECT_MONO		BLACK
#define DEF_LISTBOX_SELECT_BD		"0"
#define DEF_LISTBOX_SELECT_FG_COLOR	SELECT_FG
#define DEF_LISTBOX_SELECT_FG_MONO	WHITE
#define DEF_LISTBOX_SELECT_MODE		"browse"
#define DEF_LISTBOX_SET_GRID		"0"