Yeah, I'm coding with version 7.1 on my Mac OS 10.5 and running on versions 8.0 on a Windows XP and 6.4 on a Windows Vista (backwards, I know..)
Here is some quick code I wrote up that seems to react pretty much the same way as my original program:
pro TestSB_event, ev
common all, ids
case ev.id of
ids.baseID: begin
topbasesize = [ev.x, ev.y]
mapsize = ulong([.95,1.5]*topbasesize)
widget_control, ev.id, xsize=topbasesize[0], ysize=topbasesize[1]
widget_control, ev.id, scr_xsize=topbasesize[0], $
scr_ysize=topbasesize[1]
widget_control, ids.drawID, xsize=mapsize[0], ysize=mapsize[1]
widget_control, ev.id, /clear_events
end
ids.buttonID: begin
widget_control, ev.top, /destroy
return
end
else: &
endcase
end
pro TestSB
common all, ids
;Initialize variables
ids = {baseID:0L, buttonID:0L, drawID:0L}
;Set base sizes
topbasesize = ulong([.9,.9]*get_screen_size())
mapsize = ulong([.95,1.5]*topbasesize)
;Create widgets
ids.baseID = widget_base(/base_align_center, /column, map=0, /scroll, $
/tlb_size_events, xsize=topbasesize[0], ysize=topbasesize[1], $
x_scroll_size=topbasesize[0], y_scroll_size=topbasesize[1])
ids.buttonID = widget_button(ids.baseID, value='Done')
ids.drawID = widget_draw(ids.baseID, xsize=mapsize[0], ysize=mapsize[1], $
frame=2)
labelID = widget_label(ids.baseID, value='Can you see me??')
;Give user control
widget_control, ids.baseID, /realize, /map
xmanager, 'TestSB', ids.baseID, /no_block
end
|