Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
rescaling draw widgets: is there an easier solution to this?
Hi, I would like to have a widget_draw (or widget_window) within a widget_base with stuff on the top, left, right and bottom of the draw widget. If I change the size of the base with the mouse, I would like the draw widget to expand accordingly. I found a way to do this, by keeping track of the size of the widgets (base and draw). However, I'm wondering if there is a cleaner way to do this. Here is an example code: pro testWidgetRescale_event, event widget_control, event.top, get_uvalue=struct newBaseGeometry = widget_info((*struct).wb, /geometry) baseDiff = [newBaseGeometry.xsize-(*struct).baseGeometry.xsize, newBaseGeometry.ysize-(*struct).baseGeometry.ysize] widget_control, (*struct).wd, xsize = (*struct).drawGeometry.xsize+baseDiff[0], ysize = (*struct).drawGeometry.ysize+baseDiff[1] (*struct).drawGeometry = widget_info((*struct).wd, /geometry) (*struct).BaseGeometry = newBaseGeometry end pro testWidgetRescale wb = widget_base(/tlb_size_events, /tlb_move_events, column=3, /BASE_ALIGN_CENTER, /ALIGN_CENTER) void = widget_label(wb, value=' some stuff here', /align_center) row2 = widget_base(wb, /column) void = widget_label(row2, value=' some stuff here') wd = widget_draw(row2, xsize=500,ysize=500) void = widget_label(row2, value=' some stuff here') void = widget_label(wb, value=' some stuff here', /align_center) widget_control, wb, /realize baseGeometry = widget_info(wb, /geometry) drawGeometry = widget_info(wd, /geometry) widget_control, wb, set_uvalue=ptr_new({wb:wb, wd:wd, baseGeometry:baseGeometry, drawGeometry:drawGeometry}) xmanager, 'testWidgetRescale', wb, event_handler = 'testWidgetRescale_event' , /no_block end thanks, Helder
Re: rescaling draw widgets: is there an easier solution to this?
Helder writes: > I found a way to do this, by keeping track of the size of the widgets (base and draw). However, I'm wondering if there is a cleaner way to do this. That's how I do it. :-) Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ Sepore ma de ni thue. ("Perhaps thou speakest truth.")
On Monday, October 27, 2014 4:30:54 PM UTC+1, David Fanning wrote: > Helder writes: > >> I found a way to do this, by keeping track of the size of the widgets (base and draw). However, I'm wondering if there is a cleaner way to do this. > > That's how I do it. :-) > > Cheers, > > David > -- > David Fanning, Ph.D. > Fanning Software Consulting, Inc. > Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ > Sepore ma de ni thue. ("Perhaps thou speakest truth.") thanks David. I was hoping in some hidden "dynamic_resize_magic" keyword... Cheers, Helder
Helder writes: > thanks David. I was hoping in some hidden "dynamic_resize_magic" keyword... Scheduled for 2035, I think. :-) David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ Sepore ma de ni thue. ("Perhaps thou speakest truth.")
On Monday, October 27, 2014 11:36:40 AM UTC-4, Helder wrote: > thanks David. I was hoping in some hidden "dynamic_resize_magic" keyword... > Automatic resizing would be my number 2 request for a new widget system. Number 1 would be the ability to easily add color to widget buttons, so as to upgrade from the 1980's look. --Wayne
On Monday, October 27, 2014 5:57:49 PM UTC+1, wlandsman wrote: > Number 1 would be the ability to easily add color to widget buttons, so as to upgrade from the 1980's look. I am working on style sheets for widgets in FL. Here is an example: pro test base=widget_base(xs=200, ys=100) text=widget_text(base, value="Hello world!", xoff=50, yoff=30, xs=100, ys=50, $ style_sheet="background-color: green; color: yellow") widget_control, /realize, base xmanager end It produces this widget: http://fl.t15.org/hello.png But is is far from complete :-( regards, Lajos