home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / windows / x / 21413 < prev    next >
Encoding:
Text File  |  1993-01-21  |  3.0 KB  |  68 lines

  1. Newsgroups: comp.windows.x
  2. Path: sparky!uunet!gecko!lanzo
  3. From: lanzo@tekelec.com (Mark Lanzo)
  4. Subject: Re: Changing the background of a pixmap
  5. Message-ID: <1993Jan21.180752.10676@gecko.uucp>
  6. Sender: news@gecko.uucp (Mr. News Man)
  7. Reply-To: lanzo@tekelec.com (Mark Lanzo)
  8. Organization: Tekelec Inc., Raleigh NC
  9. References: <ALSAGGAF.93Jan13171926@e40-008-4.mit.edu> <1993Jan19.201957.21870@pilot.dmg.ml.com>
  10. Date: Thu, 21 Jan 1993 18:07:52 GMT
  11. Lines: 55
  12.  
  13. In a prior article persico@orestes.sysdev.dmg.ml.com (Matthew Persico) wrote:
  14.   > In article <ALSAGGAF.93Jan13171926@e40-008-4.mit.edu>,
  15.   > ed.duomo@launchpad.unc.edu writes:|>
  16.   > |> [detailed explanation removed...]
  17.   > |>
  18.   > |> So there you have it, gentile Xperts: is there a way of changing the
  19.   > |>background of a pixmap after it has been created?
  20.  
  21.   > |>
  22.   > I'd like to ask a related question:  I have wrapped Motif message dialogs
  23.   > in a set of "convenience functions" that allow me to reuse these widgets
  24.   > instead of creating and destroying them. I have discovered that
  25.   > if I try to change the background color of dialog after creation, the 
  26.   > background color of the symbol doesn't change. ...
  27.  
  28.     [code to alter XmNbackground omitted]
  29.  
  30.   > If I do this, then the foregound and background come up with 
  31.   > the correct colors, but the pixmap background and foregound don't
  32.   > match the dialog's values.  I guess there is some other value I need to
  33.   > set, but I can;t find it in O'Reilly Volume 6 or the OSF liturature.
  34.   > Any answers out there?
  35.  
  36. Well, we just went thru this discussion over in comp.windows.x.motif,
  37. except that the relevant widget was the Label widget or derived classes
  38. like "PushButton", where we wanted to alter the labelPixmap.
  39.  
  40. The answer basically is "you can't do it right now".
  41. The problem is that the symbols are Pixmaps which just happen to be
  42. initially generated from bitmaps using the foreground and background
  43. color, but once they are created they remain intact.
  44.  
  45. For most cases this makes sense.  If you had installed your own multi-color
  46. pixmap, you certainly wouldn't want the widget suddenly altering some
  47. pixels in the pixmap just because they happened to coincide with the 
  48. widget's foreground or background colors.
  49.  
  50. The problem is that we really want to distinguish two separate cases:
  51.   1)  An image which is a bitmap, and which always is displayed using
  52.       the current fg/bg colors; and
  53.   2)  An image which is a pixmap (even if initially derived from a bitmap),
  54.       always displayed using its own colors.
  55.  
  56. Basically, case 1 needs to retain a 1-plane image and refresh the image
  57. using a routine like XCopyPlane().  Case 2 requires generating a pixmap
  58. and refreshing it using a routine like XCopyArea(), without regard as to
  59. the number of bitplanes the image is composed of.
  60.  
  61. Sounds like an enhancement request to me ... 
  62.  
  63.     --mark
  64.  
  65. +--------------------------------------------------------+------- /// -----+
  66. | Mark Lanzo   KD4QLZ   lanzo@tekelec.com   919-460-5576 |    \\\///       |
  67. +--------------------------------------------------------+---- \XX/ -------+
  68.