Re: Sliders



Duncan Pierce wrote:
> 
> On Mon, 22 Nov 1999, Ivan Jager wrote:
> 
> > I am writting a theme engine. How can it know if a slider is being
> > "pressed"? I would like to draw the shadow in when someone is holding
> > the mouse down on a slider and out when they aren't. While it is down it
> > always gets called with
> > state_type=GTK_STATE_PRELIGHT and shadow_type=GTK_SHADOW_OUT but I don't
> > want to draw the shadow in when it is prelight
> 
> I don't think it can be done using the information that is passed into
> your theme engine's drawing function.  You might have some success by
> inspecting the code for whatever widget defines the slider you're
> interested in (ranges and scrollbars are done a little differently), and
> checking the type of the `widget' parameter, and then sucking data out of
> that if it's a range/scrollbar.  Not pretty.

I know it isn't too pretty, but it seems to be the only way (unless
there is something I don't know --which is very likely) The question is
what should I check in the widget parameter? or is there another way to
do it?

> One engine you could look at that does some fairly hairy stuff with widget
> internals is the Metal engine, which (last time I looked) alters the way
> scrollbars draw by effectively patching the widget at run-time!
:)
Actually, I am just changing _most_ of the Metal theme. I saw it did
some wierd stuff that I would need, but when I started I didn't see all
the problems some of that wierd stuff would cause.

The part you just mentioned I had thought I would get rid of untill I
fould out it keeps the slider from "errasing" the trough. I suspect
there is a better way of doing it, but I don't know how.

-- 
Ivan Jager



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]