2007-03-05 Mike Kestner <mkestner@novell.com>
* gtk/Application.custom : set prgname in Init methods so that WM_CLASS is more appropriate. Programs using Gnome.Program already get a nice prgname, but Gtk.Application.Init apps were getting a path instead of a filename without extension. svn path=/trunk/gtk-sharp/; revision=73766
This commit is contained in:
parent
eab29b501e
commit
6a00328dd1
2 changed files with 20 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
2007-03-05 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* gtk/Application.custom : set prgname in Init methods so
|
||||
that WM_CLASS is more appropriate. Programs using Gnome.Program
|
||||
already get a nice prgname, but Gtk.Application.Init apps were
|
||||
getting a path instead of a filename without extension.
|
||||
|
||||
2007-03-01 Brad Taylor <brad@getcoded.net>
|
||||
|
||||
* gtk/Dialog.custom: obsolete old, improperly bound
|
||||
|
|
|
@ -39,8 +39,20 @@ namespace Gtk {
|
|||
[DllImport("libgtk-win32-2.0-0.dll")]
|
||||
static extern bool gtk_init_check (ref int argc, ref IntPtr argv);
|
||||
|
||||
[DllImport("libglib-2.0-0.dll")]
|
||||
static extern bool g_set_prgname (IntPtr name);
|
||||
|
||||
static void SetPrgname ()
|
||||
{
|
||||
string name = System.IO.Path.GetFileNameWithoutExtension (Environment.GetCommandLineArgs () [0]);
|
||||
IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
|
||||
g_set_prgname (native_name);
|
||||
GLib.Marshaller.Free (native_name);
|
||||
}
|
||||
|
||||
public static void Init ()
|
||||
{
|
||||
SetPrgname ();
|
||||
IntPtr argv = new IntPtr(0);
|
||||
int argc = 0;
|
||||
|
||||
|
@ -49,6 +61,7 @@ namespace Gtk {
|
|||
|
||||
static bool do_init (string progname, ref string[] args, bool check)
|
||||
{
|
||||
SetPrgname ();
|
||||
bool res = false;
|
||||
string[] progargs = new string[args.Length + 1];
|
||||
|
||||
|
|
Loading…
Reference in a new issue