[plt-scheme] saved window configurations

From: Robby Findler (robby at cs.uchicago.edu)
Date: Wed Sep 26 11:33:21 EDT 2007

That's roughly right. Details below.

On 9/26/07, Grant Rettke <grettke at acm.org> wrote:
> On 9/26/07, Robby Findler <robby at cs.uchicago.edu> wrote:
> > FWIW, I think that this would make a fairly easy tool to write (one
> > that did a firefox-like thing and remembered the open files from last
> > time). I'd be happy to help anyone if they try to write it and get
> > stuck.
> Thinking through this, would it work something like this? (Questions inside)
> 1.      Create a tool, and IDE mixing installed with
> drscheme:get/extend:extend-unit-frame.

you want to extend the tab, I htink, not the frame.

> 2.      On IDE close, catch the "IDE Closing Event"… is there one?

tab close. should be. (I add it if not)

> a.      Allow for the default IDE closing behavior to execute, file saves
> and so forth.
> 3.      Before closing
> a.      Send get-tabs to the IDE to get a list of all the open editors
> b.      For each tab

no -- just override tab-specific methods. let drs loop for you.

> i.      check if a file is actually opened within the tab
> ii.     get its filename
> iii.    get the position of the cursor within the file
> 1.      send editor get-start-position

you probably want the admin's view in addtion to the
get-start-position and get-end-position. Also be sure to test resizing
the window.

> c.      Persist the file name/position list somewhere, where?

use the preferences.

> 4.      On IDE start up
> a.      Catch that event… is there one?

THere's not an event per se; your code just runs when your tool is
installed. Do it at the top-level of the unit or maybe in one of the

> b.      Get the list of files that were open
> c.      For each file
> i.      Open a new tab for that file, how do you open a new tab?
> ii.     Set the cursor location
> 1.      send editor set-position

Use finder:open-file to open the files. You'll get back a frame and
then you can use methods to move the view around and set the position.


Posted on the users mailing list.