[Gtk-sharp-list] Multiple Windows and Application.Init problem

ajadex ajadex@matcom.uh.cu
Tue, 5 Apr 2005 14:34:11 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_00CF_01C539EC.885E8C90
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi, I'm making an Application with a Login and a Main Windows. First of =
all I couldn't make the Login Window modal but I make a temporal patch =
and I starting the Login Window as the principal and then calling the =
Main Window:

LoginWindow.cs

public void Show(){

Application.Init();

XML gxml =3D new XML(null, =
"CoolMessenger.glade_widgets.cool-messenger.glade", "W_LoginWindow", =
null);

gxml.Autoconnect(this);

Application.Run();

}



private void whenFinished(IAsyncResult ar){

//Do login verifications....

_UserData =3D new UserData(Tb_Alias.Text, Tb_Password.Text);

W_LoginWindow.Destroy();

new MainWindow(_UserData);


}





MainWindow.cs

public MainWindow(UserData userData){

XML gxml =3D new XML(null, =
"CoolMessenger.glade_widgets.cool-messenger.glade", "W_MainWindow", =
null);

gxml.Autoconnect(this);

....Some user data stuff

}

But the MainWindow, also designed in glade, doesn't wake up and the =
application freeze. I try inserting Application.Init and Application.Run =
in the MainWindow also and the Window is shown nothing works.

Any help?


                         Thanks, Ajadex.
------=_NextPart_000_00CF_01C539EC.885E8C90
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.2900.2180" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi, I'm&nbsp;making an Application with =
a Login and=20
a Main Windows. First of all I couldn't make the Login Window modal but =
I make a=20
temporal patch and I starting the Login Window as the principal and then =
calling=20
the Main Window:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff size=3D2>
<P><FONT face=3DArial =
color=3D#000000><STRONG>LoginWindow.cs</STRONG></FONT></P>
<P>public</FONT><FONT size=3D2> </FONT><FONT color=3D#0000ff =
size=3D2>void</FONT><FONT=20
size=3D2> Show(){</P>
<P>Application.Init();</P>
<P>XML gxml =3D </FONT><FONT color=3D#0000ff size=3D2>new</FONT><FONT =
size=3D2>=20
XML(</FONT><FONT color=3D#0000ff size=3D2>null</FONT><FONT size=3D2>,=20
"CoolMessenger.glade_widgets.cool-messenger.glade", "W_LoginWindow",=20
</FONT><FONT color=3D#0000ff size=3D2>null</FONT><FONT size=3D2>);</P>
<P>gxml.Autoconnect(</FONT><FONT color=3D#0000ff =
size=3D2>this</FONT><FONT=20
size=3D2>);</FONT><FONT color=3D#008000 size=3D2></P></FONT><FONT =
size=3D2>
<P>Application.Run();</P>
<P>}</P>
<P>&nbsp;</P><FONT face=3DArial><FONT color=3D#0000ff size=3D2>
<P><FONT face=3D"Times New Roman">private</FONT></FONT><FONT=20
face=3D"Times New Roman"><FONT size=3D2> </FONT><FONT color=3D#0000ff=20
size=3D2>void</FONT></FONT><FONT size=3D2><FONT face=3D"Times New =
Roman">=20
whenFinished(IAsyncResult ar)</FONT><FONT=20
face=3D"Times New Roman">{</FONT></FONT><FONT size=3D2></P>
<P><FONT face=3D"Times New Roman">//Do&nbsp;login =
verifications....</FONT></P>
<P><FONT face=3D"Times New Roman">_UserData =3D </FONT></FONT><FONT=20
face=3D"Times New Roman"><FONT size=3D2><FONT color=3D#0000ff =
size=3D2>new</FONT><FONT=20
size=3D2> =
UserData(Tb_Alias.Text,&nbsp;Tb_Password.Text);</FONT></FONT><FONT=20
color=3D#008000 size=3D2></P></FONT></FONT><FONT size=3D2>
<P><FONT color=3D#0000ff></FONT><FONT=20
face=3D"Times New Roman">W_LoginWindow.Destroy();</FONT></FONT>
<P><FONT face=3D"Times New Roman"><FONT color=3D#008000 =
size=3D2></P></FONT><FONT=20
size=3D2></FONT><FONT color=3D#0000ff size=3D2>new</FONT><FONT size=3D2> =

MainWindow(_UserData);</FONT><FONT color=3D#008000 size=3D2><FONT =
color=3D#000000=20
size=3D2><FONT size=3D2></P></FONT></FONT></FONT></FONT><FONT size=3D2>
<P><FONT face=3D"Times New Roman"></FONT></P>
<P><FONT face=3D"Times New Roman">}</FONT></P>
<P><FONT face=3D"Times New Roman"></FONT>&nbsp;</P>
<P><FONT face=3D"Times New Roman"></FONT>&nbsp;</P>
<P><STRONG>MainWindow.cs</STRONG></P><FONT size=3D2><FONT =
color=3D#0000ff size=3D2>
<P>public</FONT><FONT size=3D2> MainWindow(UserData =
userData){</P></FONT>
<P>XML gxml =3D </FONT><FONT color=3D#0000ff size=3D2>new</FONT><FONT =
size=3D2>=20
XML(</FONT><FONT color=3D#0000ff size=3D2>null</FONT><FONT size=3D2>,=20
"CoolMessenger.glade_widgets.cool-messenger.glade", "W_MainWindow", =
</FONT><FONT=20
color=3D#0000ff size=3D2>null</FONT><FONT size=3D2>);</P>
<P>gxml.Autoconnect(</FONT><FONT color=3D#0000ff =
size=3D2>this</FONT><FONT=20
size=3D2>);</FONT></P>
<P>....Some user data stuff</P>
<P><FONT size=3D2>}</P></FONT></FONT></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>But the MainWindow, also designed in =
glade, doesn't=20
wake up and the application freeze. I try inserting Application.Init and =

Application.Run in the MainWindow also&nbsp;and the Window is shown =
nothing=20
works.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Any help?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;=20
Thanks, Ajadex.</FONT></DIV></BODY></HTML>

------=_NextPart_000_00CF_01C539EC.885E8C90--