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

Home » Public Forums » archive » Re: Buttons in Widgets
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Buttons in Widgets [message #80560 is a reply to message #80559] Mon, 25 June 2012 07:14 Go to previous messageGo to previous message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
On 25 juin, 14:36, David Fanning <n...@idlcoyote.com> wrote:
> Helder writes:
>> I'm don't like that much how the buttons of IDL widgets
>> look (Widget_button) even when using the /bitmap argument.
>> I am exploring the solution of using a draw_widget, making
>> it of the same color as the background(*) and then filling
>> it is with my own drawing. The difference between the two
>> methods is that the borders of the buttons will appear
>> different: for a button widget these are defined by the
>> IDL and for a draw widget one can have "no" borders or
>> define how these look like. Another advantage is that
>> one can have the effect of having an something like
>> an icon floating on a background.
>> Has anybody tried doing such things?
>
> Of course. :-)
>
> To be "real" for users (i.e., they get the idea they have
> "pushed" something) you need to have two states for your
> button: a "normal" look and a "pushed" look. Depending
> on how you draw your button, this sometimes is just a
> matter of reversing some or all of your colors (you need
> about 6-10 to make a decent looking button). You definitely
> want to build this as a compound object-widget, because
> there is going to be a lot of things your button will
> want to remember.
>
> In the end, I think you will find that it is probably
> just a whole lot easier and more efficient to change
> your attitude about WIDGET_BUTTON and use it. :-)
>
>> (*) Is there a way to find out what color the base
>> widget has and/or to define it?
>
> Use the System_Colors keyword to Widget_Info to get
> this information. I carried this information around in
> cgColor for years, but no one I knew (including me
> after I gave up on making my own buttons) ever
> used it, so I removed it. It requires a window
> connection to obtain these colors, so don't distribute
> your application widely, unless you wish additional
> headaches. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
>

Regarding "pushed" appearance, it seems to me only a matter of
exchanging some predefined bitmaps at each push, like by doing:
WIDGET_CONTROL, your_button, SET_VALUE=pushed ? OnBitmap :
OffBitmap, /BITMAP
keeping you able to use any further widget_button facility you like.
alain.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: GPULIB troubleshoot
Next Topic: Coyote graphics resizeable window

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

Current Time: Thu Oct 09 20:25:59 PDT 2025

Total time taken to generate the page: 0.39907 seconds