Wednesday, August 24, 2005

*thump* Ow, watch your feet, GTK#!

I spent a couple of hours yesterday prototyping up a UI in GTK#. My real problems started once I started doing anything beyond 'the basics' - scary exceptions that were being thrown from the bowles of gtk itself. I gave it another whack today and stopped immediately because I just ran into an error where the application crashed when I unsubscribed from an event. Not so unexpected is the fact that everything works fine when running under Mono (in Windows). 'cept I don't want to use Mono on Windows.

So, today, I was toying with wx.NET. It seems promising, but there's a lot of rough edges. A lot. There are many, many fields that take integers instead of enums, and practically everything is undocumented. Its a bit unwieldly, like using MFC, but the API is simplier and does not require the herculean efforts of strength required to make simple stuff 'go.' Still, its unmaintained - they only update the library to keep it in sync with wxWidgets, and I hate programming against dead-end APIs. 'specially ones that are not particularily polished.

I'm not sure what to do now. The main reason for using GTK# was because, although its chock full of annoyances when dealing with simple stuff, it is powerful enough to let me do some pretty cool things with a little less effort than the equivilent using S.W.F. Same goes for wx.NET.

I'm not sure what I should do now; I obviously can't continue with GTK#, but I'm hesitant to pick wx.NET. I don't know of any other crossplatform .NET UIs, and using S.W.F would be a pain in the ass and require some P/Invoking, I think.

Should I take another look at booclipse and try to integrate some of my ideas into it? I hate Java.


Anonymous said...

There is also Mono WinForms, a cross platform implmentatin of the Windows Forms library (currently listed as 98% complete).

Don't be so quick to shy away from wx.NET. I've used it in 2 major projects now, and the API gets more comfortable as time goes on. There were some slight problems with it on the Mac side, but that's only because the Mac port is still in its infancy. If you plan on continuing with wx.NET, I'd suggest you look into Dialog Blocks, a very nice GUI editor.

I don't think I've ever been more frustrated with a GUI API than I have been with GTK#. Like you mentioned, simple things require unnecessarily complex code.

Like I said earlier, I'd still like to help out on the project if you're looking for a team.

Anonymous said...

I've been impressed by the work on in mono on linux.

Maybe we can find a way to make s.w.f. work without the dllimport stuff or else find linux equivalents. already has some equivalents like XplatUI.SetCaretPos. See the files in mono svn:

But a trickier issue is using an embedded html viewer to view documentation. On Windows, you can embed IE, but on Linux you have gtkmozembed/gecko-sharp whatever. Maybe a generic wrapper could be made like the XPlatUi stuff.

But besides windows.forms and GTK# there isn't much else.

Bet's On said...

Mike, Hansen:
"Don't be so quick to shy away from wx.NET. I've used it in 2 major projects now, and the API gets more comfortable as time goes on"

That's interesting. Can you tell me more about your experiences using wx.NET?

"Like I said earlier, I'd still like to help out on the project if you're looking for a team."

I've never really coordinated programming efforts with other people before, so I'm not even sure where I would begin. But that's no excuse not to try; you seem to have more experience than I, where would you suggest we begin?

I think it would be Better to have another look at wx.NET. It has the seemingly powerful StyledTextControl, which appears to be a wrapper for Scintilla.

Relatively undocumented in wx.NET, but the API is very similar to wxPython which has *much* documentation.

I really want to avoid S.W.F, because I feel that having to P/Invoke something would eventually become a necessity.

Anonymous said...

Mike Hansen:

I built my University senior design project using wx.NET. The program was a file-swapping utility that worked through e-mail and was required to function on Windows, Mac, and Linux.

Linux Screenshot

Mac Screenshot

The biggest challenge with wx.NET was multithreading issues. Once I figured out that the method of signaling a control on the main thread is posting a custom event to the queue, it was cake.

As far as coordinating, it could be done through a source code repository. Do you have any experience with Subversion?

What kind of experience do you have as a programmer?

Bet's On said...

Pretty impressive! I like how wxWidgets apparently adopts the Mac-style tabs.

Like most things in life I know enough of Subversion to get by - I am no SVN wizard by any means. ;)

My programming style really isn't formal, and most of my projects are small and aimed at mostly at myself.

What I originally envisioned for 'Boodle' was pretty simple; a Boo source editor with code completion / colorization scanner / background compiliation - two out of three are pretty simple, using the Boo.Lang.Compiler API.

Optionally, the ability to launch/load a source file in an interactive interpreter, side-stepping the 'save, compile, open interpreter, load assembly' dance when you just want to test some classes interactively.

I hadn't put much thought into multiple file support yet, if any at all.

That's all off the top of my head, anyway.

Anonymous said...

Mike Hansen:

I'm not an SVN wizard either and my programming style is not incredibly formal.

I'd thought the same things would be great for a Boo IDE as well as the ability to integrate with NAnt and NUnit. Maybe a simple project system that uses the NAnt build format.

I know the most difficult part for me would be the lexer for the StyledTextControl and the code completion. I could definitely handle the GUI and project system, though.

Bet's On said...

Looks like our abilities complete each other. ;)

It looks like you've got gmail, so if you've got Google Talk or another IM client, message me at and we'll discuss setting up a repository somewhere (tigris? novell forge?) and where we'll go from there.