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

  1. Path: sparky!uunet!ogicse!decwrl!gossip.pyramid.com!pyramid!unify!openlook!openlook-request
  2. From: fgreco@cfdev1026.shearson.com (Frank Greco)
  3. Newsgroups: comp.windows.open-look
  4. Subject: Re: How to create a button on a canvas?
  5. Message-ID: <bvtcazs@openlook.Unify.Com>
  6. Date: 9 Nov 92 13:54:56 GMT
  7. Article-I.D.: openlook.bvtcazs
  8. Sender: news@Unify.Com
  9. Distribution: world
  10. Lines: 30
  11.  
  12. > I want to create a button on a canvas and give the button a callback function.
  13. > How should I do?
  14.  
  15. Due to design of XView (actually its Sunview's fault), there isn't a
  16. straightforward method of doing this ... sigh...  However there are
  17. several alternatives:
  18.  
  19.     1.) Use a Canvas to draw.  Then use olgx library to render
  20.     a button image and use simple hit detection to get mouse-event
  21.     which triggers callback.
  22.  
  23.         adv: Probably would be Sun's recommended method
  24.         dis: Too much work
  25.  
  26.     2.) Use a ScrollingPanel (ie, SCROLLABLE_PANEL) to draw.  Then
  27.     merely create a button on this panel.
  28.  
  29.         adv: Easiest to do
  30.         dis: Not OPENLOOK-compliant
  31.  
  32.     3.) Get Slingshots.  Use a Canvas_shell to draw, and use a
  33.     Drawtext or Drawimage as your button.  Drawtext/Drawimage (ie,
  34.     Rectobj) can have a callback associated with it.
  35.  
  36.         adv: Most Flexible (by far)
  37.         dis: Not formal part of XView pkg, yet another library
  38.  
  39.  
  40.     Frank G.
  41. =-=-=-=-=-=-=-=-=-=
  42.