static void gtk_gps_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gtk_gps_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static void gtk_gps_paint_by_mode(GtkGps *gps);
+static gboolean gtk_gps_refresh_cb(GtkWidget *widget);
G_DEFINE_TYPE(GtkGps, gtk_gps, GTK_TYPE_WIDGET);
gps->width=300;
gps->height=300;
gps->size=300;
+gps->esid=0;
}
static gboolean
pango_layout_set_font_description(gps->layout, gps->fontdesc);
pango_layout_set_alignment(gps->layout, PANGO_ALIGN_CENTER);
+gps->esid=g_timeout_add(1000,(GSourceFunc)gtk_gps_refresh_cb, gps);
+
return GTK_WIDGET(gps);
}
g_return_if_fail(GTK_IS_GPS(object));
gps=GTK_GPS(object);
+g_source_remove(gps->esid);
if (GTK_WIDGET(object)->parent && GTK_WIDGET_MAPPED(object)) {
gtk_widget_unmap(GTK_WIDGET(object));
}
gps = GTK_GPS (widget);
requisition->width=300;
-requisition->height=300;
gps->width=300;
-gps->height=300;
+
+if (gps->display_mode==GTK_GPS_MODE_SKY) {
+ requisition->height=300;
+ gps->height=300;
+} else {
+ requisition->height=200;
+ gps->height=200;
+}
gps->size=300;
}
}
}
+static gboolean
+gtk_gps_refresh_cb(GtkWidget *widget)
+{
+GtkGps *gps;
+
+g_return_val_if_fail(GTK_IS_GPS(widget), FALSE);
+
+if ((GTK_WIDGET_MAPPED(widget)==FALSE) || (GTK_WIDGET_VISIBLE(widget)==FALSE))
+ return TRUE;
+
+gps=GTK_GPS(widget);
+gtk_widget_queue_draw_area(widget, 0, 0, gps->width, gps->height);
+return TRUE;
+}
+
static gboolean
gtk_gps_expose(GtkWidget *widget, GdkEventExpose *event)
{