* 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/>.
*/
/*
#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);
static void
gtk_drawing_area_realize (GtkWidget *widget)
{
- GtkDrawingArea *darea = GTK_DRAWING_AREA (widget);
GtkAllocation allocation;
GdkWindow *window;
GdkWindowAttr attributes;
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),