4
using System.Collections;
6
namespace Stetic.Wrapper {
8
public class Window : Container {
10
public override void Wrap (object obj, bool initialized)
12
Gtk.Window window = (Gtk.Window)obj;
14
window.TypeHint = Gdk.WindowTypeHint.Normal;
15
base.Wrap (obj, initialized);
18
if (window.Child is Placeholder)
19
window.Child.SetSizeRequest (200, 200);
22
window.DeleteEvent += DeleteEvent;
25
public override void Dispose ()
27
Wrapped.DeleteEvent -= DeleteEvent;
32
void DeleteEvent (object obj, Gtk.DeleteEventArgs args)
38
public override bool HExpandable { get { return true; } }
39
public override bool VExpandable { get { return true; } }
41
// We don't want to actually set the underlying properties for these;
42
// that would be annoying to interact with.
54
Gdk.WindowTypeHint typeHint;
55
public Gdk.WindowTypeHint TypeHint {
61
EmitNotify ("TypeHint");
66
public Gtk.WindowType Type {
76
Gtk.WindowPosition windowPosition;
77
public Gtk.WindowPosition WindowPosition {
79
return windowPosition;
82
windowPosition = value;
83
EmitNotify ("WindowPosition");
88
public ImageInfo Icon {
94
Gtk.Window window = (Gtk.Window)Wrapped;
97
window.Icon = icon.GetImage (Project);
106
internal protected override void GenerateBuildCode (GeneratorContext ctx, CodeExpression var)
108
base.GenerateBuildCode (ctx, var);
110
if (((Gtk.Window)Wrapped).DefaultWidth == -1) {
112
new CodeAssignStatement (
113
new CodePropertyReferenceExpression (
117
new CodePrimitiveExpression (DesignWidth)
122
if (((Gtk.Window)Wrapped).DefaultHeight == -1) {
124
new CodeAssignStatement (
125
new CodePropertyReferenceExpression (
129
new CodePrimitiveExpression (DesignHeight)
135
protected override void GeneratePropertySet (GeneratorContext ctx, CodeExpression var, PropertyDescriptor prop)
137
if (prop.Name != "Type")
138
base.GeneratePropertySet (ctx, var, prop);