[Gtk-sharp-list] Gtk# - Glade#. Problems, a newbie is starting

Luciano Callero lnc19@hotmail.com
Tue, 19 Aug 2003 14:03:30 -0300


Hi:

First of all, sorry, im not very good english writer (or speaker, or reader 
:P)

Excuse me. I ask this last week but, i havent got any real answer. Take a 
look again please and
help me if you can.


I'm writing a program, some like an ERP (or somethink like this) with mono, 
Gtk# and Glade.
Basicaly its a window with menu and toolbars, and this open other windows 
(Other MOdal Windows).
The c# code is like this: (it may be have some errors, excuse me for this)


class MainWindow
	{
		int retValLogin = -1;
		[Glade.Widget("wndMain")]
		Gtk.Window wndMain;
  		static void Main()
			{
				Appliction.Init();
				Glade.XML gXML = new Glade.XML(null, "file.glade", "wndMain", null);
				gXML.Autoconnect(this);
				Application.Run();
			}

		public void on_mnuLogin_clicked(System.Object Sender, EventArgs args)
			{
				Login x = new Login(ref retValLogin);
				x.Show();
				Console.WriteLine("This is executed inmediatly after the Show method.");
			}
	}

class Login()
   {
		[Glade.Widget("wndLogin")]
		Gtk.Window wndLogin;
		int ret;
		public Login(ref int retval)
		{
			ret = retval;
		}
		public void Show()
		{
			Glade.XML gLogin = new Glade.XML(null, "file.glade", "wndLogin", null);
			gLogin.Autoconnect(this);

		}
		public void on_btnLogin_clicked(System.Object Sender, EventArgs args)
		{
			ret = 1;
			wndLogin.Destroy();
		}
		public void on_btnLogin_clicked(System.Object Sender, EventArgs args)
		{
			ret = 0;
			wndLogin.Destroy();
		}
   }

The problem of this code is that i must to give reference variables to 
return value to class MainWindow from Login class.
I do this beacause when i call Method Show, the program "flow" does not go 
with the method. It means that execute the show
method and return the flow control, and execute the next code in caller 
code.
It Is this correct? it is "the" way to do this?
It Is this the only way to return values? beacause i must return the value 
when the BtnLogin is clicked.
It is the way to show windows creating an instance of Glade.XML?
What does Application.Init and Application.Run? (This is Off-Topic, but i 
dont know to)
I'm doing to much questions? :P (do not response this)

And I have other problemas. When i do a window in Glade, with a NoteBook 
(control) inside (2 Panels) and
I run this window in my applicacion I have some Warning error, and the 
window show without the NoteBook Control.
The same problem with Default Button in a window, It give me some Warning 
Advice and no default button is set.
An at last the same problem with Sensitive Property (set in glade interfase) 
in a button that is inside of a toolbar.
Wath kind of error are this? are bugs? i must report them? someone have 
tested this thinks?

It will be very helpfull some information, (im thinking in kill myself for 
this problem :P ) And THANKS TO ALL.

Thank you

_________________________________________________________________
¿Estás buscando un auto nuevo?  http://www.yupimsn.com/autos/