[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

2880.0. "How to determine smallest window size?" by MOVIES::HOWELL_MA (another fine product of the Sirius Cybernetics Corp.) Tue Jun 05 1990 11:25

    I'd like to determine the smallest size a window can actually be when
    created with X$CREATE_WINDOW. If I create a window that is 10x10 for
    example the actual window that is displayed is much larger, and
    rectangular! This reason I'd like to find this out is to scale my image
    so that it is displayed in a window of the correct proportions.
    
    I've tried X$GET_GEOMETRY, X$GET_WINDOW_ATTRIBUTES, X$GET_NORMAL_HINTS
    and X$GET_SIZE_HINTS to no avail. What I'd like is the equivalent of
    the size hint X$L_SZHN_MINX/Y but set by the window manager instead of
    the client.
    
    Thanks
    
    Mark...
T.RTitleUserPersonal
Name
DateLines
2880.1window manager involved ??GSRC::WESTHelp stamp out and abolish redundancy !Wed Jun 06 1990 16:0217
RE: <<< Note 2880.0 by MOVIES::HOWELL_MA "another fine product of the Sirius Cybernetics Corp." >>>
                     -< How to determine smallest window size? >-

>>    created with X$CREATE_WINDOW. If I create a window that is 10x10 for
>>    example the actual window that is displayed is much larger, and
>>    rectangular! This reason I'd like to find this out is to scale my image

  I'll bet that there is the window manager frame window 'wrapped' around
your window.  If that is the case then you will get what you described.  The
window is 'larger' because of the title bar and borders.

  Now, you can either account for this when you create your window or create
your window with overrideRedirect set to TRUE, this will give you a window of
the size you requested.

						-=> Jim <=-

2880.2MOVIES::HOWELL_MAanother fine product of the Sirius Cybernetics Corp.Thu Jun 07 1990 04:568
    Thanks for your reply Jim. Yes, you are quite correct, I'm creating a
    regular window with the window manager 'frame', which is what I want.
    What I'd like to do is to get the window manager to tell what the
    smallest size of window it will create. Does anybody know how to get
    the minimum width and height from the window manager, or how to
    calculate it?
    
    Mark...
2880.3Hmmm...GSRC::WESTHelp stamp out and abolish redundancy !Thu Jun 07 1990 10:426
  When you used XGetSizeHints what property did you use?  If you used
WM_SIZE_HINTS then I thought this would have the desired information.

						-=> Jim <=-

2880.4Just wait and find outDECWIN::KLEINThu Jun 07 1990 11:5311
I don't think you can find out ahead of time how big (small) the window will
be.  In general, a window manager may do last-minute calculations to figure
it out, based on (possibly) application-specific XDefaults resource values.  

I would just wait for the MapNotify event and then do an XGetGeometry.
Or wait for the first Expose event and use the width,height that are
passed in the event.  Prior to receiving these events, you should not
be writing to the window anyway, so there is no harm in deferring your
knowledge of the window size until this time.

-steve-