summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkLabel.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-10-06 20:29:39 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-10-06 20:29:39 (GMT)
commit062332b74070e0ca06b5fefaa039efafe402a624 (patch)
tree174261b05a2f8773622a82526e3353049af70b4a /generic/ttk/ttkLabel.c
parent62d36b53b20fdda3e415b341f3767ec1d61b526e (diff)
downloadtk-062332b74070e0ca06b5fefaa039efafe402a624.zip
tk-062332b74070e0ca06b5fefaa039efafe402a624.tar.gz
tk-062332b74070e0ca06b5fefaa039efafe402a624.tar.bz2
Experiment: let's see if we can deprecate Tk_Offset() in favor of offsetof()
Diffstat (limited to 'generic/ttk/ttkLabel.c')
-rw-r--r--generic/ttk/ttkLabel.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c
index 91be033..de530e9 100644
--- a/generic/ttk/ttkLabel.c
+++ b/generic/ttk/ttkLabel.c
@@ -48,23 +48,23 @@ typedef struct {
*/
static Ttk_ElementOptionSpec TextElementOptions[] = {
{ "-text", TK_OPTION_STRING,
- Tk_Offset(TextElement,textObj), "" },
+ offsetof(TextElement,textObj), "" },
{ "-font", TK_OPTION_FONT,
- Tk_Offset(TextElement,fontObj), DEFAULT_FONT },
+ offsetof(TextElement,fontObj), DEFAULT_FONT },
{ "-foreground", TK_OPTION_COLOR,
- Tk_Offset(TextElement,foregroundObj), "black" },
+ offsetof(TextElement,foregroundObj), "black" },
{ "-underline", TK_OPTION_INT,
- Tk_Offset(TextElement,underlineObj), "-1"},
+ offsetof(TextElement,underlineObj), "-1"},
{ "-width", TK_OPTION_INT,
- Tk_Offset(TextElement,widthObj), "-1"},
+ offsetof(TextElement,widthObj), "-1"},
{ "-anchor", TK_OPTION_ANCHOR,
- Tk_Offset(TextElement,anchorObj), "w"},
+ offsetof(TextElement,anchorObj), "w"},
{ "-justify", TK_OPTION_JUSTIFY,
- Tk_Offset(TextElement,justifyObj), "left" },
+ offsetof(TextElement,justifyObj), "left" },
{ "-wraplength", TK_OPTION_PIXELS,
- Tk_Offset(TextElement,wrapLengthObj), "0" },
+ offsetof(TextElement,wrapLengthObj), "0" },
{ "-embossed", TK_OPTION_INT,
- Tk_Offset(TextElement,embossedObj), "0"},
+ offsetof(TextElement,embossedObj), "0"},
{ NULL, 0, 0, NULL }
};
@@ -248,11 +248,11 @@ typedef struct {
*/
static Ttk_ElementOptionSpec ImageElementOptions[] = {
{ "-image", TK_OPTION_STRING,
- Tk_Offset(ImageElement,imageObj), "" },
+ offsetof(ImageElement,imageObj), "" },
{ "-stipple", TK_OPTION_STRING, /* Really: TK_OPTION_BITMAP */
- Tk_Offset(ImageElement,stippleObj), "gray50" },
+ offsetof(ImageElement,stippleObj), "gray50" },
{ "-background", TK_OPTION_COLOR,
- Tk_Offset(ImageElement,backgroundObj), DEFAULT_BACKGROUND },
+ offsetof(ImageElement,backgroundObj), DEFAULT_BACKGROUND },
{ NULL, 0, 0, NULL }
};
@@ -442,41 +442,41 @@ typedef struct {
static Ttk_ElementOptionSpec LabelElementOptions[] = {
{ "-compound", TK_OPTION_ANY,
- Tk_Offset(LabelElement,compoundObj), "none" },
+ offsetof(LabelElement,compoundObj), "none" },
{ "-space", TK_OPTION_PIXELS,
- Tk_Offset(LabelElement,spaceObj), "4" },
+ offsetof(LabelElement,spaceObj), "4" },
/* Text element part:
* NB: Keep in sync with TextElementOptions.
*/
{ "-text", TK_OPTION_STRING,
- Tk_Offset(LabelElement,text.textObj), "" },
+ offsetof(LabelElement,text.textObj), "" },
{ "-font", TK_OPTION_FONT,
- Tk_Offset(LabelElement,text.fontObj), DEFAULT_FONT },
+ offsetof(LabelElement,text.fontObj), DEFAULT_FONT },
{ "-foreground", TK_OPTION_COLOR,
- Tk_Offset(LabelElement,text.foregroundObj), "black" },
+ offsetof(LabelElement,text.foregroundObj), "black" },
{ "-underline", TK_OPTION_INT,
- Tk_Offset(LabelElement,text.underlineObj), "-1"},
+ offsetof(LabelElement,text.underlineObj), "-1"},
{ "-width", TK_OPTION_INT,
- Tk_Offset(LabelElement,text.widthObj), ""},
+ offsetof(LabelElement,text.widthObj), ""},
{ "-anchor", TK_OPTION_ANCHOR,
- Tk_Offset(LabelElement,text.anchorObj), "w"},
+ offsetof(LabelElement,text.anchorObj), "w"},
{ "-justify", TK_OPTION_JUSTIFY,
- Tk_Offset(LabelElement,text.justifyObj), "left" },
+ offsetof(LabelElement,text.justifyObj), "left" },
{ "-wraplength", TK_OPTION_PIXELS,
- Tk_Offset(LabelElement,text.wrapLengthObj), "0" },
+ offsetof(LabelElement,text.wrapLengthObj), "0" },
{ "-embossed", TK_OPTION_INT,
- Tk_Offset(LabelElement,text.embossedObj), "0"},
+ offsetof(LabelElement,text.embossedObj), "0"},
/* Image element part:
* NB: Keep in sync with ImageElementOptions.
*/
{ "-image", TK_OPTION_STRING,
- Tk_Offset(LabelElement,image.imageObj), "" },
+ offsetof(LabelElement,image.imageObj), "" },
{ "-stipple", TK_OPTION_STRING, /* Really: TK_OPTION_BITMAP */
- Tk_Offset(LabelElement,image.stippleObj), "gray50" },
+ offsetof(LabelElement,image.stippleObj), "gray50" },
{ "-background", TK_OPTION_COLOR,
- Tk_Offset(LabelElement,image.backgroundObj), DEFAULT_BACKGROUND },
+ offsetof(LabelElement,image.backgroundObj), DEFAULT_BACKGROUND },
{ NULL, 0, 0, NULL }
};