Re: Error in setting Log scale type



in the following line:
gtk_databox_set_total_limits (GTK_DATABOX (Databox1),10, 100, 10,1);

make sure you pass data of type float as in:
 gtk_databox_set_total_limits (GTK_DATABOX (Databox1),10.0, 100.0, 10.0,1.0);

or cast it with a (float)
The compiler assumes 10 is an int and 10.0 is a float.  This should throw a gcc compile warning also but not fail to compile, giving a run time warning/error

On Fri, Jan 13, 2012 at 8:48 AM, Sameer Mahadeo Gaikwad <sameer gaikwad rwth-aachen de> wrote:

Hello,

I am trying to set scale type of a Gtkdatabox as log scale. I am getting following run time error

** (<unknown>:4511): WARNING **: For logarithmic scaling, the visible limits must by larger than 0!

I've checked the visible limits using gtk_databox_get_visible_limits. All limits are larger than zero as shown below
Left=10.000000,right=100.000000,top=10.000000,bottom=1.000000

Code:
Databox1 = gtk_databox_new();
gtk_databox_set_total_limits (GTK_DATABOX (Databox1),10, 100, 10,1);
X_Axis = gtk_databox_ruler_new (GTK_ORIENTATION_HORIZONTAL);
gtk_databox_set_scale_type_x (Databox1, GTK_DATABOX_SCALE_LOG);
gtk_databox_set_ruler_x (Databox1, GTK_DATABOX_RULER(X_Axis));

I would appreciate if anyone could help me out here.
_______________________________________________
gtkdatabox-list mailing list
gtkdatabox-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkdatabox-list



--
Please consider how much more fun this email would be as a paper airplane when printing this email.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]