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