home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / sgi / 12640 < prev    next >
Encoding:
Text File  |  1992-08-19  |  3.0 KB  |  71 lines

  1. Newsgroups: comp.sys.sgi
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!mips!odin!fido!paris.asd.sgi.com!alain
  3. From: alain@paris.asd.sgi.com (Alain Dumesny)
  4. Subject: Re: Inventor question
  5. Message-ID: <oponh7c@fido.asd.sgi.com>
  6. Sender: news@fido.asd.sgi.com (Usenet News Admin)
  7. Reply-To: alain@sgi.com
  8. Organization: Silicon Graphics Inc.
  9. References:  <1992Aug17.073443.20775@nuscc.nus.sg>
  10. Date: Thu, 20 Aug 1992 02:11:46 GMT
  11. Lines: 58
  12.  
  13. This question is rather specific, but other people on the Net who are using
  14. Inventor might be interested, so I will post rather than mail directly.
  15.  
  16. In article <1992Aug17.073443.20775@nuscc.nus.sg>, bemlbk@nuscc.nus.sg (Liew Beng Keat (Mr)) writes:
  17. |> 
  18. |> I want to add a push button on the right trim of the form widget
  19. |> (refer to pg 11-15 of the Iris Inventor Programming Guide) but my 
  20. |> attempts thus far has not succeeded to my requirements.
  21. |> 
  22.  
  23. When you say "trim of the form widget", I presume you mean the decoration
  24. trim around the Xt Viewers (like the SoXtExaminerViewer). The viewers have
  25. an addAppPushButton() method which will add pushbuttons to the left
  26. decoration trim (do a man SoXtFullViewer). You can't add push buttons to
  27. the right trim withought subclassing right now (that trim is reserved for
  28. the viewers. The left trim is for the app).
  29.  
  30. You can of course create SoXtPushButtons and lay them out around a viewer
  31. using motif once you build the viewer within a form.
  32.  
  33. |> I understand that there are a few ways for adding push buttons. The
  34. |> setButtonImages() routine accepts either SGI.rgb files or rrggbb array
  35. |> format RGB images or color index arrays.
  36. |> 
  37.  
  38. setButtonImages() is only used to specify what images will be used for up
  39. and down state of the button. Make sure to create the button either in RGB
  40. or color index mode (argument to the constructor) since this cannot
  41. currently be changed at run time and that it matches what images you want
  42. to display (else it will print an error message in DEBUG mode).
  43.  
  44. |> Could someone show me how the button up and button down images
  45. |> are specified using rrggbb format as well as color index arrays.
  46. |> It would be nice too if i know how to create SGI.rgb images which
  47. |> setButtonImages can understand.
  48. |> 
  49. |> 
  50. |> Beng Keat
  51. |> 
  52. |> 
  53.  
  54. .rgb images can be created using /usr/sbin/snapshot and /usr/sbin/scrsave
  55. (for grabing something on the screen), or /usr/sbin/imged for
  56. creating/editing one from scratch. imged can create either color index
  57. (default) or rgb images.
  58.  
  59. Setting the buttons images to be .rgb files is simple for prototypes. If
  60. want your image to be compiled in (what is used for the viewers) then you
  61. need to convert those image files into a C text array which you include in
  62. your code. Look under ~4Dgifts/iristools/imgtools for longimagedata()
  63. (read rgb image and return an array of rrggbb) and sizeofimage() examples.
  64. Then it is just a matter of using fprintf() to print those values out in a
  65. format you can use in your C code.
  66.  
  67. Hope this helps...
  68.  
  69. -------------------------------------------------------------------------
  70. Alain Dumesny    alain@sgi.com    (415)390-5250        Silicon Graphics Inc.
  71.