summaryrefslogtreecommitdiffstats
path: root/generic/tkEntry.h
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkEntry.h')
-rw-r--r--generic/tkEntry.h83
1 files changed, 50 insertions, 33 deletions
diff --git a/generic/tkEntry.h b/generic/tkEntry.h
index fbebdaa..387b9e2 100644
--- a/generic/tkEntry.h
+++ b/generic/tkEntry.h
@@ -81,7 +81,11 @@ typedef struct {
Tk_3DBorder readonlyBorder; /* Used for drawing border around whole window
* in readonly state, plus used for
* background. */
- int borderWidth; /* Width of 3-D border around window. */
+#if TK_MAJOR_VERSION > 8
+ Tcl_Obj *borderWidthObj; /* Width of 3-D border around window. */
+#else
+ int borderWidth;
+#endif
Tk_Cursor cursor; /* Current cursor for window, or NULL. */
int exportSelection; /* Non-zero means tie internal entry selection
* to X selection. */
@@ -91,57 +95,59 @@ typedef struct {
XColor *highlightBgColorPtr;/* Color for drawing traversal highlight area
* when highlight is off. */
XColor *highlightColorPtr; /* Color for drawing traversal highlight. */
- int highlightWidth; /* Width in pixels of highlight to draw around
+#if TK_MAJOR_VERSION > 8
+ Tcl_Obj *highlightWidthObj; /* Width in pixels of highlight to draw around
* widget when it has the focus. <= 0 means
* don't draw a highlight. */
+#else
+ int highlightWidth;
+#endif
Tk_3DBorder insertBorder; /* Used to draw vertical bar for insertion
* cursor. */
- int insertBorderWidth; /* Width of 3-D border around insert cursor. */
+#if TK_MAJOR_VERSION > 8
+ Tcl_Obj *insertBorderWidthObj; /* Width of 3-D border around insert cursor. */
+#else
+ int insertBorderWidth;
+#endif
int insertOffTime; /* Number of milliseconds cursor should spend
* in "off" state for each blink. */
int insertOnTime; /* Number of milliseconds cursor should spend
* in "on" state for each blink. */
- int insertWidth; /* Total width of insert cursor. */
+#if TK_MAJOR_VERSION > 8
+ Tcl_Obj *insertWidthObj; /* Total width of insert cursor. */
+#else
+ int insertWidth;
+#endif
Tk_Justify justify; /* Justification to use for text within
* window. */
int relief; /* 3-D effect: TK_RELIEF_RAISED, etc. */
Tk_3DBorder selBorder; /* Border and background for selected
* characters. */
- int selBorderWidth; /* Width of border around selection. */
+#if TK_MAJOR_VERSION > 8
+ Tcl_Obj *selBorderWidthObj; /* Width of border around selection. */
+#else
+ int selBorderWidth;
+#endif
XColor *selFgColorPtr; /* Foreground color for selected text. */
int state; /* Normal or disabled. Entry is read-only when
* disabled. */
- char *textVarName; /* Name of variable (malloc'ed) or NULL. If
+ Tcl_Obj *textVarNameObj; /* Name of variable (malloc'ed) or NULL. If
* non-NULL, entry's string tracks the
* contents of this variable and vice
* versa. */
- char *takeFocus; /* Value of -takefocus option; not used in the
+ Tcl_Obj *takeFocusObj; /* Value of -takefocus option; not used in the
* C code, but used by keyboard traversal
- * scripts. Malloc'ed, but may be NULL. */
+ * scripts. May be NULL. */
int prefWidth; /* Desired width of window, measured in
* average characters. */
- char *scrollCmd; /* Command prefix for communicating with
- * scrollbar(s). Malloc'ed. NULL means no
- * command to issue. */
- char *showChar; /* Value of -show option. If non-NULL, first
+ Tcl_Obj *scrollCmdObj; /* Command prefix for communicating with
+ * scrollbar(s). NULL means no command to issue. */
+ Tcl_Obj *showCharObj; /* Value of -show option. If non-NULL, first
* character is used for displaying all
- * characters in entry. Malloc'ed. This is
+ * characters in entry. This is
* only used by the Entry widget. */
/*
- * Fields used in displaying help text if entry value is empty
- */
-
- Tk_TextLayout placeholderLayout;/* Cached placeholder text layout information. */
- char *placeholderString; /* String value of placeholder. */
- Tcl_Size placeholderChars; /* Number of chars in placeholder. */
- XColor *placeholderColorPtr;/* Color value of placeholder foreground. */
- GC placeholderGC; /* For drawing placeholder text. */
- int placeholderX; /* Origin for layout. */
- int placeholderLeftIndex; /* Character index of left-most character
- * visible in window. */
-
- /*
* Fields whose values are derived from the current values of the
* configuration settings above.
*/
@@ -181,11 +187,22 @@ typedef struct {
* definitions. */
int validate; /* Non-zero means try to validate */
- char *validateCmd; /* Command prefix to use when invoking
- * validate command. NULL means don't invoke
- * commands. Malloc'ed. */
- char *invalidCmd; /* Command called when a validation returns 0
+ Tcl_Obj *validateCmdObj; /* Command prefix to use when invoking
+ * validate command. NULL means don't invoke commands. */
+ Tcl_Obj *invalidCmdObj; /* Command called when a validation returns 0
* (successfully fails), defaults to {}. */
+ /*
+ * Fields used in displaying help text if entry value is empty
+ */
+
+ Tk_TextLayout placeholderLayout;/* Cached placeholder text layout information. */
+ Tcl_Obj *placeholderObj; /* String value of placeholder. */
+ Tcl_Size placeholderChars; /* Number of chars in placeholder. */
+ XColor *placeholderColorPtr;/* Color value of placeholder foreground. */
+ GC placeholderGC; /* For drawing placeholder text. */
+ int placeholderX; /* Origin for layout. */
+ int placeholderLeftIndex; /* Character index of left-most character
+ * visible in window. */
} Entry;
/*
@@ -208,7 +225,7 @@ typedef struct {
Tk_Cursor bCursor; /* cursor for buttons, or NULL. */
int bdRelief; /* 3-D effect: TK_RELIEF_RAISED, etc. */
int buRelief; /* 3-D effect: TK_RELIEF_RAISED, etc. */
- char *command; /* Command to invoke for spin buttons. NULL
+ Tcl_Obj *commandObj; /* Command to invoke for spin buttons. NULL
* means no command to issue. */
/*
@@ -230,7 +247,7 @@ typedef struct {
* multiple of this value. */
char *formatBuf; /* string into which to format value.
* Malloc'ed. */
- char *reqFormat; /* Snprintf conversion specifier used for the
+ Tcl_Obj *reqFormatObj; /* Snprintf conversion specifier used for the
* value that the users requests. Malloc'ed */
char *valueFormat; /* Snprintf conversion specifier used for the
* value. */
@@ -238,7 +255,7 @@ typedef struct {
* digits and other information; used for the
* value. */
- char *valueStr; /* Values List. Malloc'ed. */
+ Tcl_Obj *valueObj; /* Values List. */
Tcl_Obj *listObj; /* Pointer to the list object being used */
int eIndex; /* Holds the current index into elements */
int nElements; /* Holds the current count of elements */