]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkdrawingarea.c
textview: Use GtkSelectionWindow for touch text selection
[~andy/gtk] / gtk / gtkdrawingarea.c
index 6f8272b15489891430421fad34217cc43c949890..b1bcb49169a64a62abc6ba3a0eedf3925b04f262 100644 (file)
@@ -12,9 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
@@ -27,6 +25,7 @@
 #include "config.h"
 #include "gtkdrawingarea.h"
 #include "gtkintl.h"
+#include "gtkstylecontext.h"
 
 
 /**
  *
  * To receive mouse events on a drawing area, you will need to enable
  * them with gtk_widget_add_events(). To receive keyboard events, you
- * will need to set the #GTK_CAN_FOCUS flag on the drawing area, and
+ * will need to set the "can-focus" property on the drawing area, and you
  * should probably draw some user-visible indication that the drawing
- * area is focused. Use the GTK_HAS_FOCUS() macro in your expose event
+ * area is focused. Use gtk_widget_has_focus() in your expose event
  * handler to decide whether to draw the focus indicator. See
- * gtk_paint_focus() for one way to draw focus.
+ * gtk_render_focus() for one way to draw focus.
  */
 
 static void gtk_drawing_area_realize       (GtkWidget           *widget);
@@ -166,7 +165,6 @@ gtk_drawing_area_new (void)
 static void
 gtk_drawing_area_realize (GtkWidget *widget)
 {
-  GtkDrawingArea *darea = GTK_DRAWING_AREA (widget);
   GtkAllocation allocation;
   GdkWindow *window;
   GdkWindowAttr attributes;
@@ -195,7 +193,7 @@ gtk_drawing_area_realize (GtkWidget *widget)
 
       window = gdk_window_new (gtk_widget_get_parent_window (widget),
                                &attributes, attributes_mask);
-      gdk_window_set_user_data (window, darea);
+      gtk_widget_register_window (widget, window);
       gtk_widget_set_window (widget, window);
 
       gtk_style_context_set_background (gtk_widget_get_style_context (widget),