[Gtk-sharp-list] problems with GdkWindow

Charles Iliya Krempeaux charles@lizard.reptile.ca
27 Feb 2003 08:41:20 -0800


Hello,


Sorry, that won't work.  Try this instead...

                Application.Init();

                Gtk.Window win = new Gtk.Window("scrolling");
                win.ShowAll();

                Gdk.Window gdkwin = win.GdkWindow;

                Application.Run();

(You have to create the Window before you can show it :-)  )


See ya

On Thu, 2003-02-27 at 08:29, Charles Iliya Krempeaux wrote:
> Hello,
> 
> If I remember correctly,....  You have to "Show" (or "ShowAll")
> your Widget/Window/Whatever before a Gdk.Window is created.
> 
> So... try the following...
> 
>                 Application.Init();
> 
>                 win.ShowAll();
> 
>                 Gtk.Window win = new Gtk.Window("scrolling");
>                 Gdk.Window gdkwin = win.GdkWindow;
> 
>                 Application.Run();
> 
> (Where the Gdk.Window stuff comes after the "ShowAll".)
> 
> Hope that helps.
> 
> 
> See ya
> 
> 
> 
> On Thu, 2003-02-27 at 01:21, Thomas 'Dent' Mirlacher wrote:
> > hi list,
> > 
> > running this testcase fails:
> > 
> > using Gtk;
> > using Gdk;
> > 
> > public class Test {
> >         public static void Main(string[] args)
> >         {
> >                 Application.Init();
> > 
> >                 Gtk.Window win = new Gtk.Window("scrolling");
> >                 Gdk.Window gdkwin = win.GdkWindow;
> > 
> >                 win.ShowAll();
> > 
> >                 Application.Run();
> >         }
> > }
> > 
> > ... with the exception:
> > 
> > Unhandled Exception: System.NullReferenceException: A null value was found where an object instance was requiredin (unmanaged) 06 GtkSharp.ObjectManager:gtksharp_get_type_name (intptr)
> > in <0x00004> 06 GtkSharp.ObjectManager:gtksharp_get_type_name (intptr)
> > in <0x00050> 00 GtkSharp.ObjectManager:CreateObject (intptr)
> > in <0x000b3> 00 GLib.Object:GetObject (intptr)
> > in <0x0004e> 00 Gtk.Widget:get_GdkWindow ()
> > in <0x0004f> 00 .Test:Main (string[])
> > 
> > 
> > thanks for any ideas, help ...
> > 
> > 	++Thomas