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

Re: Widget Resize on Mac

Wow!  This is getting quite interesting.  I had taken the liberty of
pestering Pavel for help which he supplied generously.   He tracked the
problem down to my top level base definition which looked like the following:

TLB = Widget_Base(Title = 'Generic Window',$
           column = 1,  /Base_Align_Center, $
           TLB_Size_Events = 1, MBar = MenuID)

Other than the menu bar, the only content of the widget base was a draw
widget.   Pavel suggested that I set Base_Align_Center to zero.  It solved
the problem.

Your solution is interesting because the window is an IDLgrWindow (as opposed
to a Direct Graphics window, unless your Info.mainWindow is a object wrapper
around the Direct Graphics window.)  I think you are resizing the draw_widget
explicity as opposed to resizing the base_widget.   The value 12 is a
surprise because Pavel mentioned that the ever-present Mac window scroll bars
occupy 48 pixels.



Struan Gray wrote:

> Ben Tupper, btupper@bigelow.org writes:
> > Has this been dealt with before?  if so, what is the solution?
>     An ugly hack.
>         My top level bases send only resize events, so in my event handler
> I can have something like this (info is a pointer to a state
> structure):
>   Case event.id of
>     (*info).myID: begin    ; resize event from top level base
>       if !version.os_family eq 'MacOS' then begin
>         xsize = event.x-12
>         ysize = event.y-12
>       endif else begin
>         xsize = event.x
>         ysize = event.y
>       endelse
>       (*info).mainWindow -> SetProperty, Dimension=[xsize, ysize]
>       end
>   else: ; blah blah blah
>   end  ; case event.id
>         The value 12 was found by trial and error, but works for both
> direct and object graphics windows (with the appropriate set size
> commands.
> Struan

Ben Tupper
Bigelow Laboratory for Ocean Science
West Boothbay Harbor, Maine
     note: email address new as of 25JULY2000