[Mono-dev] idea summary: Swing in Mono?...

BGB cr88192 at hotmail.com
Sat Feb 7 20:42:48 EST 2009


well, I still don't know if anyone would be so interested in the idea, but 
the basic idea has more or less boiled down to this:
it would be potentially useful if someone would go and port Swing (and maybe 
also parts of AWT) to Mono.

there is an implementation located in GNU ClassPath, which could be used as 
a starting point if anyone were interested (and can tolerate the plain GPL, 
although an alternative liscense would be preferable I would think...).

another possible advantage of Swing is that the API already exists and is 
well-established, likely making it be less uncertain (trying to win support 
for some obscure and unknown API, ...), as well as making it much easier to 
specify and implement (the edge cases would be necessary variations between 
the Java framework and .NET framework, ...).

it could also exist almost purely inside managed code, potentially only 
needing the use of native code for the Canvas (could be implemented as a set 
of interfaces, or as an abstract class), allowing some level of independence 
from the underlying VM (and, in particular, not require necessarily linking 
against 3rd party GUI libraries...). so, the GUI-proper can be made 
self-contained...



why it matters IMO, is that there are some things that, from what I am 
aware, GTK and friends has not done in the past (such as rendering the GUI's 
to GL textures and allowing the user to supply their own mouse and keyboard 
input into the backend, ...). but, then again, it is also worth noting that 
I have not messed with GTK much in years (nor have I really investigated 
GTK# in any real detail).

my primary reasons for not using GTK much being:
it is not nearly so workable on Windows (PITA to get built, ...);
does not mix well with my general approach to application architecture;
does not play ideally with OpenGL-based apps (and probably worse with 
DirectX / Direct3D, though I don't really use these personally as they are 
not available on Linux...);
..

OTOH, Swing, would allow user-supplied "Canvases", which would allow 
render-to-texture and like, ... (and does not look like it will try to 
hijack the main-loop or other such things...).


looking into it, MS had also ported Swing to .NET in the past, but had it 
under a "non-commercial use only" liscense.


but, alas, my looking into all of this has been only superficial, and I am 
not likely to work on such a project (at least at this point in time), since 
it would be "outside my area"...

in my case, I may well (eventually) start making use of Swing in my 
projects, but this will be mostly because my Java support is likely to be 
functional well before my .NET support is, and probably also because I could 
pump it into a GL texture, which would allow it to play better with my 
existing overall project design... (likely render-to-texture and draw the 
GUI as an overlay, ...).

(for the time being, I have my own GL-based GUI framework in C-land, but I 
don't really expect this to be long-lived...).


however, I am also aware that this may not mix with the politics / 
"best-interest" of the existing community (which I would guess has a lot 
invested already in GTK# and similar?...), and so I will probably not press 
the issue much further.


or such...




More information about the Mono-devel-list mailing list