tkmain.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef __TKMAIN_H
  2. #define __TKMAIN_H
  3. #include <tcl.h>
  4. #include <tk.h>
  5. #include "dlg.h"
  6. #include "widget.h"
  7. /* Tcl interpreter */
  8. extern Tcl_Interp *interp;
  9. int xtoolkit_init (int *argc, char *argv []);
  10. int xtoolkit_end (void);
  11. int tkrundlg_event (Dlg_head *h);
  12. /* Required by the standard code */
  13. widget_data xtoolkit_create_dialog (Dlg_head *h, int with_grid);
  14. widget_data xtoolkit_get_main_dialog (Dlg_head *h);
  15. widget_data x_create_panel_container (int which);
  16. void x_panel_container_show (widget_data wdata);
  17. void x_destroy_cmd (void *);
  18. int x_create_radio (Dlg_head *h, widget_data parent, WRadio *r);
  19. int x_create_check (Dlg_head *h, widget_data parent, WCheck *c);
  20. int x_create_label (Dlg_head *h, widget_data parent, WLabel *l);
  21. int x_create_input (Dlg_head *h, widget_data parent, WInput *in);
  22. int x_create_listbox (Dlg_head *h, widget_data parent, WListbox *l);
  23. int x_create_buttonbar (Dlg_head *h, widget_data parent, WButtonBar *bb);
  24. void x_list_insert (WListbox *l, WLEntry *p, WLEntry *e);
  25. void x_redefine_label (WButtonBar *bb, int idx);
  26. /* Configuration parameters */
  27. extern int use_one_window;
  28. typedef int (*tcl_callback)(ClientData, Tcl_Interp *, int, char *[]);
  29. char * tk_new_command (widget_data parent, void *widget,
  30. tcl_callback callback, char id);
  31. #define STREQ(a,b) (*a == *b && (strcmp (a,b) == 0))
  32. /* Widget value extraction */
  33. /* Return the widget name */
  34. static inline char *wtcl_cmd (Widget w)
  35. {
  36. return (char *) w.wdata;
  37. }
  38. static inline char *wtk_win (Widget w)
  39. {
  40. return (char *)(w.wdata)+1;
  41. }
  42. /* tkkey.c */
  43. int lookup_keysym (char *s);
  44. /* tkmain.c */
  45. void tk_focus_widget (Widget_Item *p);
  46. void tk_init_dlg (Dlg_head *h);
  47. void tk_evalf (char *format,...);
  48. void tk_dispatch_all (void);
  49. void x_interactive_display (void);
  50. int tk_getch (void);
  51. #define PORT_HAS_DIALOG_TITLE 1
  52. #define PORT_HAS_PANEL_UPDATE_COLS 1
  53. #endif /* __TKMAIN_H */