New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gtk] Spinner is not working because of TargetInvocationException #283

Closed
atauenis opened this Issue Jan 28, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@atauenis
Contributor

atauenis commented Jan 28, 2014

On Linux (Mono 2.10.8.1), when I create a new Spinner widget in default manner, the XWT throws an TargetInvocationException:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: libgtk-win32-2.0-0.dll
at (wrapper managed-to-native) Xwt.GtkBackend.Spinner:gtk_spinner_new ()
at Xwt.GtkBackend.Spinner..ctor () [0x00000] in :0
at Xwt.GtkBackend.SpinnerBackend..ctor () [0x00000] in :0

However, the same code works on Windows+GTK or Windows+WPF perfectly. As i think, the reason is at Xwt.Gtk/Xwt.GtkBackend/SpinnerBackend.cs. It uses a huge amount of win32 P/Invokes of the "libgtk-win32-2.0-0.dll". There is no any "libgtk-win32" dlls on Linux systems, and the hack doesn't work. However the Gtk# does not contain the Spinner widget (however, it presents in the GTK+, and why it wasn't added to gtk-sharp stays a question...), as i guess, it is the reason of these P/Invokes. They doesn't solve the problem fully, and on non-win32 systems should be another workaround.

Sorry me for my bad english.

@slluis

This comment has been minimized.

Show comment
Hide comment
@slluis

slluis Jan 29, 2014

Member

You need to copy Xwt.Gtk.dll.config next to the Xwt.Gtk.dll. This config file contains the dll mappings for linux. The Xwt.Gtk project has this file and copies it to the output dir.

Member

slluis commented Jan 29, 2014

You need to copy Xwt.Gtk.dll.config next to the Xwt.Gtk.dll. This config file contains the dll mappings for linux. The Xwt.Gtk project has this file and copies it to the output dir.

@slluis slluis closed this Jan 29, 2014

@atauenis

This comment has been minimized.

Show comment
Hide comment
@atauenis

atauenis Jan 29, 2014

Contributor

Thank you for detection of my mistake. I think that this should be added to README.md. In that file is written simply "Linux+Gtk: Xwt.dll + Xwt.Gtk.dll (requires Gtk#) [*] Mac+Gtk: Xwt.dll + Xwt.Gtk.dll (requires Gtk#)" and it's does not mean that the .config file should be also added (at least for beginners).

Contributor

atauenis commented Jan 29, 2014

Thank you for detection of my mistake. I think that this should be added to README.md. In that file is written simply "Linux+Gtk: Xwt.dll + Xwt.Gtk.dll (requires Gtk#) [*] Mac+Gtk: Xwt.dll + Xwt.Gtk.dll (requires Gtk#)" and it's does not mean that the .config file should be also added (at least for beginners).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment