Implemented Window#focus.
authorTilman Sauerbeck <tilman@code-monkey.de>
Sun, 22 Aug 2004 14:52:05 +0000 (14:52 +0000)
committerTilman Sauerbeck <tilman@code-monkey.de>
Sun, 22 Aug 2004 14:52:05 +0000 (14:52 +0000)
src/ecore_x/rb_window.c

index d17817afdf06b21a3e2bc118a506cc340639e038..80aeda60f33ce61e5e579d49ce709c70d683427f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rb_window.c 85 2004-08-22 11:53:57Z tilman $
+ * $Id: rb_window.c 87 2004-08-22 14:52:05Z tilman $
  *
  * Copyright (C) 2004 ruby-ecore team (see AUTHORS)
  *
@@ -186,6 +186,15 @@ static VALUE c_reparent (VALUE self, VALUE other, VALUE x, VALUE y)
        return Qnil;
 }
 
+static VALUE c_focus (VALUE self)
+{
+       GET_OBJ (self, RbWindow, win);
+
+       ecore_x_window_focus (win->real);
+
+       return Qnil;
+}
+
 static VALUE c_move (VALUE self, VALUE x, VALUE y)
 {
        GET_OBJ (self, RbWindow, win);
@@ -367,6 +376,7 @@ void Init_Window (void)
        rb_define_method (cWindow, "raise", c_raise, 0);
        rb_define_method (cWindow, "lower", c_lower, 0);
        rb_define_method (cWindow, "reparent", c_reparent, 3);
+       rb_define_method (cWindow, "focus", c_focus, 0);
        rb_define_method (cWindow, "move", c_move, 2);
        rb_define_method (cWindow, "resize", c_resize, 2);
        rb_define_method (cWindow, "size", c_size_get, 0);