[comp.windows.open-look] Using pixmaps in OPENLOOK buttons

langager@trwacs.UUCP (Mike Langager) (04/08/91)

Hi,

   I am in the process of converting a Motif based application to use 
the OLIT widget set provided by Sun with Openwindows 2.0.  In my Motif
version, I use the XtNlabelImage resource to have a pixmap image displayed
in a button.  When I try the same thing in an oblong button widet in 
OLIT, nothing happens.  Can this be done in OLIT?  Will it be supported in 
a future release?  Thanks in advance.

						-- Mike

-----------------------------------------------------------------------------
Mike Langager			UUCP: uunet!trwacs!langager
TRW Systems Division		Internet: langager@trwacs.fp.trw.com
Fairfax Virginia 		Voice: +1 703/968-1846
-- 
-----------------------------------------------------------------------------
Mike Langager			UUCP: uunet!trwacs!langager
TRW Systems Division		Internet: langager@trwacs.fp.trw.com
Fairfax Virginia 		Voice: +1 703/968-1846

rmt@cbnewsd.att.com (richard.m.thomas) (04/10/91)

In article <284@trwacs.UUCP> langager@trwacs.UUCP (Mike Langager) writes:
>Hi,
>
>   I am in the process of converting a Motif based application to use 
>the OLIT widget set provided by Sun with Openwindows 2.0.  In my Motif
>version, I use the XtNlabelImage resource to have a pixmap image displayed
>in a button.  When I try the same thing in an oblong button widet in 
>OLIT, nothing happens.  Can this be done in OLIT?  Will it be supported in 
>a future release?  Thanks in advance.
>
>						-- Mike
>
>-----------------------------------------------------------------------------
>Mike Langager			UUCP: uunet!trwacs!langager
>TRW Systems Division		Internet: langager@trwacs.fp.trw.com
>Fairfax Virginia 		Voice: +1 703/968-1846
>--------------------------------------------------------------------------


With OLIT, XtNlabelImage is a value of data-type *XImage rather
than Pixmap. Use XGetImage to create an XImage from your
Pixmap, then use the returned XImage* as the resource value for your
button.


----------------------------------------------------
Rick Thomas			rmt@attunix.att.com
UNIX System Laboratories
Summit, NJ			908-522-6109
----------------------------------------------------

grp@magpie.unify.com (Greg Pasquariello) (04/10/91)

>Hi,
>
>   I am in the process of converting a Motif based application to use 
>the OLIT widget set provided by Sun with Openwindows 2.0.  In my Motif
>version, I use the XtNlabelImage resource to have a pixmap image displayed
>in a button.  When I try the same thing in an oblong button widet in 
>OLIT, nothing happens.  Can this be done in OLIT?  Will it be supported in 
>a future release?  Thanks in advance.
>
>						-- Mike
>

It can be done in the current release of OLIT.  With the OLIT delivered with
OpenWindows 2.0 though, the button will not resize to fit the image, and the
image will be clipped.  With the newer release of the toolkit (2.5 from Sun, 
4 [I think] from AT&T), the button will resize to fit the image.

Make sure you are setting XtNlabelType to OL_IMAGE.  It should work OK.

>-----------------------------------------------------------------------------
>Mike Langager			UUCP: uunet!trwacs!langager
>TRW Systems Division		Internet: langager@trwacs.fp.trw.com
>Fairfax Virginia 		Voice: +1 703/968-1846

---
Greg Pasquariello	grp@unify.com
Unify Corporation 	Be good and never poison people