summaryrefslogtreecommitdiff
path: root/libtk/label.h
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2006-12-22 17:07:39 +0000
committerCharles.Forsyth <devnull@localhost>2006-12-22 17:07:39 +0000
commit37da2899f40661e3e9631e497da8dc59b971cbd0 (patch)
treecbc6d4680e347d906f5fa7fca73214418741df72 /libtk/label.h
parent54bc8ff236ac10b3eaa928fd6bcfc0cdb2ba46ae (diff)
20060303a
Diffstat (limited to 'libtk/label.h')
-rw-r--r--libtk/label.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/libtk/label.h b/libtk/label.h
new file mode 100644
index 00000000..da820c39
--- /dev/null
+++ b/libtk/label.h
@@ -0,0 +1,73 @@
+typedef struct TkLabel TkLabel;
+
+/*
+ * widgets that use the label code:
+ * label
+ * checkbutton
+ * button
+ * menubutton
+ * separator
+ * cascade
+ * radiobutton
+ */
+
+struct TkLabel
+{
+ char* text; /* Label value */
+ Image* bitmap; /* Bitmap to display */
+ TkImg* img;
+ int justify;
+ int anchor;
+// int flags; /* justify/anchor */
+ int w;
+ int h;
+ int textheight;
+
+ /* button fields */
+ char* command; /* Command to execute at invoke */
+ char* value; /* Variable value in radio button */
+ char* offvalue; /* Off value for check button */
+ char* variable; /* Variable name in radio button */
+ int ul;
+ int check; /* check/radiobutton/choicebutton state */
+ int indicator; /* -indicatoron setting */
+ char* menu;
+
+ char** values;
+ int nvalues;
+ /* current value of choicebutton is represented by check */
+};
+
+/* Layout constants */
+enum {
+ Textpadx = 3,
+ Textpady = 0,
+ Bitpadx = 0, /* Bitmap padding in labels */
+ Bitpady = 0,
+ CheckButton = 10,
+ CheckButtonBW = 2,
+ ButtonBorder = 4,
+};
+
+extern TkOption tkbutopts[];
+extern TkOption tkradopts[];
+extern TkOption tkcbopts[];
+
+/* label.c */
+extern char* tklabelsaverelief(Tk*, char*, char**);
+extern char* tklabelrestorerelief(Tk*, char*, char**);
+extern void tksizelabel(Tk*);
+extern char* tkdrawlabel(Tk*, Point);
+extern void tkfreelabel(Tk*);
+extern void tklabelgetimgs(Tk*, Image**, Image**);
+extern char* tksetvar(TkTop*, char*, char*);
+
+/* buton.c */
+extern Tk* tkmkbutton(TkTop*, int);
+extern void tksizebutton(Tk*);
+extern char* tkbuttoninvoke(Tk*, char*, char**);
+extern char* tkradioinvoke(Tk*, char*, char**);
+
+/* support for menus */
+extern int tklabelmargin(Tk*);
+extern int tkbuttonmargin(Tk*);