home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / amiga / programm / 12586 < prev    next >
Encoding:
Internet Message Format  |  1992-08-23  |  1.8 KB

  1. Path: sparky!uunet!zephyr.ens.tek.com!uw-beaver!news.u.washington.edu!usenet.coe.montana.edu!rpi!usc!elroy.jpl.nasa.gov!swrinde!mips!mips!munnari.oz.au!metro!extro.ucc.su.OZ.AU!willw
  2. From: willw@extro.ucc.su.OZ.AU (William Waring)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Another Gadtools Q
  5. Message-ID: <1992Aug23.140816.8872@ucc.su.OZ.AU>
  6. Date: 23 Aug 92 14:08:16 GMT
  7. References: <lahurst.714168454@unix1.tcd.ie> <heinz.032g@edohwg.UUCP>
  8. Sender: Edward Lawford
  9. Organization: Uni Computing Service, Uni of Sydney, Australia
  10. Lines: 32
  11. Nntp-Posting-Host: extro.ucc.su.oz.au
  12.  
  13. In article <heinz.032g@edohwg.UUCP> heinz@edohwg.UUCP (Heinz Wrobel) writes:
  14. >In article <lahurst.714168454@unix1.tcd.ie> lahurst@unix1.tcd.ie ( ) writes:
  15. >>I have been messing with gadtools.library for a couple of weeks now and have one
  16. >>question . When I added keyboard equivalents to my prg I noticeed that the gadgets don't "flash" when I invoke the keyboard equivalent. I have tried the
  17. >>ActivateGadget function ,but without success.
  18. >>
  19. >>Any Help would be appriciated.
  20. >>Leon
  21.  
  22. There is neat bit of code I developed for X-Comm that makes the gadgets flash 
  23. when you press the key. It goes like this:
  24.  
  25. When you get the VANILLAKEY or RAWKEY message from intuition, you process it as
  26. normal to find out what key was pressed, then call this function:
  27.  
  28. KeyGadget(struct Window *Win, struct Gadget *Gad)
  29. {
  30.     Gad->Flags ^= GFLG_SELECTED;
  31.     RefreshGList(Gad,Win,NULL,1);
  32.     Delay(2);
  33.     Gad->Flags ^= GFLG_SELECTED;
  34.     RefreshGList(Gad,Win,NULL,1);
  35. }
  36.  
  37. Just pass it a pointer to the window and a pointer to the gadget that the key is ascociated with, and voila! You're gadgets will flash away.
  38.  
  39. Hope this helps.
  40. -- 
  41. --
  42. Well I guess I'd better say something witty...
  43. --
  44. Whom computers would destroy, they must first drive mad.
  45.