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

Re: Resizing object graphics on X

If you take a look at a caveat for DIMENSIONS keyword for the
IDGgrWindow object, then you will notice that it says "Note - Changing
DIMENSIONS properties is merely a request and may be ignored for various
reasons. "
Therefore, I think that your Windows toolkit fullfills that request *for
some reason*, while X ignores it for *some other reason*. Try the
following, it works on either one. Besides, at first I could see nothing
but a black box on both Mac and X, because the machines I have do not
(apparently) support a default OS backing store. So I added that, too.

;***** MODIFIED *********
pro t_event, event

widget_control, event.top, get_uvalue=info, /no_copy

info.oWindow->SetProperty, Dimension=[event.x, event.y]
widget_control, info.draw, draw_xsize=event.x, $
info.oWindow->draw, info.oView

widget_control, event.top, set_uvalue=info, /no_copy




oModel = obj_new('IDLgrModel')
oView = obj_new('IDLgrView')

oPlot = obj_new('IDLgrPlot', x, y)

oPlot->GetProperty, XRANGE=xr, YRange=yr
xs = Norm_Coord(xr)
xs[0] = xs[0] - 0.5
ys = Norm_Coord(yr)
ys[0] = ys[0] - 0.5
oPlot->SetProperty, XCoord_conv=xs, YCoord_conv=ys

oModel->add, oPlot
oView->add, oModel

base = Widget_base( uname='t', /tlb_size_events)
draw = Widget_draw( base, graphics_level=2, retain=2 )
widget_control, base, /realize
widget_control, draw, get_value=oWindow
oWindow->Draw, oView

info = { oWindow: oWindow, $
         oView:   oView , draw: draw }

widget_control, base, set_uvalue=info, /No_Copy

xmanager, 't', base