[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Secret to resizing text widgets



Bernard,

I think you only have to comment out one line. Unless, of course, I
misunderstand your question. The resulting widget doesn't "exactly"
match where the user released the mouse, but it is close on NT at least.

-Ronn

 <=======Start of file testbox.pro==================>

 pro testbox_event, event

 widget_Control, event.top, Update = 0
 widget_control, event.top, get_uvalue = info

 ;PRINT DEBUG
 widget_control, event.top, tlb_get_size = tlbsize
 ;print,'1-Base size:',tlbsize

 widget_control, info.widtext, scr_ysize = event.y
 widget_control, info.widtext, scr_xsize = event.x
 ;print,'( '+strtrim(event.x,2)+', '+strtrim(event.y,2)+')'

 ;Reset the widbase widget size
;RLKLING JUST COMMENT OUT THE NEXT LINE?
; widget_Control, event.top, xsize = tlbsize[0]-0, ysize = tlbsize[1]-0
 widget_control, event.top, /update

 ;PRINT DEBUG
 widget_control, event.top, tlb_get_size = tlbsize
 ;print,'2-Base size:',tlbsize
 wait, 0.01

 end

;***********************************************************************
******
 pro testbox
 widbase = widget_base(column = 0,$
 TLB_Size_Events = 1)

 widbuttonclose = widget_button(widbase,$
 value = 'Close',$
 ysize = 30,$
 xsize = 120)

 widtext = widget_text(widbase,$
 scroll = 1,$
 editable = 1,$
 yoffset = 35,$
 scr_xsize = 200,$	;Units are pixels
 scr_ysize = 300)

 info = {$
 widbuttonclose:widbuttonclose,$
 widtext:widtext }

 widget_control, widbase, /realize, Set_Uvalue = info
 xmanager, 'testbox', widbase, /no_block
 end

 --
> Bernard Puc AETC, INC.
> bpuc@va.aetc.com 1225 Jefferson Davis Highway #800
> (703) 413-0500 Arlington, VA 22202
>
--
Ronn Kling
Ronn Kling Consulting
email: ronn@rlkling.com

 Application Development with IDL book at : http://www.rlkling.com
 UPDATED FOR IDL 5.3!

Shareware and Freeware at: http://www.rlkling.com/


Sent via Deja.com http://www.deja.com/
Before you buy.