protected virtual void SetAppIcon(IntPtr window, string filename) { try { filename = IconHandler.IconFullPath(filename); if (!string.IsNullOrWhiteSpace(filename)) { IntPtr error = IntPtr.Zero; gtk_window_set_icon_from_file(window, filename, out error); if (error != IntPtr.Zero) { Logger.Instance.Log.Error("Icon handle not successfully freed."); } } } catch (Exception exception) { Logger.Instance.Log.Error(exception); } }
public void SetAppIcon(IntPtr window, string filename) { try { filename = IconHandler.IconFullPath(filename); if (string.IsNullOrWhiteSpace(filename)) { IntPtr error = IntPtr.Zero; NativeMethods.gtk_window_set_icon_from_file(window, filename, out error); if (error != IntPtr.Zero) { Log.Error("Icon handle not successfully freed."); } } } catch (Exception exception) { Log.Error(exception); } }
public void SetAppIcon(IntPtr window, string filename) { try { IntPtr ptrToAnsi = IconHandler.IconFileToPtr(filename); if (ptrToAnsi != IntPtr.Zero) { IntPtr error = IntPtr.Zero; NativeMethods.gtk_window_set_icon_from_file(window, ptrToAnsi, out error); Marshal.FreeCoTaskMem(ptrToAnsi); if (error != IntPtr.Zero) { Log.Error("Icon handle not successfully freed."); } } } catch (Exception exception) { Log.Error(exception); } }