[Gtk-sharp-list] drawing Gdk.Windows?

Bernhard Huemer xaml.coder at gmail.com
Sat May 28 16:52:45 EDT 2005


Hello,

I've been trying to _draw_ Gtk.Widgets, because drawing them
would particularly be suitable for the entire application.

/////
using System;
using Gtk;
using Gdk;

static class Application
{
   public static void DrawWidget(Gdk.Window widget) {
       // i thought of invalidating the whole Gdk.Window
       // and update it, but it doesn't seem to work :f
       widget.InvalidateRect(widget.FrameExtents, false);
       widget.ProcessUpdates(true);
   }

   public static void Init() {
       Gtk.Application.Init();
   }

   public static void Show() {
       Gtk.Button button = new Gtk.Button("Button");
       Gtk.Window window = new Gtk.Window("Window");

       window.Add(button);

       window.Realize();
       button.Realize();
       window.Show();
           // I don't want to replace this line with
           // window.ShowAll(), cause i want to do the
           // drawing stuff on my own!

       DrawWidget(button.GdkWindow);
   }

   public static void Run() {
       Gtk.Application.Run();
   }

   public static void Main() {
       Application.Init();
       Application.Show();
       Application.Run();
   }
}
\\\\\

So whats wrong or rather is it actually possible to draw widgets?

thanks


More information about the Gtk-sharp-list mailing list