On Dec 31, 2005, at 1:34 AM, kernel wrote:
or you could say - "if by accident you close the window then your
shit keeps on running!"
anyway, I'm there I always keep arrays of GUI objects it's the only
way.
you can avoid becoming a real programmer for as long as you like.
but if you actually do it the correct way, everything will become much
easier and you will get work done faster and with fewer bugs.
views should (by their actions) set values in models (which can be
simple arrays, variables or objects)
I wasn't really thinking about storing performance data. but there
really is no other reason to archive an SCWindow.
so why am I doing it? I had an idea but............well, it's gone.
the only reason to wish to archive a window (or views) is to store the
window position, size and position of views etc.
in that case you would store all those params in a dict or something
and save that.
you would not and could not archive an actual window. an SC gui
object (SCViews) has a pointer to a C++ object that exists in a
different universe. if you archive the SCView you would store that
number (which is just an integer) but when you woke from your long
sleep and re-instantiated, the number would be worthless. it would
refer to a C++ object that has long since passed out of earthly
existence.
next you'll want to try to archive the computer itself. "can i save
the physical object of the computer itself into the file ? why not ?"
"is it possible to put the archive into the archive ?"
>> james harkins :
I actually use a slightly different approach, where I set up a fixed
number of views at the beginning, then swap objects in and out of
them
as needed. It saves a lot of overhead in terms of removing views and
creating new ones.
in MVC terms the thing that is managing those views and swapping the
models is the controller. you might benefit from formally calling it a
controller and then all of your primary actions (like "make a window",
"display this model on a view") would be methods on that object.
(which you might already do : i'm just further elaborating for anyone
else reading )
http://c2.com/cgi/wiki?ModelViewController
-felix
_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users