README.txt 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. Free Pascal interface to GDK/GTK
  2. ================================
  3. Prerequisites:
  4. --------------
  5. In order for the makefile to work, you NEED the following file:
  6. makefile.fpc
  7. and it MUST be located in the directory above this directory.
  8. If you have this file on another place in your directory tree, just
  9. set the FPCDIR variable so it points to that directory.
  10. (e.g. FPCDIR=/usr/lib/fpc/0.99.13; export FPCDIR in bash, or
  11. SETENV FPCDIR /usr/lib/fpc/0.99.13 in csh)
  12. If you don't have this file, you can get it from
  13. ftp://tflily.fys.kuleuven.ac.be/pub/fpc/source/base.zip
  14. or one of the mirrors.
  15. Compiling the units:
  16. --------------------
  17. there are 4 targets for the makefile
  18. make all : compile all units
  19. make install : make all first and then install the units
  20. make examples : compile the examples
  21. make clean : clean up object and unit files.
  22. Using the units:
  23. ----------------
  24. 1) In C, you only need to input gtk.h. Here you need to input all files
  25. that you're likely to use, so you may have to experiment.
  26. 2) Names :
  27. + Pascal reserved words in types, record element names etc. have been
  28. prepended with the word 'the'. so 'label' has become 'thelabel'
  29. + functions have been kept with the same names.
  30. + for types : gdk names have been kept. Pointers to a type are defined
  31. as the type name, prepended with P. So 'GtkWidget *' becomes
  32. 'PGtkWidget'.
  33. In gtkobject, names also have been kept.
  34. In all other files, types have been prepended with T, that is, the C
  35. type 'GtkWidget' has become 'TGtkWidget'
  36. This is annoying, but C is case sensitive, and Pascal is not, so
  37. there you have it...
  38. When translating, I've tried to stick to this scheme as closely as I
  39. could. One day, however, all will be done in a uniform manner...
  40. 3) Macros. Many C macros have not been translated. The typecasting macros
  41. have been dropped, since they're useless under pascal.
  42. Macros to access record members have been translated, BUT they are
  43. to be considered as READ-ONLY. So they can be used to retrieve a value,
  44. but not to store one.
  45. e.g.
  46. function GTK_WIDGET_FLAGS(wid : pgtkwidget) : longint;
  47. can be used to retrieve the widget flags, but not to set them.
  48. so things like
  49. GTK_WIDGET_FLAGS(wid):=GTK_WIDGET_FLAGS(wid) and someflag;
  50. will not work, since this is a function, and NOT a macro as in C.
  51. 4) Packed records. GCC allows you to specify members of a record in
  52. bit format. Since this is impossible in pascal, functions and procedures
  53. to get/set these elements have been made.
  54. e.g.
  55. function width_set(var a : TGtkCListColumn) : gint;
  56. procedure set_width_set(var a : TGtkCListColumn; __width_set : gint);
  57. can be used to get or set the width in a TGtkCListColumn...
  58. in general, it's the name with '_set' appended for getting a value
  59. (set from 'a set') , and 'set_' prepended (from 'to set') and again
  60. '_set' appended.
  61. And that is about all there is to say about it.
  62. Enjoy !
  63. Michael.