Hi!
I am a .Net developer and I can help with the OSX version of Pinta. I
have been working for over a year in OSX but I haven't worked in Mono.
I have everything I need to start developing and I have cloned the
Pinta 1.1 sources.
Currently I have Lion and Mono 2.10.8 installed.
I compiled the code with MonoDevelop and while debugging it I got the
following exception
System.ArgumentException: 'gtk-close' is not a valid resource name of
assembly 'Pinta.Resources, Version=1.1.0.0, Culture=neutral,
PublicKeyToken=null'.
on:
Pinta.Resources.ResourceLoader.GetIcon
return Gdk.Pixbuf.LoadFromResource (name);
As the icon name starts with gtk I assume it is a Gtk icon, but
Gtk.IconTheme.Default.HasIcon (name) is returning false.
The application Trace shows a Warning that could be the origin of the
problem:
Loaded assembly: /Users/limowankenobi/Projects/Git/Pinta/bin/Pinta.exe
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/2.10.8/
lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll
[External]
Loaded assembly: /Users/limowankenobi/Projects/Git/Pinta/bin/
Pinta.Core.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/2.10.8/
lib/mono/gac/gtk-sharp/2.12.0.0__35e10195dab3c99f/gtk-sharp.dll
[External]
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/2.10.8/
lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll
[External]
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/2.10.8/
lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll [External]
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/2.10.8/
lib/mono/gac/glib-sharp/2.12.0.0__35e10195dab3c99f/glib-sharp.dll
[External]
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/2.10.8/
lib/mono/gac/atk-sharp/2.12.0.0__35e10195dab3c99f/atk-sharp.dll
[External]
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/2.10.8/
lib/mono/gac/gdk-sharp/2.12.0.0__35e10195dab3c99f/gdk-sharp.dll
[External]
Loaded assembly: /Users/limowankenobi/Projects/Git/Pinta/bin/
Mono.Addins.dll [External]
(Pinta:2589): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/2.10.8/
lib/mono/gac/Mono.Cairo/4.0.0.0__0738eb9f132ed756/Mono.Cairo.dll
[External]
Loaded assembly: /Users/limowankenobi/Projects/Git/Pinta/bin/
Pinta.Resources.dll
Resolved pending breakpoint at '/Users/limowankenobi/Projects/Git/
Pinta/Pinta.Resources/ResourceManager.cs:37' to Pixbuf
Pinta.Resources.ResourceLoader:GetIcon (String, Int32) [0x00000].
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/2.10.8/
lib/mono/gac/pango-sharp/2.12.0.0__35e10195dab3c99f/pango-sharp.dll
[External]
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/2.10.8/
lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll
[External]
Loaded assembly: /Users/limowankenobi/Projects/Git/Pinta/bin/
Pinta.Gui.Widgets.dll
Unhandled Exception: System.ArgumentException: 'gtk-close' is not a
valid resource name of assembly 'Pinta.Resources, Version=1.2.0.0,
Culture=neutral, PublicKeyToken=null'.
at Gdk.PixbufLoader.InitFromAssemblyResource
(System.Reflection.Assembly assembly, System.String resource)
[0x00000] in <filename unknown>:0
at Gdk.PixbufLoader..ctor (System.Reflection.Assembly assembly,
System.String resource) [0x00000] in <filename unknown>:0
at Gdk.Pixbuf..ctor (System.Reflection.Assembly assembly,
System.String resource) [0x00000] in <filename unknown>:0
at Gdk.Pixbuf.LoadFromResource (System.String resource) [0x00000] in
<filename unknown>:0
at Pinta.Resources.ResourceLoader.GetIcon (System.String name, Int32
size) [0x0001e] in /Users/limowankenobi/Projects/Git/Pinta/
Pinta.Resources/ResourceManager.cs:41
at Pinta.ResourceManager.GetIcon (System.String name, Int32 size)
[0x00000] in /Users/limowankenobi/Projects/Git/Pinta/Pinta.Core/
Managers/ResourceManager.cs:41
at Pinta.ResourceManager.GetIcon (System.String name) [0x00000] in /
Users/limowankenobi/Projects/Git/Pinta/Pinta.Core/Managers/
ResourceManager.cs:36
at Pinta.Gui.Widgets.OpenImagesListWidget..ctor () [0x00000] in
<filename unknown>:0
at Pinta.OpenImagesPad.Initialize
(MonoDevelop.Components.Docking.DockFrame workspace, Gtk.Menu padMenu)
[0x00000] in <filename unknown>:0
at Pinta.MainWindow.CreateDockAndPads (Gtk.HBox container) [0x00000]
in <filename unknown>:0
at Pinta.MainWindow.CreatePanels (Pinta.WindowShell shell) [0x00000]
in <filename unknown>:0
at Pinta.MainWindow.CreateWindow () [0x00000] in <filename unknown>:
0
at Pinta.MainWindow..ctor () [0x00000] in <filename unknown>:0
at Pinta.MainClass.Main (System.String[] args) [0x00000] in
<filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: 'gtk-
close' is not a valid resource name of assembly 'Pinta.Resources,
Version=1.2.0.0, Culture=neutral, PublicKeyToken=null'.
at Gdk.PixbufLoader.InitFromAssemblyResource
(System.Reflection.Assembly assembly, System.String resource)
[0x00000] in <filename unknown>:0
at Gdk.PixbufLoader..ctor (System.Reflection.Assembly assembly,
System.String resource) [0x00000] in <filename unknown>:0
at Gdk.Pixbuf..ctor (System.Reflection.Assembly assembly,
System.String resource) [0x00000] in <filename unknown>:0
at Gdk.Pixbuf.LoadFromResource (System.String resource) [0x00000] in
<filename unknown>:0
at Pinta.Resources.ResourceLoader.GetIcon (System.String name, Int32
size) [0x0001e] in /Users/limowankenobi/Projects/Git/Pinta/
Pinta.Resources/ResourceManager.cs:41
at Pinta.ResourceManager.GetIcon (System.String name, Int32 size)
[0x00000] in /Users/limowankenobi/Projects/Git/Pinta/Pinta.Core/
Managers/ResourceManager.cs:41
at Pinta.ResourceManager.GetIcon (System.String name) [0x00000] in /
Users/limowankenobi/Projects/Git/Pinta/Pinta.Core/Managers/
ResourceManager.cs:36
at Pinta.Gui.Widgets.OpenImagesListWidget..ctor () [0x00000] in
<filename unknown>:0
at Pinta.OpenImagesPad.Initialize
(MonoDevelop.Components.Docking.DockFrame workspace, Gtk.Menu padMenu)
[0x00000] in <filename unknown>:0
at Pinta.MainWindow.CreateDockAndPads (Gtk.HBox container) [0x00000]
in <filename unknown>:0
at Pinta.MainWindow.CreatePanels (Pinta.WindowShell shell) [0x00000]
in <filename unknown>:0
at Pinta.MainWindow.CreateWindow () [0x00000] in <filename unknown>:
0
at Pinta.MainWindow..ctor () [0x00000] in <filename unknown>:0
at Pinta.MainClass.Main (System.String[] args) [0x00000] in
<filename unknown>:0
If I swallow he exceptions like this:
public static Pixbuf GetIcon (string name, int size)
{
Pixbuf ret = null;
// First see if it's a built-in gtk icon, like gtk-new
if (Gtk.IconTheme.Default.HasIcon (name))
return Gtk.IconTheme.Default.LoadIcon (name, size,
Gtk.IconLookupFlags.UseBuiltin);
try
{
// Get it from our embedded resources
ret = Gdk.Pixbuf.LoadFromResource (name);
}
catch(Exception)
{
// swallow the Exceptions...
}
return ret;
}
The application starts and seems to work. But it shows two warnings:
(Pinta:2719): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
(Pinta:2719): GdkPixbuf-WARNING **: GdkPixbufLoader finalized without
calling gdk_pixbuf_loader_close() - this is not allowed. You must
explicitly end the data stream to the loader before dropping the last
reference.
When trying to open an Image, the open dialog didn't show any file
when the filter was "Image Files" (only folders) until I changed the
filter to "All Files". I only have jpeg files in this machine so I
didn't tested with other types.
I opened a jpeg image and draw some lines over it with the pencil and
saved the image. It worked as expected.
Let me know what can I help with.
Limo Wan Kenobi