[Gtk-sharp-list] Error derive from class gtk.window

Peter Börding powerpeet@web.de
Thu, 22 May 2003 14:20:24 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_01E5_01C3206D.4924D2E0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,
i can't derive a my own class from the class gtk.window. Compiles but do =
not run.
Deriving from gtk.dialog works (code below).
Can somebody help ?
System WinXP, gtk0.9, mono0.24=20
Thank you very much.

Peter

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Compileline:

C:\sharp\oop\OOP>mcs -unsafe+ Main.cs -r System.Data.dll -r =
ByteFX.Data.dll -r gtk-sharp.dll -r glib-sharp.dll  =
-lib:C:\mono-0.23\lib\ -r System.Drawing -r glade-sharp.dll
Compilation succeeded



Mono-Run + Output (the Warnings came always ( problem ? )):

C:\sharp\oop\OOP>mono Main.exe

** (<unknown>:2692): WARNING **: Failed to load library =
libgobject-2.0.so.dll (libgobject-2.0.so): Das angegebene Modul wurde =
nicht gefunden.

** (<unknown>:2692): WARNING **: Failed to load library =
libgobject-2.0.so.dll (libgobject-2.0.so): Das angegebene Modul wurde =
nicht gefunden.

** (<unknown>:2692): WARNING **: Failed to load library =
libgtksharpglue.so.dll (libgtksharpglue.so): Das angegebene Modul wurde =
nicht gefunden.

** (<unknown>:2692): WARNING **: Failed to load library =
libgtksharpglue.so.dll (libgtksharpglue.so): Das angegebene Modul wurde =
nicht gefunden.
font is  0x0

(<unknown>:2692): Gtk-CRITICAL **: file gtkwidget.c: line 1630 =
(gtk_widget_show): assertion `GTK_IS_WIDGET (widget)' failed
font is  0x0
font is  0x0




The code:


using Gtk;
using GtkSharp;
using GLib;
using System;
using System.Drawing;


public class CMyWin:Gtk.Window {
public CMyWin(string str) {}
}

public class CMyDialog:Gtk.Dialog {
public CMyDialog() {
this.Title =3D "MyDlg";
}

}



class CStart{
static public void Main(){
Application.Init();

//Works
Gtk.Window aWin;
aWin =3D new Window("aWindow");
aWin.Show();

//Do not work
CMyWin AppWin;=20
AppWin =3D new CMyWin("AppWindow");
AppWin.Show();

//Works=20
CMyDialog dlg;
dlg =3D new CMyDialog();
dlg.Show();

Application.Run();
}
}
 
------=_NextPart_000_01E5_01C3206D.4924D2E0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff background=3D"">
<DIV><FONT face=3DArial size=3D2>Hi,<BR>i can't derive a my own class =
from the class=20
gtk.window. Compiles but do not run.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Deriving from gtk.dialog works (code=20
below).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Can somebody help ?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>System WinXP, gtk0.9, =
mono0.24&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Thank you very much.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Peter</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT></DIV><FO=
NT=20
face=3DArial size=3D2></FONT>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Compileline:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>C:\sharp\oop\OOP&gt;mcs -unsafe+ =
Main.cs -r=20
System.Data.dll -r ByteFX.Data.dll -r gtk-sharp.dll -r glib-sharp.dll=20
&nbsp;-lib:C:\mono-0.23\lib\ -r System.Drawing -r =
glade-sharp.dll<BR>Compilation=20
succeeded</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Mono-Run + Output (the =
Warnings&nbsp;came always (=20
problem ? )):</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>C:\sharp\oop\OOP&gt;mono =
Main.exe</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>** (&lt;unknown&gt;:2692): WARNING **: =
Failed to=20
load library libgobject-2.0.so.dll (libgobject-2.0.so): Das angegebene =
Modul=20
wurde nicht gefunden.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>** (&lt;unknown&gt;:2692): WARNING **: =
Failed to=20
load library libgobject-2.0.so.dll (libgobject-2.0.so): Das angegebene =
Modul=20
wurde nicht gefunden.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>** (&lt;unknown&gt;:2692): WARNING **: =
Failed to=20
load library libgtksharpglue.so.dll (libgtksharpglue.so): Das angegebene =
Modul=20
wurde nicht gefunden.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>** (&lt;unknown&gt;:2692): WARNING **: =
Failed to=20
load library libgtksharpglue.so.dll (libgtksharpglue.so): Das angegebene =
Modul=20
wurde nicht gefunden.<BR>font is&nbsp; 0x0</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>(&lt;unknown&gt;:2692): Gtk-CRITICAL =
**: file=20
gtkwidget.c: line 1630 (gtk_widget_show): assertion `GTK_IS_WIDGET =
(widget)'=20
failed<BR>font is&nbsp; 0x0<BR>font is&nbsp; =
0x0<BR></FONT><BR></DIV><FONT=20
face=3DArial size=3D2></FONT>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The&nbsp;code:<BR><BR></DIV></FONT>
<DIV><FONT face=3DArial size=3D2>using Gtk;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>using GtkSharp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>using GLib;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>using System;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>using System.Drawing;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>public class CMyWin:Gtk.Window =
{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>public CMyWin(string str) =
{}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>public class CMyDialog:Gtk.Dialog =
{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>public CMyDialog() {</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>this.Title =3D "MyDlg";</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>class CStart{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>static public void Main(){</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Application.Init();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>//Works</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Gtk.Window aWin;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>aWin =3D new =
Window("aWindow");</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>aWin.Show();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>//Do not work</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>CMyWin AppWin;</FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>AppWin =3D new =
CMyWin("AppWindow");</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>AppWin.Show();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>//Works</FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>CMyDialog dlg;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>dlg =3D new CMyDialog();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>dlg.Show();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Application.Run();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>}</FONT></DIV><PRE>&nbsp;</PRE></BODY></HTML>

------=_NextPart_000_01E5_01C3206D.4924D2E0--