[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-dev] cross-platform gui wrappers - draft
Hey,
nice idea!
On 10 Jan 2006, at 21:19, James Harkins wrote:
Very early draft, to be precise.
I thought I would get a jump on making some wrappers for the SC gui
objects. I wrote some code last night to generate class definitions
for all the SCViews that would mimic each one's interface, and then
started on some manual cleanups.
The basic idea is that each class has a method, *viewSourceClass, to
indicate which "real" GUI object to use. So, right now I'm using
SCWindow, SCButton etc., but if I wanted to use SwingOSC instead, I
could just replace all the viewSourceClass-es to be JSCWindow,
JSCButton etc.
Why not using an which is configurable at runtime?
With a classVar in GUIWrapper?
Why not naming the classes just View, Window, TabletView... instead
of GUIView...?
Why not creating abstract classes for all nessecary GUI elements, and
then inherit the original methods classes?
This way it would be easier to create just another GUI implementation...
- most of the methods return ^view.myMethod, but many of the
corresponding source class methods returns "this" -- that's bad
because in the case of variable assignment, then you end up talking to
the real object instead of the wrapper. Setters are fixed but not
things like SCWindow-closed (which do an action and then return
"this").
- there are probably a bunch of redundant methods in these
definitions.
- I want to move all the *viewSourceClass methods into a separate file
to make it simpler to switch between cocoa and SwingOSC.
Other comments? I wanted to ask before spending a huge amount of
time on it.
hjh
PS Sorry it isn't an .sc file--I was doing a little cleanup at work
(naughty boy).
Pfui-bah! ;-)
2c (at 10pm after a loooooong day :-)
Till