Hello, I try to build a simple dataviewer with PyGtk. I want to use a
Scale widget to step through the free dimensions of the
multidimensional data.

Q: I use following code

adjustment = GtkAdjustment(0, 0, dim_end, 1, 1, 1)
adjustment.connect("value-changed", lambda _b, barg=count,
adj=adjustment,
                    cb=self.set_free_dim: cb(adj, barg))
                
self.scales[count] = GtkHScale(adjustment)
self.scales[count].set_usize(150, 30)
self.scales[count].set_update_policy(UPDATE_DISCONTINUOUS)
self.scales[count].set_digits(0)
self.scales[count].set_draw_value(TRUE)
table.attach(self.scales[count], 2, 3, count+1, count+2)
self.scales[count].show()


with this dummy callback (barg/count is the number of the dimension)
    
def set_free_dim(self, adj, count):
     print adj.value, count

Is there no other way to get the value of the adjustment in the
callback? This looks not obvious to me.


Next question:

I want to disable the scale widget for the non-free dimensions and use

        self.scales[num].set_state(STATE_INSENSITIVE)

for this. How can I reactivate the scale? I have tried the other
STATE_* parameters without success.

In the end I wonder what other people are programming. Are there
efforts do make higher level widgets? I like pygtk and want to thank
for this nice and promising package.

TIA

__Janko Hauser
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to