AddWidget() public method

public AddWidget ( Gtk widget ) : void
widget Gtk
return void
コード例 #1
0
ファイル: Glade.cs プロジェクト: highattack30/monodevelop-1
        public static void Import(ProjectBackend project, string filename)
        {
            XmlDocument doc = new XmlDocument();

            doc.PreserveWhitespace = true;
            doc.XmlResolver        = null;
            doc.Load(filename);
            project.SetFileName(filename);
            project.Id = System.IO.Path.GetFileName(filename);
            doc        = GladeUtils.XslImportTransform(doc);

            XmlNode node = doc.SelectSingleNode("/glade-interface");

            if (node == null)
            {
                throw new ApplicationException(Catalog.GetString("Not a glade file according to node name."));
            }

            ObjectReader reader = new ObjectReader(project, FileFormat.Glade);

            foreach (XmlElement toplevel in node.SelectNodes("widget"))
            {
                Wrapper.Container wrapper = Stetic.ObjectWrapper.ReadObject(reader, toplevel) as Wrapper.Container;
                if (wrapper != null)
                {
                    project.AddWidget((Gtk.Widget)wrapper.Wrapped);
                }
            }
        }
コード例 #2
0
ファイル: Glade.cs プロジェクト: Kalnor/monodevelop
		public static void Import (ProjectBackend project, string filename)
		{
			XmlDocument doc = new XmlDocument ();
			doc.PreserveWhitespace = true;
			doc.XmlResolver = null;
			doc.Load (filename);
			project.Id = System.IO.Path.GetFileName (filename);
			doc = GladeUtils.XslImportTransform (doc);

			XmlNode node = doc.SelectSingleNode ("/glade-interface");
			if (node == null)
				throw new ApplicationException (Catalog.GetString ("Not a glade file according to node name."));

			ObjectReader reader = new ObjectReader (project, FileFormat.Glade);
			foreach (XmlElement toplevel in node.SelectNodes ("widget")) {
				Wrapper.Container wrapper = Stetic.ObjectWrapper.ReadObject (reader, toplevel, null) as Wrapper.Container;
				if (wrapper != null)
					project.AddWidget ((Gtk.Widget)wrapper.Wrapped);
			}
		}