Skip to end of metadata
Go to start of metadata

Summary

The following is a sample GTK# application written in Boo. Unlike some applications, this one actually does something useful - its an image (porn?) browser, and its cross platform to boot!

The code, with comments, comes in just over 100 lines. You will need the glade file below (make sure to save it on whatever output directory you compile the program to).

Thanks to incomp from IRC for spiffying up the sample a bit.

Prerequisites

GTK# Runtime
There are two different runtimes for windows users: the "Win32 Installer" and the "Win32 Runtime Installer." As poorly named as they are, all you need to know is that "Win32 Installer" is for developers and "Win32 Runtime Installer" is for end-users. Guess which one you are.

Mono and GTK# Runtime if you're running under Linux.

The Code.

The Glade File

Pornbrowser.glade is the mark-up file that represents your fancy user interface ,built entirely in Glade. Put it in the output directory of the sample application (where the .exe resides).

The Screenshots

Amazingly, this application runs under Windows and Linux – without recompiling! Who needs Java anymore? (wink)

  • No labels

6 Comments

  1. As I tried to save the source code and compiled it with "booc", I got the following message:

    ljm@x30 ~/study/mono $ booc pornbrowser.boo
    pornbrowser.boo(56,26): BCE0024: The type 'Gtk.ListStore' does not have a visible constructor that matches the argument list '((System.Type))'.
    1 error(s).

    I've installed mono and gtk# with gentoo emerges. Hints? Thanks.(smile)

  2. Too many parentheses. The code should be: store = ListStore( Gdk.Pixbuf, string )

  3. Hi, I have a problem. booi, booc and mono are not telling me that I have errors in code, but when Window should be shown, nothing happens.

  4. Is there any sane way to create GUI apps using Boo?

    This example isn't really helpful.

  5. Hi. This is a nice browser. I have a issue . How compile this on Linux and Windows?

    I try this:

    gmcs -r:System.Windows.Forms.dll -r:System.Drawing.dll pornbrowser.cs

    but seam i got this error:

    pornbrowser.cs(2,1): error CS8025: Parsing error
    Compilation failed: 1 error(s), 0 warnings

    my mono libs is here : /usr/lib/mono

    $ ls
    1.0  compat-1.0       gmime-sharp              mono-addins
    2.0  compat-2.0       gtk-sharp                monodoc
    2.1  gac              gtk-sharp-2.0            ndesk-dbus-1.0
    3.5  gecko-sharp-2.0  gtksourceview-sharp-2.0  ndesk-dbus-glib-1.0

    Regards

  6. If I attempt to compile this example as retrieved on 2010-10-30 on a 64-bit Win7 machine, it fails with this error on the assignment of ResponseType.Close:

    C:\Downloads\boo-0.9.3.3457-bin\bin>booc.exe .\k\p003.boo
    Boo Compiler version 0.9.3.3457 (CLR 2.0.50727.4952)
    .\k\p003.boo(36,25): BCE0055: Internal compiler error: Value was either too large or too small for a UInt64..
    1 error(s).

    If the offending objects (ResponseType.Ok and ResponseType.Close) are wrapped in System.Enum.ToUInt64(...) then we get

    C:\Downloads\boo-0.9.3.3457-bin\bin>booc.exe .\k\p003.boo
    Boo Compiler version 0.9.3.3457 (CLR 2.0.50727.4952)
    .\k\p003.boo(36,40): BCE0120: 'System.Enum.ToUInt64' is inaccessible due to its
    protection level.
    .\k\p003.boo(51,43): BCE0120: 'System.Enum.ToUInt64' is inaccessible due to its
    protection level.
    2 error(s).

    Any ideas?