picoe/Eto
View on GitHubAllow a Control to be positioned directly in its parent Container, making PixelLayout obsolete
Open
#158 opened on Nov 20, 2013
help wanted
Description
Problem:
- It is cumbersome to create a PixelLayout just to position a control.
- PixelLayout adds a new window to the container hierarchy, obscuring the content beneath and requiring event bubbling to register mouse clicks, etc.
- It isn't possible to explicitly position some controls while using a table layout for the rest of the Container's children.
Solution: These methods and properties allow a Control to be added and positioned directly on its parent:
- Container.Add(Control child): adds an absolutely positioned child
- Container.Remove(Control child): removes an absolutely positioned child
- Control.Location {get; set;} : The setter is new. Sets the position of this Control in its parent. This Control must have been added using Add.
Implementation Notes: Curtis mentioned GTK being problematic in that it required an explicit window. However, this is no longer the case, GTK.Fixed supports a windowless mode (HasWindow = false) and in fact Eto currently uses this mode.