Older blog entries for elanthis (starting at number 204)

Cross Platform GUIs: Reloaded

haruspex: Unfortunately, that isn't true. There is *no* pure-technical mechanism (framework/API) that can cover the differences between platforms. You will, at the very, very least, need to redesign GUI description files for each target OS.

If you are talking only about the low-level API, GTK+ probably works Well Enough. It is of course the native toolkit for GNOME, can be made to use Qt for drawing widgets in KDE, can be made to use the Win32 API for drawing widgets in Windows, and (if someone cared enough to bother) it could be made to use Aqua to draw widgets in OS X. The widgets themselves would be Close Enough.

There is no way to write a "high level" description that is *actually* going to be cross platform. Why? Because you can't write a high level description of what the application does and expect to have a computer figure out what to do with it. (If we could, we wouldn't be programming anymore - we'd just type in "manage finances" and the computer would write gnucash or something for us.)

The problem is that the differences between platforms can run rather deep. File saving might differ between having you explicitly save to a file and having the content constantly updated in a database meta-filesystem. That's an extreme example.

A real-world "today" example would be in custom dialogs. If it's a preferences dialog, then is it instant-apply or not? What about button labelling? The actual label you use can vary a lot for each platform. Do you *really* expect developers to, for each button, enter 2 to 4 different labels? What happens when a new platform comes out that needs a new label?

Using something like GTK, you can at least standardize the API, and then use Glade to ship completely different UI files for each platform. For new platforms, you can just drop in a new glade file (perhaps users can write their own, too).

Another problem, even when using GTK, is that you are locked into an LCD system. If a platform has a particular feature that no other platform has, you can't code against that feature.

If you break up your application properly, recoding the GUI for each platform should not be a major issue. You can also fine-tune and tweak the GUI for each platform to perfection.

[#] Comments

Kerberos and the World

I've recently gotten MIT Kerberos5 running on my servers both at home and at work. It was a fun (and easy) exercise, for the most part. There was a bit of trouble with Debian's OpenSSH being old (and not supporting gssapi-with-mic), but I fixed that with some unstable-apt goodness.

Now my problem is, I can't find any good network services that are gssapi-enabled. All of my services authenticate out of the Kerberos database fine, using PAM, but I'm lacking that single sign-on that I was aiming for.

Notably, there seems to be no way to get Dovecot or Exim to use GSSAPI.


[#] Comments

Scriptix2 Work

I've picked up on the Scriptix2 work some more. The compiler is now actually generating bytecode, although I have no interpreter to check correctness. And interpreter is of course the next step.

The second Big Thing I need after that is the function binding logic. Right now it's only binding functions based on name, which of course isn't going to work for function overloading, which is a *huge* piece of the Scriptix2 puzzle.

See, while there will be user types, these will just be opaque types. There are no "methods" only functions. This simplifies the syntax. So instead of obj->method(), you'd always have method(object). We need overloading for sure, of course, since namespacing all the functions would result in a very complex API. get_name(obj) is so much nicer than object_type_get_name(obj).

A feature I then plan on adding is runtime-selection of functions. Normally they will be bound at compile time resulting in superb interpreted performance. (Far better than most script languages which are highly dynamic; such as Scriptix1.) Run-time binding will allow for virtual functions. However, our virtual functions will be far more powerful than the C++/Java/C# virtual methods. See, instead of just declaring a whole function as virtual, we define individual arguments as virtual. The result is that a function can have multiple virtual arguments. So not only can the behavior vary by the type of the object being worked on, but it can vary based on the types of the arguments passed to that function. This is, iirc, called multi-dispatch in other languages that have a similar feature.

[#] Comments

Affects for Real

For those who are wondering, yes, I have *actually* started writing the affects code. It might be a while before it's done and committed, but it's being worked on.

Only, what, 4 years later than most people would prefer it had been done? ;-)

[#] Comments

Cross Platform UIs

Raph: please do duplicate the UI for each platform. That is 100% the correct thing to do. Even when you have a cross platform library (and BTW, GTK+ runs natively on Windows and runs in X11 on OS X, and it's possible to port GTK+ to Aqua if you really wanted it), you have to understand that that doesn't mean that the app actually behaves properly on each platform.

Take something like OpenOffice.org. It works, looks, and acts great on Windows. Bring it to Linux and it still works, looks, and acts great - as a Windows-based UI. Same on OS X. The app feels completely alien and out-of-place anywhere but Windows.

Cross platform UI libraries can't fix this fact. They can let you write code that works on multiple platforms, but they can't let you design user interfaces that work on multiple platforms. At least none of the currently popular cross platform toolkits.

Your absolute best bet is to do what the Abiword developers did - split the UI code from the main app, and write UI code for each target platform. That way, not only does it run on OS X, it follows the Aqua HIG and generally looks, acts, feels, and behaves like any other well-designed Aqua-native app. On GNOME, it looks and acts mostly right. On Windows, you can't tell it apart from any other (properly) Designed for Windows app. Same for the other platforms it supports.

There is just so much more to developing a GUI than just how to draw buttons. That's all a technical solution (i.e. a toolkit library) can solve for you - the low-level details of getting widgets on screen and responding to events. When it comes to layout, widget choice, behaviour of widgets, interface integration, and so on, you really do need to redesign the UI for each target platform. Otherwise you end up with a monstrosity that feels alien and uncomfortable for users of all platforms other than your main target.

If you do want a technical solution due to development time, stick with GTK+. Just make sure you use libglade. That way you can ship a different .glade file for each platform. Plus, since it's rendering engine is replaceable (themeable), it can look native on all major platforms. (It's feel might be a little alien, but it should be Close Enough(tm) in most cases.)

[#] Comments


<img src="http://www.awemud.net/people/elanthis/kanar-me.jpg" alt="Daedron at KANAR" style="margin: 1em; float: left; border: 1px solid black; margin-top: 0px;" />

Someone snapped a surprise picture of me at the last KANAR event. There are a couple others that were taken (which were not surprises), but surprisingly, the surprise photo is my favorite. That's a lot of surprise.

Yesterday I drove up to Port Huron to play even more KANAR. (Ya, I'm a geek, get over it.) Another player (who was the GM for a number of years) was running a special one-day module ("adventure") at his parents' farm, and asked me to come and NPC for him. It was fairly fun, if incredibly wet and rather cold. Something I'd definitely be willing to do again, except for maybe the two hour drive part. I'm not very fond of sitting in one place for a long time. If I can't get up and walk a few times an hour at the minimum, I go nuts. Not to mention the pain my back ends up in.

Two more weekends is yet another event. Yay. ^_^ I still wish these things could run every other weekend or so. Except for the whole bit where I rather need the time on my weekends to do other things. Ah well.

I'm finally getting back into the AweMUD work. The other KANAR web team members are working on various things (which I'm not much in agreement with, but oh well) so I'll let them deal with things until they need something new coded up, or I get sick of the bugs and poor design and step in to fix things.

I'm actually planning on getting (drumroll please) magic affects in AweMUD coded. As in, I might start writing the code as soon as I'm done posting this. Whoo!

Affects will work something like so: a group of affect detail objects will be made, and then stored as a single affect object. This affect object will then be stored in a list on the characters. There won't be any built-in logic for duplicate affects or anything like that - the magic system will deal with that if it wants to.

The affect objects will hold some meta-data to be used by the magic system, or nano-tech system, or whatever system is used to apply affects in the actual game. Things like the name of the affect, the class of affect (magic, tech, psionic, natural, poison, etc), the level of the affect (arbitrary number to be used for duplicate/stacking rules), granter of the affect (caster of a spell, whatever), and duration.

[#] Comments


I've been getting a lot of work done on the KANAR web site. I'm the main coder, and somewhat minorly a designer, of the new site. It's been a lot of fun. I'm not sure why, but working on it seems more fun than working on one of my real-job sites, even though it's doing the *exact same thing*. I'm thinking it might be the meetings. Real live, face-to-face meetings, with other coders and designers, who are all competent at what they do. I sit there on my iBook hacking on the site (and actually listening and responding to the meeting conversation - I'm getting damned good at that) while the content managers go over the stuff they need to see online, the designers go over some cool design ideas, and I code up whatever they happen to be discussing without them knowing it and showing them a functional demo by the time they're done. ;-)

If you're wondering why AweMUD work has slowed, that's why right there. I just have a few more main bits of the site that I personally need to hammer out (being the only real coder at the moment; the other coder is also our manager until the end of the year, and he's swamped with management stuff), and then the designers and content managers can handle most of the work from there on out.

I'd also like to give some "mad props" to Jesse, one of our two designers and also a personal friend, who came up with a gorgeous and theme-fitting main design for the site. He's also going to be doing a lot of various graphics, like portraits of some of the characters using the same art-style and color scheme as the site graphics, and tons of other various little tid bits. The site really does look amazing.

It'll hopefully go live in a couple months, and then I can show it off. ^_^

[#] Comments

Political Spam

Today I got a very interesting type of spam I've never seen before. It was a political advertisement. An anti-GW advertisement.

The message itself was what you'd expect from someone with the spammer mentality. As much as I absolutely despite GW as a president, the message made even me mad - at the person who wrote it. It's filled with a number of incredibly questionable "facts" (I cannot verify many of them). I'd love nothing other than to see GW lose the election, but if he loses because people are voting based on lies, then democrary has failed.

My old high school's motto was "democracy can only work when our country's citizens are educated." That doesn't just mean that the citizens have a high school level (or even college level) background. It means that the voters have to actually know the facts on what they're voting.

I have some friends who are voting pro-GW for the absolutely stupidest fucking reason I can imagine: Kerry seems softer. What the hell does that have to do with how you run a country? These same people call themselves Republicans despite that, if you ask them their opinions on all the major (and a number of minor) issues, they are more often against the usual Republican stances. These friends of mine (who are great people otherwise) are a perfect example of what that high school motto was getting at. They are a detriment to democracy. Their votes, which are based on falsehoods and bogus criteria, dilute the votes of people who are voting based on the truth and criteria that are related to what makes a good president. What could be worse than someone who votes Republican because they think they're Republican, even though they're closer to being a Democrat or Libertarian? What could be worse than voting for any candidate based on their party instead of based on the actual candidate, since even GW doesn't agree with all Republican beliefs. The same is true for other parties and candidates; if you vote for Kerry because he's a Democrat which you think you are, even though you're closer to being a Republican or Libertarian, you're part of the problem.

This spam I received simply infuriates me. Because I know that there are a lot of people who might be pro-GW, and for perfectly valid reasons (even if I don't personally agree with them), who will get this or a similar message and change their opinion.

Leading the people like sheep to get rid of a bad ruler is just as bad as the people being led like sheep to vote for the bad ruler. Either way, the system stops being a democracy.

Damned spammers.

[#] Comments


Seems spam is getting a little more frequent on the blogs comments here. As a simple fix, I've added a feature that requires a simple math expression to be evaluated and the result entered. If the entered result is incorrect, no comment will be posted. The math expressions are always addition using two numbers in the range of one through nine. I figure, if you aren't capable of answering the question, you probably don't need to be posting to my blog anyhow.

[#] Comments

KANAR - Finally!

Finished up another KANAR event last weekend. It's been two months since the last, so I'm quite glad to have been able to go again. The next event is at the end of this event, on the weekend of Halloween. Always fun in a fantasy LARP where the GMs like to toss powerful undead out by the bucketload.

The weekend wasn't too bad. A bit light on the combat/NPCs. A lot of the people that usually NPC (including myself) were a bit pre-occupied as our normal characters. ::sigh:: There was especially a lack of low-level monsters, which would have been nice for our handful of newbies that came this event.

Of the two friends I wanted to drag out, only one managed to make it. He had a great time though, and plans on returning for the next event. Glad he enjoyed it.

[#] Comments

195 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!