Subject: question about colour gradients

From: Dominik Vogt <[email-masked]>
Date: Mon, 21 Dec 1998 03:25:44 +0100

I have the new MenuStyle syntax almost in place now.
One topic remains however: combining color gradients
with any hilighting style does not work because
drawing a menu item overwrites the gradient. Any
ideas how I could solve this? Redrawing the gradient
for every change of the hilighted item is no soultion.
Could I copy the menu item graphics into a memory area
and restore it when it is unhilighted? How colud this
be done?

Bye

Dominik
-- 
Dominik Vogt, [email-masked]
Reply-To: [email-masked]

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: German Jose Gomez Garcia <[email-masked]>
Date: Mon, 21 Dec 1998 09:43:14 +0100 (MET)

> and restore it when it is unhilighted? How colud this

	That was one of the reasons because I use only font highlighting
with gradients, but if anybody agrees in the extra use of memory I think
a fast solution should be to create a xpm dinamically and store it as it
is done with normal xpms, it should be create the first time you popup a
menu (not as initialization stuff) and we should add it should be updated
every time you add or remove something to the menu. In this way gradients
should be FAST, but mem usage should increase (though not too much if you
don't have a thousand menus :-)
	I coded it sometime ago, in the 2.0.46 era..., but I don't know
if I keep the code, anyway I think I could do it again.

> Dominik

	What about my last "bug report", it is normal than I get only the
first characters of every menuitem? I mean the menus are not wide enough
and blah blah blah ...

<>-------------------------------------+-----------------------------------<>
   One O.S. to rule them all,          |  German Gomez Garcia
      One O.S. to find them.           |  [email-masked]
   One O.S. to bring them all          |
      and in the darkness bind them.   |  "Wur Qanar Wur Stilor Wur Kas"
<>-------------------------------------+-----------------------------------<>

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 21 Dec 1998 10:59:19 +0100

> if I keep the code, anyway I think I could do it again.

Hmm, semms to be a lot of overhead. In the end it is always only a
single menu item that has to be stored. No need to allocate memory
for every item in every menu then. We really could get away
with storing the repainted area, couldn't we? Although that
would make the logic in the code more complicated.

> first characters of every menuitem? I mean the menus are not wide enough

No, definitely not normal or else I would have seen it. Anyway,
it's not worth any effort for debugging since the visual_style
bit will be gone very soon.

Bye

Dominik
-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Brad Giaccio <[email-masked]>
Date: Mon, 21 Dec 1998 07:57:29 -0500 (EST)

> would make the logic in the code more complicated.

Dominik you really need to get those X books I suggested. Without looking
at the code I'm assuming you knoe what the rectangle the relevent menu
item is in.  Given that you want 
XGetImage(...);
Do highlight stuff
XPutImage(...);

The first X call will grab a specified rectangle within a drawable and
store it in an XImage struct
The XPut will put the XImage back overwriting the highlight you just made.

Brad
-- 
--- There are two kinds of knowledge, you either know the answer or
			you know where to find it
		      -Kane, Johnson, and anonymous

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 21 Dec 1998 17:35:32 +0100

On Mon, Dec 21, 1998 at 07:57:29AM -0500, [email-masked] wrote:
> Dominik you really need to get those X books I suggested.

I ordered them but they won't be delivered until early January.
In the meantime I have to ask questions on the list.

> Without looking at the code I'm assuming you know what the
> rectangle the relevent menu item is in.  Given that you want 
> XGetImage(...);
> Do highlight stuff
> XPutImage(...);

Yup, that's what I was looking for. Thanks, Brad.

Bye

Dominik

---

From: Brad Giaccio <[email-masked]>
Date: Mon, 21 Dec 1998 13:21:23 -0500 (EST)

> In the meantime I have to ask questions on the list.

Just to let you know my comment was not intended harshly, more as a
reminder.  You will see when you start going through the commands laid out
in vol2 that much of the Xlib function are rather intuitive once you learn
how to look for them.  I have no problem with you asking questions, if I
did I wouldn't have given you answers.  The problem is, as you can
probably tell, knowing what you want to accomplish with Xlib and knowing
how to verbaly describe it are 2 very different animals. 

So ask away I'll always try to answer.  And congratulations on making a
good purchase towards your education.

Brad

---

From: German Jose Gomez Garcia <[email-masked]>
Date: Tue, 22 Dec 1998 00:24:51 +0100 (MET)

> would make the logic in the code more complicated.
	Well, I think is more overhead allocating the mem every time you
highlight and item :-), I don't thing allocating pixmaps background for 
every menu is an overhead, unless you have lots of menus. I remember that
it was not to overhelming and it was really fast. What about a compile time
option like MEMORY_OPTIMIZE or SPEED_OPTIMIZE, I'm sure that gradients are
not the only thing should benify from such an option. What do you think?

PS: Of course I suppose you would not allocate the memory every time you 
highlight and item...

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 22 Dec 1998 02:14:58 +0100

On Mon, Dec 21, 1998 at 01:21:23PM -0500, Brad Giaccio wrote:
> reminder.

No offense taken. I was looking for some good books on X for a while
and am quite grateful for your hint.

> good purchase towards your education.

I will.

Bye

Dominik