Discussion:
Problem with hiding/showing the display of computations (DataInfoLabel)
Timo
2011-07-12 02:50:41 UTC
Permalink
Hi all,

I tried to hide, un-hide the box (a DataInfoLabel?) of a computation.

Here a setup of my plotWidget and the computations (only the important
stuff :-)

trace_plot = CurveWidget(title = 'Time traces',xlabel ='Time [s]',
ylabel= 'Pres. readings [a.u.]')
for i in range(0, len(self.traces)):
disp_format = self.traces[i].get_name() +'=%.5g'
dummy = (self.trace_curves[i], disp_format, lambda x,y:
numpy.trapz(y,x))
quantities_to_compute.append(dummy)
self.integrals = make.computations(self.range, 'TL',
quantities_to_compute)

since the list with the different traces can get quite long and
clutters up the plot, I would like to add an button to toggle the
visibility of the display box of the integrals.


I just tried
self.integrals.hide()
since computations inherits via DataInfoLabel ... AbstractLabelItem ->
QwtPlotItem a hide function. On one hand this seems not to throw any
error, but on the other hand, nothing is happening and my computation
box stays visible. Is this a bug or a feature?

I can not see how to access the visibility status of the integrals on
any other way.
It should be not too complicated, since when one click the checkbox in
the itemlist it is possible to hide/show the corresponding plot item.
But I must admit that I do not completely understand the code for the
itemlist.

Any ideas how to hide/show the computation box, or a label in general?
Loading...