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

Re: [sc-users] Archive questions (OS X crash)




On 31 Dec 2005, at 11:55, crucial felix wrote:


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)

as I said - that is what I do. does that mean I'm a 'real programmer' now? I'm not sure I believe this 'real programmer' business - that's like calling yourself a 'real musician' or a 'real painter' or a 'real artist'. I had a 'real plumber' turn up once - he flooded the both bathrooms and the study in a matter of minutes.


when I look at my code It never ceases to amaze me at how much of it is actually just GUI stuff.

after you start doing things the way hundreds of thousands of real programmers do it, you will be shocked that you put up with all that mess for so long.

it's not a mess there's just a lot of it. perhaps I'll check your GUI stuff?



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