SIL LSDev Linux Development

Language software for Linux and Mac OS X

Status of WorldPad on Linux

Our team’s main focus has been to port the SIL FieldWorks suite of translation and linguistic programs from Windows to Linux.

We’ve ported the core C++ parts which are the foundation of all the FieldWorks applications. A big part of the remaining work is in C# to get Translation Editor and Language Explorer to build and run in Linux.

But tackling Translation Editor would be quite a big step and open up a lot of difficulties all at once. So first we’re working to port WorldPad. Although WorldPad won’t be as widely used as Translation Editor, our work on WorldPad is a stepping stone on the way to completing the Translation Editor because many pieces of WorldPad are shared by Translation Editor. And completing the Translation Editor will be easier if we first work on WorldPad.

Read the rest of this post…

Complex text input

I’m working on text input methods at the moment. That is, how pressing keys on the keyboard turn into text on the screen.

For English and other languages with a roman alphabet, this is fairly simple. Pressing ‘A’ on the keyboard results in the letter ‘A’ on the screen. But with some languages, this is not so simple. For example:

  • Chinese and other ideographic languages have several thousand characters, one key to one character really doesn’t work (unless you have a lot of desk space and very long arms).
  • Thai doesn’t have so many characters, but there are rules on how they can be used. For example, there are marks to denote rising and falling tones for sounds, but sounds may not rise and fall at the same time. A good computer program will respect these rules.

There are facilities in both Linux and Windows that deal with these issues. We have made a demonstration program to learn how to integrate the Linux methods of input into our own program. Read the rest of this post…

Access to the underlying C GtkObjects from gtkmm

gtkmm is the C++ API for development of GTK+ and GNOME applications. Its developers have made a great job of wrapping the underlying C API, making it relatively easy to use GTK+ and GNOME within a C++ application. However, in the interests of writing methods that can be readily invoked from a variety of languages, it is preferable to use objects from the underlying C implementation as arguments and return values rather than their object-oriented counterparts. It will then be possible to call those C++ methods from C# code.
Read the rest of this post…

GTK# on Windows

Our GUI development on Linux is done with GTK2+, and in the case of Mono, GTK#.

On a GTK based Linux system using Mono, this setup ‘just works’. It takes a little bit more setting up on Windows, but with a small amount of effort, it is possible to take compiled programs straight from Linux and run them on Windows with Microsoft .NET (It is also possible to use Mono on Windows).

This is the procedure I used to use GTK# on Windows:

Read the rest of this post…

The look and feel of cross-platform user interfaces

Someone just asked me,

What’s the best way to do a cross-platform product that has the native XXX look and feel?

It depends on exactly what you mean by native look and feel. There are several GUI toolkits that produce the right pixels, so that in a screen shot it would look just like an XXX application, but which still don’t produce an application that feels right. For example, on Mac, if you select a range of text and then press right-arrow, what happens? The insertion point should move to the right boundary of the previous selection. However, on Windows, it typically moves one character beyond that point. I find this inconsistency very frustrating in several of the cross-platform apps that I use regularly.

Also, applications may have the right pixels for all the individual controls, but the overall layout of their UI doesn’t feel comfortable for an XXX user. The classic example is the relative ordering of OK and Cancel buttons in dialogs. Most toolkits now take care of this transparently, but there are other things, such as the extent to which toolbars are used, that can be uncomfortable for users. For example, Mac applications typically use toolbars very sparingly, and Windows apps use them extensively.

Read the rest of this post…

Explorations in GTK# part 2

Glade and custom widgets

Glade and GTK# are a powerful combination. One that we are using for our Mono re-implementation of WorldPad. It’s quite possible to build a very functional application using just the standard widgets provided by GTK, but sometimes specific functionality is needed which is not found in the regular set of widgets.

In this instance, a "custom widget" can be inserted into a Glade interface. This is easy to do, but filling in the custom widget with something useful is a bit more tricky.

Custom widgets in Glade
Above: Custom widgets in Glade.
Below: Custom widgets being implemented as "ColorPickerButton"s in the application.
Custom widgets in use

How do we implement the custom widget?

Read the rest of this post…

Explorations in GTK# part 1

GTK.Settings: What and how

For the standard set of GTK# widgets, there is a property or method to change almost any aspect of the widgets appearance and behaviour. But some things require using GTK.Settings. For example setting the palette in a colour selector, or changing the cursor behaviour in a text entry.

How…? To set a property, the following methods can be used:
Read the rest of this post…