home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / windows / x / 18863 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  2.1 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!ogicse!psgrain!charnel!sifon!thunder.mcrcim.mcgill.edu!mouse
  2. From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
  3. Newsgroups: comp.windows.x
  4. Subject: Re: how to create a button using XLIB????
  5. Message-ID: <1992Nov7.113029.21194@thunder.mcrcim.mcgill.edu>
  6. Date: 7 Nov 92 11:30:29 GMT
  7. Article-I.D.: thunder.1992Nov7.113029.21194
  8. References: <5NOV199210570324@mary.fordham.edu>
  9. Distribution: na
  10. Organization: McGill Research Centre for Intelligent Machines
  11. Lines: 40
  12.  
  13. In article <5NOV199210570324@mary.fordham.edu>, sbhatia@mary.fordham.edu (SABU) writes:
  14.  
  15. > Could anybody out there guide me as to how one goes about creating
  16. > buttons using XLIB.
  17.  
  18. There are two basic approaches, one being to make each button a window
  19. of its own, the other being to use one window for multiple buttons and
  20. do the last level of even distribution in the client instead.  My X CD
  21. player uses the former approach; ups uses the latter.
  22.  
  23. > The issues that I am very interested in are for ex-: who supplies the
  24. > colormap, the caller or does the button widget create it's own
  25. > colormap.
  26.  
  27. If you're using Xlib, there are no widgets, in the usual sense of the
  28. term.  Are you sure you asked the question you meant to ask?
  29.  
  30. > How to change the color of the button when user points to it and
  31. > presses the mouse button.
  32.  
  33. Typically, just redraw the button's contents with the foreground and
  34. background colors interchanged.  (If you *are* using widgets rather
  35. than Xlib, I'd expect the widget to do this for you.)
  36.  
  37. > How do you handle expose events, like for example, I create a button
  38. > to quit.  I place it on some window, but that window gets covered by
  39. > another window when I raise this window I would like to restre the
  40. > contents of the button.
  41.  
  42. If you're writing in Xlib, you just need to ensure that the code that
  43. handles Expose events knows about the window in which the button is
  44. drawn and redraws it (or calls whatever code is responsible for
  45. redrawing it).  If you're using a button widget of some sort, from my
  46. understanding of widgets, I'd expect the widget to deal with that for
  47. you.
  48.  
  49.                     der Mouse
  50.  
  51.                 mouse@larry.mcrcim.mcgill.edu
  52.