Re: UNIX Resize Problem [message #63187] |
Fri, 31 October 2008 14:41 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
liamgumley@gmail.com writes:
> Fair enough. I just like the idea that if I resize the window, it
> stays at the size I selected, rather than jumping to some other size.
> That's the way my Safari web browser works when I'm looking at an
> image, so it's a familiar behavior.
OK, I finally surrendered and gave up my quixotic quest
to create windows with the correct aspect ratio. Three
days is enough time spent. This version of my IMGWIN
program appears to work on my SUSE machine, running KDE,
but my confidence level is not terribly high for other
flavors of UNIX or for the Macintosh, which I have not
been able to check yet.
Would someone be kind enough to give it a quick once-over
and sent me a report. It is probably best if you download
a fresh version of the Catalyst Library (there have been
a few minor changes). The IMGWIN program is in the applications
sub-directory of that library:
http://www.dfanning.com/programs/catalyst.zip
Or, if you have a relatively recent version of the library,
you can just download the ImgWin program:
http://www.dfanning.com/programs/catalyst/imgwin.pro
Thanks for your help.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: UNIX Resize Problem [message #63199 is a reply to message #63187] |
Fri, 31 October 2008 08:20  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> It appears I can get it to work "correctly" if I don't
> try to resize the TLB after it has been resized to fill
> the display. (Of course, I mean by "correctly"
> taking into account the *MANY* differences between
> Windows and UNIX machines with respect to how their
> sizes are reported! This, it seems to me, *is* something
> ITTVIS could correct.)
Although, God knows, if they did, probably every decently
written IDL program on the planet, including ENVI, would
break. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: UNIX Resize Problem [message #63200 is a reply to message #63199] |
Fri, 31 October 2008 08:15  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
liamgumley@gmail.com writes:
> Fair enough. I just like the idea that if I resize the window, it
> stays at the size I selected, rather than jumping to some other size.
> That's the way my Safari web browser works when I'm looking at an
> image, so it's a familiar behavior.
Yeah, I'm beginning to think you are absolutely right
about this. I was being too clever. Back to basics, I
think. :-)
It appears I can get it to work "correctly" if I don't
try to resize the TLB after it has been resized to fill
the display. (Of course, I mean by "correctly"
taking into account the *MANY* differences between
Windows and UNIX machines with respect to how their
sizes are reported! This, it seems to me, *is* something
ITTVIS could correct.)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: UNIX Resize Problem [message #63201 is a reply to message #63200] |
Fri, 31 October 2008 08:06  |
liamgumley
Messages: 74 Registered: June 2005
|
Member |
|
|
On Oct 31, 9:11 am, David Fanning <n...@dfanning.com> wrote:
> liamgum...@gmail.com writes:
>> I write a GUI demo for my book (described in Chapter 9) where an image
>> is displayed in a resizable widget. If you resize the GUI window, the
>> window retains the size you selected, and the image is redrawn inside
>> the window while maintaining the image aspect ratio
>
> Well, it's not what I want, but it may be what
> I end up with if I don't solve this problem soon.
> I do know how to display an image in a way that
> keeps it's aspect ratio. What I'm trying to do is
> keep all that extra space in the window out of
> the equation. :-)
Fair enough. I just like the idea that if I resize the window, it
stays at the size I selected, rather than jumping to some other size.
That's the way my Safari web browser works when I'm looking at an
image, so it's a familiar behavior.
Liam.
|
|
|
Re: UNIX Resize Problem [message #63202 is a reply to message #63201] |
Fri, 31 October 2008 07:32  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
pgrigis@gmail.com writes:
> This thread makes me wonder, does java
> (just picking another cross platform programming
> language with widgets) have the same problems?
> I mean, is it really difficult making this things work
> across platforms, or it is just ITTVIS that doesn't care
> about fixing these issues?
For all I know, this could be a KDE Window Manager
problem. (The latest version of SUSE is causing
all kinds of havoc around here as people's computers
are updated.) But, given what I know about the vagaries
of IDL widgets, I have a feeling there is a good chance
the blame can be shared.
Cheers,
David
P.S. I don't know about JAVA. It's a pretty hard problem,
I will give them that. And if you stick to basics, things
work pretty well. It's always when I try to do something
clever that I run into problems. "Meat and potatoes" should
be our motto, always. :-)
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: UNIX Resize Problem [message #63203 is a reply to message #63202] |
Fri, 31 October 2008 07:21  |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
This thread makes me wonder, does java
(just picking another cross platform programming
language with widgets) have the same problems?
I mean, is it really difficult making this things work
across platforms, or it is just ITTVIS that doesn't care
about fixing these issues?
Ciao,
Paolo
David Fanning wrote:
> liamgumley@gmail.com writes:
>
>> I write a GUI demo for my book (described in Chapter 9) where an image
>> is displayed in a resizable widget. If you resize the GUI window, the
>> window retains the size you selected, and the image is redrawn inside
>> the window while maintaining the image aspect ratio
>
> Well, it's not what I want, but it may be what
> I end up with if I don't solve this problem soon.
> I do know how to display an image in a way that
> keeps it's aspect ratio. What I'm trying to do is
> keep all that extra space in the window out of
> the equation. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: UNIX Resize Problem [message #63205 is a reply to message #63203] |
Fri, 31 October 2008 07:11  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
liamgumley@gmail.com writes:
> I write a GUI demo for my book (described in Chapter 9) where an image
> is displayed in a resizable widget. If you resize the GUI window, the
> window retains the size you selected, and the image is redrawn inside
> the window while maintaining the image aspect ratio
Well, it's not what I want, but it may be what
I end up with if I don't solve this problem soon.
I do know how to display an image in a way that
keeps it's aspect ratio. What I'm trying to do is
keep all that extra space in the window out of
the equation. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: UNIX Resize Problem [message #63206 is a reply to message #63205] |
Fri, 31 October 2008 07:04  |
liamgumley
Messages: 74 Registered: June 2005
|
Member |
|
|
On Oct 31, 8:40 am, David Fanning <n...@dfanning.com> wrote:
> I have an image in a resizeable top-level base widget.
> The idea here is that when the window is resized, the
> window should retain the same aspect ratio as the image.
> So, for example, when the user hits the button that will
> force the TLB to fill the display, I will get that event
> and instead of making the draw widget holding the image
> that size, I will constrain it, and the TLB should shrink
> naturally to the size of the draw widget.
David,
I write a GUI demo for my book (described in Chapter 9) where an image
is displayed in a resizable widget. If you resize the GUI window, the
window retains the size you selected, and the image is redrawn inside
the window while maintaining the image aspect ratio. I'm not sure if
this is what you want, but in any case the demo program is imgui.pro,
and it is contained in
http://gumley.com/PIP/Sample_Programs/PIP_programs.zip
The relevant code section from the main program is
tlb = widget_base(column=1, mbar=mbar, title=title, $
/tlb_size_events)
and from the event handler
;- Get change in size of top level base
if (info.version lt 5.4) then begin
xchange = event.x - info.base_size[0]
ychange = event.y - info.base_size[1]
endif else begin
widget_control, event.id, tlb_get_size=base_size
xchange = base_size[0] - info.base_size[0]
ychange = base_size[1] - info.base_size[1]
endelse
;- Set new size of draw window
info.draw_xsize = (info.draw_xsize + xchange) > 200
info.draw_ysize = (info.draw_ysize + ychange) > 200
widget_control, info.draw_id, $
xsize=info.draw_xsize, ysize=info.draw_ysize
Liam.
Practical IDL Programming
http://www.gumley.com/
|
|
|