[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Print format question for the Experts
David Fanning wrote:
>
> To only print certain lines, you can do...
>
> PRO Example, K
; n*K-th lines only will be printed
> max_rec=20
> base = Widget_Base()
> text = Widget_Text(base, Value="", Scr_XSize=200, YSize=1)
> screenSize = Get_Screen_Size()
> xCenter = screenSize(0) / 2
> yCenter = screenSize(1) / 2
> geom = Widget_Info(base, /Geometry)
> xHalfSize = geom.Scr_XSize / 2
> yHalfSize = geom.Scr_YSize / 2
> Widget_Control, base, XOffset = xCenter-xHalfSize, $
> YOffset = yCenter-yHalfSize
> Widget_Control, base, /Realize
> maxnumber = StrTrim(max_rec, 2)
if n_elements(k) eq 0 then k=1
> for i=0,max_rec-1 do begin
> wait, 0.5 ; Or read a record or whatever.
if i mod k eq 0 then number = StrTrim(i, 2)
> Widget_Control, text, Set_Value='Record number ' + number + $
> ' out of ' + maxnumber + '.'
> endfor
> Widget_Control, base, /Destroy
> END
Cheers,
Pavel