Using Gtk#
Posted: Wed Mar 05, 2008 1:00 pm
When I try to compile the Gtk# example below I get an internal compiler error. Because the members of the instantiated Gtk.Window class cannot be accessed directly, the only way to get it to work is to use the 'sharp' prefix:
Compiler message:
What is the problem?
"""
gtk-test.cobra - Gtk# example.
To compile:
cobra -v:2 -compile -lib:/usr/lib/mono/gtk-sharp-2.0/ -r:gtk-sharp.dll gtk-test.cobra
To run:
mono gtk-test.exe
"""
use Gtk
class Program
def main is shared
Gtk.Application.init
window = Gtk.Window('A Window')
window.show # FAILS
# sharp'window.Show()' # OK
Gtk.Application.run
Compiler message:
- Code: Select all
Cobra Command Line 0.7.4
Copyright (C) 2003-2008 by Cobra Language LLC.
OS Version: Unix 2.6.22.17
CLR Platform: Mono
CLR Version: 2.0.50727.42
...
error: COBRA INTERNAL ERROR / ArgumentException / An element with the same key already exists in the dictionary.An element with the same key already exists in the dictionary.An element with the same key already exists in the dictionary.An element with the same key already exists in the dictionary.
Compilation failed - 1 error, 0 warnings
What is the problem?