Thread: [Python-gtkextra-commits] CVS: python-gtkextra2/examples test.sh,1.2,1.3 testgtkplot.py,1.5,1.6 test
Status: Beta
Brought to you by:
treeves
From: <pyt...@li...> - 2002-12-24 18:49:13
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/examples In directory sc8-pr-cvs1:/tmp/cvs-serv4818/examples Modified Files: test.sh testgtkplot.py testrealtime.py Log Message: Working toward first release. Much works correctly now. Index: test.sh =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/test.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test.sh 22 Jul 2002 13:06:54 -0000 1.2 --- test.sh 24 Dec 2002 18:49:10 -0000 1.3 *************** *** 10,21 **** fi ! export PYTHONPATH=../:../gtkextra/:$PYTHONPATH if test -z $DEBUG; then ! python2 -c "import ltihooks;del ltihooks;execfile('$1')" else ! python2 -c "\ ! import ltihooks ! del ltihooks import os raw_input('Attach gdb on %d. Press return to begin \"$1\".' % os.getpid()) --- 10,20 ---- fi ! #export PYTHONPATH=../:../gtkextra/:$PYTHONPATH ! export PYTHONPATH=../:$PYTHONPATH if test -z $DEBUG; then ! python -c "execfile('$1')" else ! python -c "\ import os raw_input('Attach gdb on %d. Press return to begin \"$1\".' % os.getpid()) Index: testgtkplot.py =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testgtkplot.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** testgtkplot.py 22 Jul 2002 13:06:54 -0000 1.5 --- testgtkplot.py 24 Dec 2002 18:49:10 -0000 1.6 *************** *** 9,14 **** def __init__(self): - self.hack = [] - self.nlayers = 0 self.buttons = [] --- 9,12 ---- *************** *** 68,78 **** canvas.connect("select_item", self.select_item) ! canvas.put_text(0.40, 0.02, "Times-BoldItalic", 16, 0, None, None, gtk.TRUE, gtk.JUSTIFY_CENTER, "DnD titles, legends and plots") ! canvas.put_text(0.40, 0.72, "Times-Roman", 16, 0, None, None, gtk.TRUE, gtk.JUSTIFY_CENTER, "You can use \\ssubscripts\\b\\b\\b\\b\\b\\b\\b"\ "\\b\\b\\b\\N\\Ssuperscripts") ! child = canvas.put_text(0.40, 0.755, "Times-Roman", 16, 0, None, None, gtk.TRUE, gtk.JUSTIFY_CENTER, "Format text mixing \\Bbold \\N\\i, italics, "\ --- 66,76 ---- canvas.connect("select_item", self.select_item) ! canvas.put_text(0.40, 0.02, "Helvetica", 16, 0, None, None, gtk.TRUE, gtk.JUSTIFY_CENTER, "DnD titles, legends and plots") ! canvas.put_text(0.40, 0.72, "Helvetica", 16, 0, None, None, gtk.TRUE, gtk.JUSTIFY_CENTER, "You can use \\ssubscripts\\b\\b\\b\\b\\b\\b\\b"\ "\\b\\b\\b\\N\\Ssuperscripts") ! child = canvas.put_text(0.40, 0.755, "Helvetica", 16, 0, None, None, gtk.TRUE, gtk.JUSTIFY_CENTER, "Format text mixing \\Bbold \\N\\i, italics, "\ *************** *** 83,91 **** self.show_all() ! canvas.export_ps_with_size("plotdemo.ps", eps=gtk.TRUE) print "Wrote plotdemo.ps" def move_item(self, canvas, item, new_x, new_y, *args): if item.type == gtkextra.PLOT_CANVAS_DATA: print "MOVING DATA" --- 81,90 ---- self.show_all() ! canvas.export_ps_with_size("plotdemo.ps", epsflag=gtk.TRUE) print "Wrote plotdemo.ps" def move_item(self, canvas, item, new_x, new_y, *args): + print "move_item" if item.type == gtkextra.PLOT_CANVAS_DATA: print "MOVING DATA" *************** *** 93,100 **** print "Active point: %d -> %f %f" % (i, new_x, new_y) data = canvas.get_active_data() ! x,y,dx,dy = data.get_points() x[i] = new_x y[i] = new_y ! data.set_points(x=x, y=y) return gtk.TRUE --- 92,99 ---- print "Active point: %d -> %f %f" % (i, new_x, new_y) data = canvas.get_active_data() ! x, y, dx, dy = data.x, data.y, data.dx, data.dy x[i] = new_x y[i] = new_y ! data.set_points(x=x, y=y, dx=dx, dy=dy) return gtk.TRUE *************** *** 186,191 **** data.show_yerrbars() data.set_legend("Spline + EY") - self.hack.append(data) #FIXME: Crashes without holding this. I think plot.add_data() should do a ref(). - data = gtkextra.PlotData() --- 185,188 ---- *************** *** 198,202 **** data.set_y_attributes(gtkextra.PLOT_LINE_SOLID, 0, 0, 0, black) data.set_legend("Line + Symbol") - self.hack.append(data) #FIXME: Crashes without holding this. I think plot.add_data() should do a ref(). #data = plot.add_function(self.function) --- 195,198 ---- *************** *** 224,228 **** data.set_connector(gtkextra.PLOT_CONNECT_NONE) data.set_legend("V Bars") - self.hack.append(data) #FIXME: Crashes without holding this. I think plot.add_data() should do a ref(). def function(self, x, *extra): --- 220,223 ---- Index: testrealtime.py =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testrealtime.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testrealtime.py 16 Jul 2002 17:05:14 -0000 1.2 --- testrealtime.py 24 Dec 2002 18:49:10 -0000 1.3 *************** *** 7,11 **** def __init__(self): - self.hack = []; gtk.Window.__init__(self) self.set_title("GtkPlot Real Time Demo") --- 7,10 ---- *************** *** 35,40 **** plot.axis_set_ticks(gtkextra.PLOT_AXIS_X, 2.0, 1) plot.axis_set_ticks(gtkextra.PLOT_AXIS_Y, 0.1, 1) ! plot.axis_set_labels_numbers(gtkextra.PLOT_AXIS_TOP, gtkextra.PLOT_LABEL_FLOAT, 0) ! plot.axis_set_labels_numbers(gtkextra.PLOT_AXIS_BOTTOM, gtkextra.PLOT_LABEL_FLOAT, 0) plot.axis_set_visible(gtkextra.PLOT_AXIS_TOP, gtk.TRUE) plot.axis_set_visible(gtkextra.PLOT_AXIS_RIGHT, gtk.TRUE) --- 34,39 ---- plot.axis_set_ticks(gtkextra.PLOT_AXIS_X, 2.0, 1) plot.axis_set_ticks(gtkextra.PLOT_AXIS_Y, 0.1, 1) ! plot.axis_set_labels_style(gtkextra.PLOT_AXIS_TOP, gtkextra.PLOT_LABEL_FLOAT, 0) ! plot.axis_set_labels_style(gtkextra.PLOT_AXIS_BOTTOM, gtkextra.PLOT_LABEL_FLOAT, 0) plot.axis_set_visible(gtkextra.PLOT_AXIS_TOP, gtk.TRUE) plot.axis_set_visible(gtkextra.PLOT_AXIS_RIGHT, gtk.TRUE) *************** *** 48,52 **** canvas.add_plot(plot, 0.15, 0.15) ! canvas.put_text(0.45, 0.05, "Times-BoldItalic", 20, 0, None, None, gtk.TRUE, gtk.JUSTIFY_CENTER, "Real Time Demo") --- 47,53 ---- canvas.add_plot(plot, 0.15, 0.15) ! #canvas.put_text(0.45, 0.05, "Times-BoldItalic", 20, 0, None, None, ! #canvas.put_text(0.45, 0.05, "Courier-Bold", 20, 0, None, None, #OK ! canvas.put_text(0.45, 0.05, "Helvetica", 20, 0, None, None, #OK gtk.TRUE, gtk.JUSTIFY_CENTER, "Real Time Demo") *************** *** 56,60 **** data.set_symbol(gtkextra.PLOT_SYMBOL_DIAMOND, gtkextra.PLOT_SYMBOL_OPAQUE, 10, 2, red, red) data.set_line_attributes(gtkextra.PLOT_LINE_SOLID, 0, 0, 1, red) - self.hack.append(data) plot.clip_data(gtk.TRUE) --- 57,60 ---- *************** *** 67,72 **** y = randint(0, 9) / 10.0 ! px = data.get_x() ! py = data.get_y() if px is None : px = [] if py is None : py = [] --- 67,72 ---- y = randint(0, 9) / 10.0 ! px = data.x ! py = data.y if px is None : px = [] if py is None : py = [] |