2002-09-23 Miguel de Icaza <miguel@ximian.com>

* gtk/Style.custom: bind it.

	* gtk/Widget.custom: bind it.

	* glue/widget.c: Wrapper to fetch a GdkWindow from a widget.

	* glue/style.c: wrapper routines for getting/setting the thickness
	on a GtkStyle.

svn path=/trunk/gtk-sharp/; revision=7755
This commit is contained in:
Miguel de Icaza 2002-09-24 03:21:37 +00:00
parent a31190ba9d
commit 7b5efe0866
5 changed files with 73 additions and 0 deletions

View file

@ -1,3 +1,14 @@
2002-09-23 Miguel de Icaza <miguel@ximian.com>
* gtk/Style.custom: bind it.
* gtk/Widget.custom: bind it.
* glue/widget.c: Wrapper to fetch a GdkWindow from a widget.
* glue/style.c: wrapper routines for getting/setting the thickness
on a GtkStyle.
2002-09-21 Miguel de Icaza <miguel@ximian.com>
* gtk/TreeView.custom: Add Model.set to the TreeView

View file

@ -61,3 +61,21 @@ gtksharp_gtk_style_get_bg (GtkStyle *style)
return style->bg;
}
int
gtksharp_gtk_style_get_thickness (GtkStyle *style, int x)
{
if (x)
return style->xthickness;
else
return style->ythickness;
}
void
gtksharp_gtk_style_set_thickness (GtkStyle *style, int thickness)
{
if (thickness > 0)
style->xthickness = thickness;
else
style->ythickness = -thickness;
}

View file

@ -13,4 +13,9 @@ gtksharp_gtk_widget_get_allocation (GtkWidget *widget)
return &widget->allocation;
}
GdkWindow *
gtksharp_gtk_widget_get_window (GtkWidget *widget)
{
return &widget->window;
}

View file

@ -90,3 +90,27 @@ public Gdk.Color[] Background {
}
}
[DllImport ("gtksharpglue")]
static extern int gtksharp_gtk_style_get_thickness (IntPtr style, int x_axis);
[DllImport ("gtksharpglue")]
static extern void gtksharp_gtk_style_set_thickness (IntPtr style, int value);
public int XThickness {
get {
return gtksharp_gtk_style_get_thickness (Handle, 0);
}
set {
gtksharp_gtk_style_set_thickness (Handle, value);
}
}
public int YThickness {
get {
return gtksharp_gtk_style_get_thickness (Handle, 1);
}
set {
gtksharp_gtk_style_set_thickness (Handle, -value);
}
}

View file

@ -15,3 +15,18 @@ public Gdk.Rectangle Allocation {
get { return Gdk.Rectangle.New (gtksharp_gtk_widget_get_allocation (Handle)); }
}
[DllImport ("gtksharpglue")]
static extern IntPtr gtksharp_gtk_widget_get_window (IntPtr widget);
public Gdk.Window GdkWindow {
get {
IntPtr raw_ret = gtksharp_gtk_widget_get_window (Handle);
if (raw_ret != (IntPtr) 0){
Gdk.Window ret = (Gdk.Window) GLib.Object.GetObject(raw_ret);
ret.Ref ();
return ret;
}
return null;
}
}