MAGIC Magic Mailing List
 
 

From: R. Timothy Edwards (tim AT stravinsky DOT jhuapl.edu)
Date: Mon Jan 05 2004 - 10:37:51 EST

  • Next message: Yolande.berbers: "Hey mate, hows it going??"

    Dear Calin,
    
    > It would be nice if one could specify the geometry for the windows used by 
    > magic (the console and main window especially). In the old magic this
    > could be done via Xresources. For the new magic this works for the main
    > window if magic is started without the -w switch. 
    
    The Tcl command for resizing the windows is (for example):
    
    	wm geometry .layout1 1000x750+100+100
    
    Resizing the console is a bit trickier:
    
    	tkcon master wm geometry . 100x16+150-50
    
    The console resize command can be put in the ".magic" file to execute on
    startup.  However, the current TCL wrapper version does its own sizing when
    the window is created, which means you can only resize after the window
    has been created.
    
    -----------------
    
    I have, in response to your request, added new features in my 7.2 source
    (which I will post soon as revision 63).  The additions allow you to set,
    on the command line or in the .magic file:
    
    	set Opts(geometry)  1000x750+100+100
    
    which then becomes the default geometry for all windows.  Alternately, or
    additionally, you can set the target size specifically for each window
    (which takes precedence over the setting above):
    
    	set Winopts(.layout1,geometry) 1280x1024
    	set Winopts(.layout2,geometry) 1000x800
    
    I also decided to take this one step further, adding a second argument
    to the "openwrapper" command, so that you could potentially set up a
    different geometry for a specific window:
    
    	set Winopts(.testwin,geometry) 800x600
    
    and get that special window size and/or placement by opening using:
    
    	openwrapper "" .testwin
    
    Finally, revision 63 will also have a slightly simpler variant of the
    "tkcon master..." command, which is (for example):
    
    	magic::consolegeometry 90x10
    
    Note that, per Tk protocol, the magic window geometry width and height are
    in pixels but the console geometry width and height are in characters.  As
    the geometry string is simply passed along by Tk to the X server, the
    same allowances and restrictions apply as they do to the Xresources string
    (for instance, placement is optional).
    
    					Regards,
    					Tim
    


  •  
     
    Questions? Contact Rajit Manohar
    cornell logo