1 typedef struct TkLabel TkLabel; 2 3 /* 4 * widgets that use the label code: 5 * label 6 * checkbutton 7 * button 8 * menubutton 9 * separator 10 * cascade 11 * radiobutton 12 */ 13 14 struct TkLabel 15 { 16 char* text; /* Label value */ 17 Image* bitmap; /* Bitmap to display */ 18 TkImg* img; 19 int justify; 20 int anchor; 21 // int flags; /* justify/anchor */ 22 int w; 23 int h; 24 int textheight; 25 26 /* button fields */ 27 char* command; /* Command to execute at invoke */ 28 char* value; /* Variable value in radio button */ 29 char* offvalue; /* Off value for check button */ 30 char* variable; /* Variable name in radio button */ 31 int ul; 32 int check; /* check/radiobutton/choicebutton state */ 33 int indicator; /* -indicatoron setting */ 34 char* menu; 35 36 char** values; 37 int nvalues; 38 /* current value of choicebutton is represented by check */ 39 }; 40 41 /* Layout constants */ 42 enum { 43 Textpadx = 3, 44 Textpady = 0, 45 Bitpadx = 0, /* Bitmap padding in labels */ 46 Bitpady = 0, 47 CheckButton = 10, 48 CheckButtonBW = 1, 49 ButtonBorder = 4, 50 CheckSpace = CheckButton + 2*CheckButtonBW + 2*ButtonBorder, 51 }; 52 53 extern TkOption tkbutopts[]; 54 extern TkOption tkradopts[]; 55 extern TkOption tkcbopts[]; 56 57 /* label.c */ 58 extern void tksizelabel(Tk*); 59 extern char* tkdrawlabel(Tk*, Point); 60 extern void tkfreelabel(Tk*); 61 extern void tklabelgetimgs(Tk*, Image**, Image**); 62 extern char* tksetvar(TkTop*, char*, char*); 63 64 /* buton.c */ 65 extern Tk* tkmkbutton(TkTop*, int); 66 extern void tksizebutton(Tk*); 67 extern char* tkdrawbutton(Tk*, Point); 68 extern char* tkbuttoninvoke(Tk*, char*, char**); 69 extern char* tkradioinvoke(Tk*, char*, char**); 70 extern void tkfreebutton(Tk*); 71 72 /* support for menus */ 73 extern int tklabelmargin(Tk*); 74 extern int tkbuttonmargin(Tk*); 75