aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-07-11 06:57:03 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-07-11 06:57:03 +0800
commit0b7919fc139f9bd8cd7287bd1c815769f2f0bd56 (patch)
treee271019c517b287bbab9921381778905cbb26786
parent6d83f3ed177cac1fba83011a48a248a0ff997e52 (diff)
downloadgsoc2013-evolution-0b7919fc139f9bd8cd7287bd1c815769f2f0bd56.tar.gz
gsoc2013-evolution-0b7919fc139f9bd8cd7287bd1c815769f2f0bd56.tar.zst
gsoc2013-evolution-0b7919fc139f9bd8cd7287bd1c815769f2f0bd56.zip
Make sure the ETable is constructed properly, by setting the
arguments in the parent EScrollFrame class. svn path=/trunk/; revision=4063
-rw-r--r--widgets/e-table/ChangeLog12
-rw-r--r--widgets/e-table/e-table-scrolled.c16
-rw-r--r--widgets/e-table/e-table.c7
-rw-r--r--widgets/table/e-table-scrolled.c16
-rw-r--r--widgets/table/e-table.c7
5 files changed, 46 insertions, 12 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog
index 811a751f45..b695763c4a 100644
--- a/widgets/e-table/ChangeLog
+++ b/widgets/e-table/ChangeLog
@@ -1,5 +1,17 @@
2000-07-10 Ettore Perazzoli <ettore@helixcode.com>
+ * e-table.c (set_scroll_adjustments): Be safe if @vadjustment is
+ NULL.
+
+ * e-table-scrolled.c (e_table_scrolled_init): Set policy and
+ shadow type.
+ (e_table_scrolled_real_construct): Don't set the adjustments.
+ (e_table_scrolled_new): Create the widget with `gtk_widget_new()'
+ and pass hadjustment/vadjustment NULL values so that we get the
+ `GTK_OBJECT_CONSTRUCTED' approval.
+
+2000-07-10 Ettore Perazzoli <ettore@helixcode.com>
+
* e-table-scrolled.h: s/GtkTable/EScrollFrameClass/.
2000-07-09 Christopher James Lahey <clahey@helixcode.com>
diff --git a/widgets/e-table/e-table-scrolled.c b/widgets/e-table/e-table-scrolled.c
index 6fcec1e185..b8260b6407 100644
--- a/widgets/e-table/e-table-scrolled.c
+++ b/widgets/e-table/e-table-scrolled.c
@@ -94,17 +94,22 @@ key_press_proxy (ETable *et, int row, int col, GdkEvent *event, ETableScrolled *
static void
e_table_scrolled_init (GtkObject *object)
{
- ETableScrolled *ets = E_TABLE_SCROLLED(object);
+ ETableScrolled *ets;
+ EScrollFrame *scroll_frame;
+
+ ets = E_TABLE_SCROLLED (object);
+ scroll_frame = E_SCROLL_FRAME (object);
ets->table = gtk_type_new(e_table_get_type());
+
+ e_scroll_frame_set_policy (scroll_frame, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ e_scroll_frame_set_shadow_type (scroll_frame, GTK_SHADOW_IN);
}
static void
e_table_scrolled_real_construct (ETableScrolled *ets)
{
gtk_object_set(GTK_OBJECT(ets),
- "hadjustment", NULL,
- "vadjustment", NULL,
"shadow_type", GTK_SHADOW_IN,
"hscrollbar_policy", GTK_POLICY_NEVER,
"vscrollbar_policy", GTK_POLICY_AUTOMATIC,
@@ -153,7 +158,10 @@ e_table_scrolled_new (ETableHeader *full_header, ETableModel *etm, const char *s
{
ETableScrolled *ets;
- ets = gtk_type_new (e_table_scrolled_get_type ());
+ ets = E_TABLE_SCROLLED (gtk_widget_new (e_table_scrolled_get_type (),
+ "hadjustment", NULL,
+ "vadjustment", NULL,
+ NULL));
ets = e_table_scrolled_construct (ets, full_header, etm, spec);
diff --git a/widgets/e-table/e-table.c b/widgets/e-table/e-table.c
index db7ca11b3f..8a93577dbf 100644
--- a/widgets/e-table/e-table.c
+++ b/widgets/e-table/e-table.c
@@ -823,8 +823,11 @@ set_scroll_adjustments (ETable *table,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment)
{
- vadjustment->step_increment = 20;
- gtk_adjustment_changed(vadjustment);
+ if (vadjustment != NULL) {
+ vadjustment->step_increment = 20;
+ gtk_adjustment_changed(vadjustment);
+ }
+
gtk_layout_set_hadjustment (GTK_LAYOUT(table->table_canvas),
hadjustment);
gtk_layout_set_vadjustment (GTK_LAYOUT(table->table_canvas),
diff --git a/widgets/table/e-table-scrolled.c b/widgets/table/e-table-scrolled.c
index 6fcec1e185..b8260b6407 100644
--- a/widgets/table/e-table-scrolled.c
+++ b/widgets/table/e-table-scrolled.c
@@ -94,17 +94,22 @@ key_press_proxy (ETable *et, int row, int col, GdkEvent *event, ETableScrolled *
static void
e_table_scrolled_init (GtkObject *object)
{
- ETableScrolled *ets = E_TABLE_SCROLLED(object);
+ ETableScrolled *ets;
+ EScrollFrame *scroll_frame;
+
+ ets = E_TABLE_SCROLLED (object);
+ scroll_frame = E_SCROLL_FRAME (object);
ets->table = gtk_type_new(e_table_get_type());
+
+ e_scroll_frame_set_policy (scroll_frame, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ e_scroll_frame_set_shadow_type (scroll_frame, GTK_SHADOW_IN);
}
static void
e_table_scrolled_real_construct (ETableScrolled *ets)
{
gtk_object_set(GTK_OBJECT(ets),
- "hadjustment", NULL,
- "vadjustment", NULL,
"shadow_type", GTK_SHADOW_IN,
"hscrollbar_policy", GTK_POLICY_NEVER,
"vscrollbar_policy", GTK_POLICY_AUTOMATIC,
@@ -153,7 +158,10 @@ e_table_scrolled_new (ETableHeader *full_header, ETableModel *etm, const char *s
{
ETableScrolled *ets;
- ets = gtk_type_new (e_table_scrolled_get_type ());
+ ets = E_TABLE_SCROLLED (gtk_widget_new (e_table_scrolled_get_type (),
+ "hadjustment", NULL,
+ "vadjustment", NULL,
+ NULL));
ets = e_table_scrolled_construct (ets, full_header, etm, spec);
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index db7ca11b3f..8a93577dbf 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -823,8 +823,11 @@ set_scroll_adjustments (ETable *table,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment)
{
- vadjustment->step_increment = 20;
- gtk_adjustment_changed(vadjustment);
+ if (vadjustment != NULL) {
+ vadjustment->step_increment = 20;
+ gtk_adjustment_changed(vadjustment);
+ }
+
gtk_layout_set_hadjustment (GTK_LAYOUT(table->table_canvas),
hadjustment);
gtk_layout_set_vadjustment (GTK_LAYOUT(table->table_canvas),