Ejemplo n.º 1
0
        void NotifyHandler(object obj, GLib.NotifyArgs args)
        {
            if (Loading)
            {
                return;
            }

            // Translate gtk names into descriptor names.
            foreach (ItemGroup group in ClassDescriptor.ItemGroups)
            {
                foreach (ItemDescriptor item in group)
                {
                    TypedPropertyDescriptor prop = item as TypedPropertyDescriptor;
                    if (prop != null && prop.GladeName == args.Property)
                    {
                        EmitNotify(prop.Name);
                        return;
                    }
                }
            }
        }
Ejemplo n.º 2
0
		void GenerateSetInternalChild (GeneratorContext ctx, CodeExpression parentVar, TypedPropertyDescriptor prop)
		{
			Gtk.Widget child = prop.GetValue (container) as Gtk.Widget;
			Widget cwrapper = Widget.Lookup (child);
			if (cwrapper != null) {
				ctx.Statements.Add (new CodeCommentStatement ("Internal child " + Wrapped.Name + "." + prop.Name));
				string childVar = ctx.NewId ();
				CodeVariableDeclarationStatement varDec = new CodeVariableDeclarationStatement (child.GetType().ToGlobalTypeRef (), childVar);
				ctx.Statements.Add (varDec);
				varDec.InitExpression = new CodePropertyReferenceExpression (parentVar, prop.Name);
			
				ctx.GenerateBuildCode (cwrapper, new CodeVariableReferenceExpression (childVar));
				return;
			}
		}