Adjustment / Scaler problems?
- From: Henrik Steen <dat94hsn mds mdh se>
- To: gtk-list redhat com
- Subject: Adjustment / Scaler problems?
- Date: Fri, 22 May 1998 15:18:09 +0200
Hi i have some problems...
I use the code at the botton to create an adjustment object ranging from
-10 to 10, and when i go from a negative value to a positive value i get
a '-0' in the middle, is this a bug?
(this is what it look like right now)
High Low <- labels
-10 -0 10 <- the value (only one at the time of
course)
------------|------------- <- the adjustment list
The program needs to set a value (where negative value means
high/increase and positive value low/decrease).
(this is how i want it to be)
Low High
10 0 -10
------------|-------------
I want to have it this way, since 'right' usually means 'higher'. I
could of course count from -10 to 10 and see to it that my function gets
the value multiplied with -1 but i don't want to hide the fact that -10
in fact is the highest value that can be set.
This could also be useful in gtop, "set priority".
I have tried with:
adjustment = gtk_adjustment_new (0, 10, -10, -1, 1, 1);
but this clearly does not work.
Cheers
Henrik Steen
[SNIP]
adjustment = gtk_adjustment_new (0, -10, 10, 1, 1, 1);
scale = gtk_hscale_new (GTK_ADJUSTMENT (adjustment));
gtk_widget_set_usize (GTK_WIDGET (scale), 300, 35);
gtk_scale_set_digits (GTK_SCALE (scale), 0);
gtk_box_pack_start (GTK_BOX (box1), scale, TRUE, TRUE, 0);
gtk_widget_show (scale);
[SNIP]
--
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]