home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!decwrl!gossip.pyramid.com!pyramid!unify!openlook!openlook-request
- From: fgreco@cfdev1026.shearson.com (Frank Greco)
- Newsgroups: comp.windows.open-look
- Subject: Re: How to create a button on a canvas?
- Message-ID: <bvtcazs@openlook.Unify.Com>
- Date: 9 Nov 92 13:54:56 GMT
- Article-I.D.: openlook.bvtcazs
- Sender: news@Unify.Com
- Distribution: world
- Lines: 30
-
- > I want to create a button on a canvas and give the button a callback function.
- > How should I do?
-
- Due to design of XView (actually its Sunview's fault), there isn't a
- straightforward method of doing this ... sigh... However there are
- several alternatives:
-
- 1.) Use a Canvas to draw. Then use olgx library to render
- a button image and use simple hit detection to get mouse-event
- which triggers callback.
-
- adv: Probably would be Sun's recommended method
- dis: Too much work
-
- 2.) Use a ScrollingPanel (ie, SCROLLABLE_PANEL) to draw. Then
- merely create a button on this panel.
-
- adv: Easiest to do
- dis: Not OPENLOOK-compliant
-
- 3.) Get Slingshots. Use a Canvas_shell to draw, and use a
- Drawtext or Drawimage as your button. Drawtext/Drawimage (ie,
- Rectobj) can have a callback associated with it.
-
- adv: Most Flexible (by far)
- dis: Not formal part of XView pkg, yet another library
-
-
- Frank G.
- =-=-=-=-=-=-=-=-=-=
-