comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Keeping Button Pressed In?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Keeping Button Pressed In? [message #45253] Fri, 26 August 2005 06:28 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Richard G. French writes:

> Wow, that sounds easy! :)

Oh, it's a very pleasant afternoon. It does
really seem like work at all. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Keeping Button Pressed In? [message #45258 is a reply to message #45253] Thu, 25 August 2005 20:16 Go to previous messageGo to next message
Richard French is currently offline  Richard French
Messages: 173
Registered: December 2000
Senior Member
>
> My approach to this problem is to write a compound widget
> (usually an object widget, but it doesn't have to be). The
> "button" is really a draw widget. I create the draw widget
> using PLOTS and POLYFILL in such a way that it actually
> *looks* like a button. And I assign a event handler *function*
> (not procedure) to the draw widget. When an event occurs
> I take it into the event handler and strip out all the
> draw widget stuff, and make the event look like a button
> event structure. I pass this back as the return value of
> the event handler function and IDL treats it as though it
> were an event bubbling up the widget hierarchy. Thus,
> anyone who *uses* the compound widget *thinks* it is a
> button, although it isn't.
>
> When the button is "pressed", I invert the colors I used
> to draw the button, and use light highlighting where before
> I used dark, etc. I really does look as if the button was
> depressed.
>
> Cheers,
>
> David

Wow, that sounds easy! :)

If you tell us the name of the color picking program that was slow on the
mac, we can test it on a firebreathing G5 and see if it is any quicker than
on the laptops.

Dick
Re: Keeping Button Pressed In? [message #45263 is a reply to message #45258] Wed, 24 August 2005 20:07 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
hocmin@gmail.com writes:

> I'm new to IDL but have some experience in programming. I'm trying to
> recreate the MS Paint/Adobe Photoshop metaphor with my application
> through a series of image buttons. Basically, I want one button to
> stay pressed down, signifying the "mode" the application is in. Is
> this possible with widget_button's using the /bitmap keyword? I
> realize I could throw something up with radio buttons to achieve the
> same functionality, but I really think the pressed image buttons is a
> more elegant solution.
>
> If not possible, are there any workarounds? I tried using two
> different images, one to make it look like it's pressed. But the
> widget_button has too much padding between the image and the border of
> the button to make it "look" like it's pressed. I couldn't figure out
> a way around this either.

My approach to this problem is to write a compound widget
(usually an object widget, but it doesn't have to be). The
"button" is really a draw widget. I create the draw widget
using PLOTS and POLYFILL in such a way that it actually
*looks* like a button. And I assign a event handler *function*
(not procedure) to the draw widget. When an event occurs
I take it into the event handler and strip out all the
draw widget stuff, and make the event look like a button
event structure. I pass this back as the return value of
the event handler function and IDL treats it as though it
were an event bubbling up the widget hierarchy. Thus,
anyone who *uses* the compound widget *thinks* it is a
button, although it isn't.

When the button is "pressed", I invert the colors I used
to draw the button, and use light highlighting where before
I used dark, etc. I really does look as if the button was
depressed.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Keeping Button Pressed In? [message #45332 is a reply to message #45253] Mon, 29 August 2005 07:28 Go to previous message
hocmin is currently offline  hocmin
Messages: 5
Registered: August 2005
Junior Member
Thanks for the advice. I have it working.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Constrained Optimization routine
Next Topic: Bases de datos

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:43:53 PDT 2025

Total time taken to generate the page: 0.00662 seconds