home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / tcl / tclmotif.1 / tclmotif / tm.1.2 / wtour / drawnbutton1.tcl < prev    next >
Encoding:
Text File  |  1994-01-30  |  472 b   |  21 lines

  1. #
  2. # a DrawnButton
  3. #
  4. # for this, we have to do Xlib-style drawing ourselves, which
  5. # should only be done in exposeCallback, and for which we need
  6. # graphics contexts.
  7.  
  8. xmDrawnButton .btn managed
  9. .btn exposeCallback show_text
  10. set gc1 [.btn getGC -foreground yellow -background green]
  11. set gc2 [.btn getGC -foreground blue -background pink]
  12.  
  13. proc show_text {} {
  14.   global gc1
  15.   global gc2
  16.  
  17.   .btn drawImageString $gc1 30 30 "hello"
  18.   .btn drawImageString $gc2 30 80 "world"
  19. }
  20.  
  21.