Python/C# Mania: New Bindings Expand KDE Languages

Today marks a special coincidence. First,
Adam
Treat
released the initial version of
Qt bindings for C#,
which consists of 476 Qt classes converted to C#.
The bindings work with the Mono
compiler, runtime environment and class libraries, enabling a fully Open Source implementation of C# for Qt. While not yet ready for
a real application, Adam has managed to write and execute a
Hello World! program
(screenshot).
KDE bindings are on the drawing board. Shortly thereafter,
Phil Thompson, Jim Bublitz and
theKompany.com
released KDE 2 and KDE
3 bindings for Python
. Together with the Java, Objective C and C bindings in the
kdebindings
module, as well as the
Ruby
bindings
, KDE is providing developers a broad gamut of application
development languages. Great work, Adam, Phil and Jim!

Dot Categories: 

Comments

Incredible, it looks so integrated. Although thinking about it, the reality of a toolbar embedded xmms would be fairly limiting. Forget I mentioned it.

Alex

by Neil Stevens (not verified)

A few of us once considered writing a KWin plugin that was also a Noatun plugin...

Now that Noatun has a dcop interface it'd actually be easy to do.

How's that for integration? :-)

Hmm.. you could do toolbar integration too by writing a custom widget style...

.. but then we'd have to use noatun.

no offense, but an analogy of wmp::winamp on the windows side to noatun::xmms can be drawn; that is, noatun is just simply too heavy to deal with the everyday and mundane task of playing mp3s and just maintaining a userlist.

also, noatun needs to have better video support, imho.. something like mplayer (cross-platform) or aviplayer(x86-only).

This is what is known as a complaint. There are differences between a complaint and a suggestion. A complaint is ambiguous, unhelpful, based on obsolete and remote evaluations, and put in the wrong place. A suggestion is none of these things. Thank you (steps off soapbox)

Oh man, please do! That would be awesome. I go back and forth between Noatun and XMMS right now, but I think it will be Noatun when KDE3 comes out. Can't wait to see your Hayes playlist ;-)

by 21mhz (not verified)

Glad to see you guys at the KDE side of the fence
get your share of languages. I'm sure it will bring
many new developers to your cause.

by Otter (not verified)

I've tried to understand what Mono offers, but I'm confused about what these bindings provide relative to .NET. (I looked into installing Mono and trying it out but was scared off by the requirement to upgrade glib. I've had enough experience updating GNOME libraries to be afraid of that.)

The point of .NET is what the early promise of Java was, right? It creates a portable executable that works on any platform with the right VM. So...

1) Will Mono provide the ability to run .NET executables? If so, using what widgets?

2) Is the goal of the Gtk and Qt bindings to C# to make portable bytecodes (or whatever is used) that will run on other systems where those toolkits are available? Or are they just alternatives to using C or C++ to make compiled native executables, just using a different language?

3) In the big picture, if .NET takes off and we'll be needing to run .NET executables on Linux, what will we presumably be using to do that?

by Anonymous Coward (not verified)

First off, see Ximian's Mono site for accurate answers. Short answers follow.

1) Yes. GTK+/GNOME or Qt.

2) The bindings allow a ".NET" program to say "make a button" and get a (GTK+/Qt) button. Unlike (non-GNOME-ified) Java, where all platforms use the Java Swing widgets, Mono will use "native" widgets. (Incidentially, Java can display GTK+ widgets in lieu of the Swing widgets as well.)

3) Mono. More precisely, a Mono-based bytecode interpreter and possibly a special "gcc .NET" with the capability to compile .NET bytecodes into native binary on a specific OS/CPU combination. For example, one might download a .NET application and compile it for Linux 2.6 on a PowerPC G5 to avoid the overhead of bytecode interpretation. (Since both Java and Perl manage to run pretty decently WITH bytecode interpretation, it's unlikely to be a major necessity.)

by dc (not verified)

> (Since both Java and Perl manage to run pretty decently WITH bytecode interpretation, it's unlikely to be a major necessity.)

*shrug* I guess that's why most end-user apps are made with C/C++/Object Pascal (Delphi).

by Richard Dale (not verified)

I thought Visual Basic was quite popular.

-- Richard

by Justin Malcolm (not verified)

From looking at the code, it seems that the "make a button" and get a (GTK+/Qt) button scenario is still a dream. If you have to say "make a Qt button" then it is pretty specific to Qt and KDE.

From my understanding, the MONO folks are writing things so that you can write an application on Windows that will use Win32 widgets on that platform but use GTK+ widgets when run on Linux.

It would be great if you could just specify Qt or GTK+ as a default on the Linux side and truly have one codebase to execute on all three platforms (Win32, Gnome, and Qt).

Does anybody know if this is being worked on?

by Richard Hestilow (not verified)

The relevant API is called System.Windows.Forms, and is the equivalent to Java's AWT. The current plan is to get the Gtk+ and Qt bindings into shape before writing an API wrapper to access them via System.Windows.Forms.

by .coder (not verified)

What I liked from here, that I can compile C# into native code either it is Win32 or Linux - it is superb!

Java has no such feature, if only it had!

by Babbacombe (not verified)

Great news! That's exactly what Java does. Unless you explicitly force java.compiler=NONE on startup, you're using the native code compiler (Hotspot).

See the Hotspot FAQ.

by Babbacombe (not verified)

Great news! That's exactly what Java does. Unless you explicitly force java.compiler=NONE on startup, you're using the native code compiler (Hotspot).

See the Hotspot FAQ.

by Non-believer (not verified)

>The point of .NET is what the early promise of Java was, right? It creates a portable executable that works on any platform with the right VM. So...

The idea of Mono is to achieve something like the (relative) platform-independence of Java.
Now, I don't consider Microsoft evil, but it is not in their interest, and certainly not in their game plan for .NET to promote cross-platform portability despite whatever announcements are being made.
You'd be very naïve to believe that MS would not block any move that threatened their profits of Windows, so go figure what the point of .Net is.

by Julien Olivier (not verified)

Hi

I read that KDE will have a C# binding but I think KDE/C# applications won't feature as many functionalities as other KDE apps. I say that because I don't think C# is able all that KDE can do and vice-versa. For example, how will I include a khtml part into my app in KDE using C# ? However, if it's possible, it must not be portable, is it ?

Is it just a QT/C# binding or will we be able to convert any KDE app to C# ?

by Richard Dale (not verified)

"Is it just a QT/C# binding or will we be able to convert any KDE app to C# ?"

Adam is hoping to have some KDE C# bindings ready for KDE 3.1. If you want portable code, then just stick to the Qt api, or if you want maximum functionality and desktop integration then use the Qt/KDE api. The choice is exactly the same as if you were writing code in C++.

The KDE C# code will look much the same as the Java bindings code. Here is an example of loading a KHTMLPart in Java:

khtmlpart = new KHTMLPart(this);
khtmlpart.begin();

khtmlpart.write("KSimpleBrowser" +
"

To load a web page, type its URL in the line " +
"edit box and press enter,

" +
"");

khtmlpart.end();

This is from the from the KDE 2 Development book KSimpleBrowser example translated to Java. It's in the cvs under kdebindings/kdejava/koala/test/simplebrowser.

-- Richard