home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / windows / openloo / 3773 < prev    next >
Encoding:
Text File  |  1992-09-09  |  1.3 KB  |  61 lines

  1. Newsgroups: comp.windows.open-look
  2. Path: sparky!uunet!gatech!concert!accura_nc!news
  3. From: richard@aisg.com (Richard)
  4. Subject: single and double click
  5. Message-ID: <1992Sep9.192750.21036@aisg.com>
  6. Keywords: mouse singleclick doubleclick
  7. Sender: news@aisg.com
  8. Reply-To: richard@aisg.com (Richard)
  9. Organization: Accura Innovative Services Inc.
  10. Date: Wed, 9 Sep 92 19:27:50 GMT
  11. Lines: 48
  12.  
  13. I used DevGuide to generate a list panel.  I need to do a call back when
  14. the user
  15. did a single click and another call back when then user did a double click.
  16.  
  17. I used doubleclick() from DevGuide to check if the event is a double
  18. click in the
  19. following codes
  20.  
  21. int
  22. SOlistitem(item, string, client_data, op, row)
  23.     Panel_item      item;
  24.         char            *string;
  25.         Xv_opaque       client_data;
  26.         Panel_list_op   op;
  27.         Event           *event;
  28.         int             row;
  29. {
  30.  
  31. .
  32. .
  33. .
  34.     case PANEL_LIST_OP_SELECT:
  35.         if (doubleclick(event)) 
  36.             fputs("doubleclick\n", stderr);
  37.         else
  38.             fputs("singleclick\n", stderr);
  39.         break;
  40. .
  41. .
  42. .
  43. }
  44.  
  45. When a user did a double click, this function will get a single click
  46. event then
  47. a double click event.
  48.  
  49. single click output:
  50.     singleclick
  51.  
  52. double click output:
  53.     singleclick
  54.     doubleclick
  55.  
  56. Is there a way to distinquish double click from a single click.  
  57.  
  58. Any help is appreciated
  59.  
  60. Richard Ching
  61.