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

Home » Public Forums » archive » Re: UNIX Resize 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: UNIX Resize Problem [message #63206 is a reply to message #63205] Fri, 31 October 2008 07:04 Go to previous message
liamgumley is currently offline  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/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: compiling external programs 64 bit OS X
Next Topic: Re: release plans of idl

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

Current Time: Sun Oct 12 01:17:44 PDT 2025

Total time taken to generate the page: 0.31236 seconds