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

Home » Public Forums » archive » Re: cgColor and Widget_Draw Frame problem
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: cgColor and Widget_Draw Frame problem [message #81853 is a reply to message #81852] Thu, 01 November 2012 13:45 Go to previous messageGo to previous message
DavidF[1] is currently offline  DavidF[1]
Messages: 94
Registered: April 2012
Member
Helder writes:

> the result of the
>
> print, !D.x_size, !D.y_size
>
> is
>
> 102 102

What I really want to know is what is the result of *this* command:

print, !D.x_Vsize, !D.y_Vsize

> print, !Version
>
> { x86_64 Win32 Windows Microsoft Windows 8.2 Apr 10 2012 64 64}

Most interesting, since this the version of IDL I ran your example
program in, and I didn't have any problem whatsoever. What version
of Windows are you running?

> After 15 min of debugging, I found out something quite strange... I monitored the values !d.x_size and !d.y_size. Some when in cgSnapshot you use wSet to select the current window. At this point the size of the window is reduced from 102 to 100 pixel... This seems to overcome the error:

> PRO TestcgColor
> wBase = widget_base()
> wDrawColor = WIDGET_DRAW(wBase, XSIZE=100, YSIZE=100, FRAME=1)
> WIDGET_CONTROL, wBase, /REALIZE
>
> print,'Before wSet:',!d.x_size, !d.y_size
> ThisWindow = !d.Window
>
> wSet, ThisWindow
> print,'After wSet:',!d.x_size, !d.y_size
> print, cgcolor('white')
>
> END


> I don't understand "why" this changes. My guess is that this is a bug, but then it must be quite old...
>
> One way to come around this problem would be to use wSet before you get the values of the size of the image and call cgSnapShot in cgColor (line 410 in my version).

Well, I sorta hope people know which window they are drawing
in when the *call* cgColor (but, I realize this is asking too much
of most widget programmers), but I am still holding out hope for
a more elegant solution.

I'm very curious to know if !D.X_VSIZE is the same as !D.X_SIZE in
your special case.

Cheers,

David
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: a behemoth bubble sort
Next Topic: One RETALL is not enough

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

Current Time: Fri Oct 10 15:07:35 PDT 2025

Total time taken to generate the page: 1.74275 seconds