]> Pileus Git - ~andy/gtk/commitdiff
use misc->xpad for x calculation instead of ypad (typo). (gtk_arrow_set):
authorTim Janik <timj@gtk.org>
Fri, 17 Jul 1998 00:03:35 +0000 (00:03 +0000)
committerTim Janik <timj@src.gnome.org>
Fri, 17 Jul 1998 00:03:35 +0000 (00:03 +0000)
Fri Jul 17 01:21:32 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkarrow.c (gtk_arrow_expose): use misc->xpad for x calculation
        instead of ypad (typo).
        (gtk_arrow_set): clear all of the arrow's allocation (left a 1 pixel
        border around the allocation).
        (gtk_arrow_init): the static requisition needs to be setup in this
        function rather than gtk_widget_new(), so arrow creation works without
        the gtk_arrow_new() constructing.
        (gtk_arrow_expose): return TRUE, since we actually handled the expose.

        * gtk/gtkwidget.c (gtk_widget_real_size_request): provide a default
        implementation for GtkWidget::size_request, so size requisition for
        simple statically sized widgets like GtkArrow works.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkarrow.c
gtk/gtkwidget.c

index 36472dbe0f63c474be5611186d5162a221e16a51..094afee65b453467905d70302ec8ac68bfe88452 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+Fri Jul 17 01:21:32 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkarrow.c (gtk_arrow_expose): use misc->xpad for x calculation
+       instead of ypad (typo).
+       (gtk_arrow_set): clear all of the arrow's allocation (left a 1 pixel
+       border around the allocation).
+       (gtk_arrow_init): the static requisition needs to be setup in this
+       function rather than gtk_widget_new(), so arrow creation works without
+       the gtk_arrow_new() constructing.
+       (gtk_arrow_expose): return TRUE, since we actually handled the expose.
+
+       * gtk/gtkwidget.c (gtk_widget_real_size_request): provide a default
+       implementation for GtkWidget::size_request, so size requisition for
+       simple statically sized widgets like GtkArrow works.
+
 Thu Jul 16 14:16:16 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gtk-config.in: minor changes to gtk-config: --cflags doesn't
index 36472dbe0f63c474be5611186d5162a221e16a51..094afee65b453467905d70302ec8ac68bfe88452 100644 (file)
@@ -1,3 +1,18 @@
+Fri Jul 17 01:21:32 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkarrow.c (gtk_arrow_expose): use misc->xpad for x calculation
+       instead of ypad (typo).
+       (gtk_arrow_set): clear all of the arrow's allocation (left a 1 pixel
+       border around the allocation).
+       (gtk_arrow_init): the static requisition needs to be setup in this
+       function rather than gtk_widget_new(), so arrow creation works without
+       the gtk_arrow_new() constructing.
+       (gtk_arrow_expose): return TRUE, since we actually handled the expose.
+
+       * gtk/gtkwidget.c (gtk_widget_real_size_request): provide a default
+       implementation for GtkWidget::size_request, so size requisition for
+       simple statically sized widgets like GtkArrow works.
+
 Thu Jul 16 14:16:16 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gtk-config.in: minor changes to gtk-config: --cflags doesn't
index 36472dbe0f63c474be5611186d5162a221e16a51..094afee65b453467905d70302ec8ac68bfe88452 100644 (file)
@@ -1,3 +1,18 @@
+Fri Jul 17 01:21:32 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkarrow.c (gtk_arrow_expose): use misc->xpad for x calculation
+       instead of ypad (typo).
+       (gtk_arrow_set): clear all of the arrow's allocation (left a 1 pixel
+       border around the allocation).
+       (gtk_arrow_init): the static requisition needs to be setup in this
+       function rather than gtk_widget_new(), so arrow creation works without
+       the gtk_arrow_new() constructing.
+       (gtk_arrow_expose): return TRUE, since we actually handled the expose.
+
+       * gtk/gtkwidget.c (gtk_widget_real_size_request): provide a default
+       implementation for GtkWidget::size_request, so size requisition for
+       simple statically sized widgets like GtkArrow works.
+
 Thu Jul 16 14:16:16 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gtk-config.in: minor changes to gtk-config: --cflags doesn't
index 36472dbe0f63c474be5611186d5162a221e16a51..094afee65b453467905d70302ec8ac68bfe88452 100644 (file)
@@ -1,3 +1,18 @@
+Fri Jul 17 01:21:32 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkarrow.c (gtk_arrow_expose): use misc->xpad for x calculation
+       instead of ypad (typo).
+       (gtk_arrow_set): clear all of the arrow's allocation (left a 1 pixel
+       border around the allocation).
+       (gtk_arrow_init): the static requisition needs to be setup in this
+       function rather than gtk_widget_new(), so arrow creation works without
+       the gtk_arrow_new() constructing.
+       (gtk_arrow_expose): return TRUE, since we actually handled the expose.
+
+       * gtk/gtkwidget.c (gtk_widget_real_size_request): provide a default
+       implementation for GtkWidget::size_request, so size requisition for
+       simple statically sized widgets like GtkArrow works.
+
 Thu Jul 16 14:16:16 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gtk-config.in: minor changes to gtk-config: --cflags doesn't
index 36472dbe0f63c474be5611186d5162a221e16a51..094afee65b453467905d70302ec8ac68bfe88452 100644 (file)
@@ -1,3 +1,18 @@
+Fri Jul 17 01:21:32 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkarrow.c (gtk_arrow_expose): use misc->xpad for x calculation
+       instead of ypad (typo).
+       (gtk_arrow_set): clear all of the arrow's allocation (left a 1 pixel
+       border around the allocation).
+       (gtk_arrow_init): the static requisition needs to be setup in this
+       function rather than gtk_widget_new(), so arrow creation works without
+       the gtk_arrow_new() constructing.
+       (gtk_arrow_expose): return TRUE, since we actually handled the expose.
+
+       * gtk/gtkwidget.c (gtk_widget_real_size_request): provide a default
+       implementation for GtkWidget::size_request, so size requisition for
+       simple statically sized widgets like GtkArrow works.
+
 Thu Jul 16 14:16:16 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gtk-config.in: minor changes to gtk-config: --cflags doesn't
index 36472dbe0f63c474be5611186d5162a221e16a51..094afee65b453467905d70302ec8ac68bfe88452 100644 (file)
@@ -1,3 +1,18 @@
+Fri Jul 17 01:21:32 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkarrow.c (gtk_arrow_expose): use misc->xpad for x calculation
+       instead of ypad (typo).
+       (gtk_arrow_set): clear all of the arrow's allocation (left a 1 pixel
+       border around the allocation).
+       (gtk_arrow_init): the static requisition needs to be setup in this
+       function rather than gtk_widget_new(), so arrow creation works without
+       the gtk_arrow_new() constructing.
+       (gtk_arrow_expose): return TRUE, since we actually handled the expose.
+
+       * gtk/gtkwidget.c (gtk_widget_real_size_request): provide a default
+       implementation for GtkWidget::size_request, so size requisition for
+       simple statically sized widgets like GtkArrow works.
+
 Thu Jul 16 14:16:16 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gtk-config.in: minor changes to gtk-config: --cflags doesn't
index 36472dbe0f63c474be5611186d5162a221e16a51..094afee65b453467905d70302ec8ac68bfe88452 100644 (file)
@@ -1,3 +1,18 @@
+Fri Jul 17 01:21:32 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkarrow.c (gtk_arrow_expose): use misc->xpad for x calculation
+       instead of ypad (typo).
+       (gtk_arrow_set): clear all of the arrow's allocation (left a 1 pixel
+       border around the allocation).
+       (gtk_arrow_init): the static requisition needs to be setup in this
+       function rather than gtk_widget_new(), so arrow creation works without
+       the gtk_arrow_new() constructing.
+       (gtk_arrow_expose): return TRUE, since we actually handled the expose.
+
+       * gtk/gtkwidget.c (gtk_widget_real_size_request): provide a default
+       implementation for GtkWidget::size_request, so size requisition for
+       simple statically sized widgets like GtkArrow works.
+
 Thu Jul 16 14:16:16 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gtk-config.in: minor changes to gtk-config: --cflags doesn't
index adccf52e1bbf5806a5284e12b31e8cf2264ebc8b..566b5ecc0975c4200bd476b22ab5c493212062e3 100644 (file)
@@ -136,6 +136,9 @@ gtk_arrow_init (GtkArrow *arrow)
 {
   GTK_WIDGET_SET_FLAGS (arrow, GTK_NO_WINDOW);
 
+  GTK_WIDGET (arrow)->requisition.width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2;
+  GTK_WIDGET (arrow)->requisition.height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2;
+
   arrow->arrow_type = GTK_ARROW_RIGHT;
   arrow->shadow_type = GTK_SHADOW_OUT;
 }
@@ -146,10 +149,7 @@ gtk_arrow_new (GtkArrowType  arrow_type,
 {
   GtkArrow *arrow;
 
-  arrow = gtk_type_new (gtk_arrow_get_type ());
-
-  GTK_WIDGET (arrow)->requisition.width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2;
-  GTK_WIDGET (arrow)->requisition.height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2;
+  arrow = gtk_type_new (GTK_TYPE_ARROW);
 
   arrow->arrow_type = arrow_type;
   arrow->shadow_type = shadow_type;
@@ -174,10 +174,10 @@ gtk_arrow_set (GtkArrow      *arrow,
       if (GTK_WIDGET_DRAWABLE (arrow))
        {
          gdk_window_clear_area (GTK_WIDGET (arrow)->window,
-                                GTK_WIDGET (arrow)->allocation.x + 1,
-                                GTK_WIDGET (arrow)->allocation.y + 1,
-                                GTK_WIDGET (arrow)->allocation.width - 2,
-                                GTK_WIDGET (arrow)->allocation.height - 2);
+                                GTK_WIDGET (arrow)->allocation.x,
+                                GTK_WIDGET (arrow)->allocation.y,
+                                GTK_WIDGET (arrow)->allocation.width,
+                                GTK_WIDGET (arrow)->allocation.height);
          gtk_widget_queue_draw (GTK_WIDGET (arrow));
        }
     }
@@ -209,7 +209,7 @@ gtk_arrow_expose (GtkWidget      *widget,
       extent = MIN (width, height);
 
       x = ((widget->allocation.x + misc->xpad) * (1.0 - misc->xalign) +
-          (widget->allocation.x + widget->allocation.width - extent - misc->ypad) * misc->xalign);
+          (widget->allocation.x + widget->allocation.width - extent - misc->xpad) * misc->xalign);
       y = ((widget->allocation.y + misc->ypad) * (1.0 - misc->yalign) +
           (widget->allocation.y + widget->allocation.height - extent - misc->ypad) * misc->yalign);
 
@@ -232,5 +232,5 @@ gtk_arrow_expose (GtkWidget      *widget,
                      x, y, extent, extent);
     }
 
-  return FALSE;
+  return TRUE;
 }
index 72ecdb322c18ea24a5c63dca90e05b7042fa8079..d19896353cabbcea209b7ba63c95d52746b8d91a 100644 (file)
@@ -183,6 +183,8 @@ static void gtk_widget_real_realize          (GtkWidget         *widget);
 static void gtk_widget_real_unrealize           (GtkWidget         *widget);
 static void gtk_widget_real_draw                (GtkWidget         *widget,
                                                  GdkRectangle      *area);
+static void gtk_widget_real_size_request        (GtkWidget         *widget,
+                                                 GtkRequisition    *requisition);
 static void gtk_widget_real_size_allocate       (GtkWidget         *widget,
                                                  GtkAllocation     *allocation);
 static gint gtk_widget_real_key_press_event      (GtkWidget         *widget,
@@ -718,7 +720,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
   klass->unrealize = gtk_widget_real_unrealize;
   klass->draw = gtk_widget_real_draw;
   klass->draw_focus = NULL;
-  klass->size_request = NULL;
+  klass->size_request = gtk_widget_real_size_request;
   klass->size_allocate = gtk_widget_real_size_allocate;
   klass->state_changed = NULL;
   klass->parent_set = NULL;
@@ -3839,13 +3841,16 @@ gtk_widget_real_draw (GtkWidget    *widget,
     }
 }
 
-/*****************************************
- * gtk_widget_real_size_allocate:
- *
- *   arguments:
- *
- *   results:
- *****************************************/
+static void
+gtk_widget_real_size_request (GtkWidget         *widget,
+                             GtkRequisition    *requisition)
+{
+  g_return_if_fail (widget != NULL);
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+
+  requisition->width = widget->requisition.width;
+  requisition->height = widget->requisition.height;
+}
 
 static void
 gtk_widget_real_size_allocate (GtkWidget     *widget,