Thread: [Python-gtkextra-commits] CVS: python-gtkextra/examples testboxes.py,1.1.1.1,1.2 testcontour.py,1.1.
Status: Beta
Brought to you by:
treeves
From: Andreas V?g. <voe...@us...> - 2002-01-03 22:44:07
|
Update of /cvsroot/python-gtkextra/python-gtkextra/examples In directory usw-pr-cvs1:/tmp/cvs-serv18294/examples Modified Files: testboxes.py testcontour.py testgtkplot.py testgtksheet.py Log Message: GtkExtra-0.99.17 update Index: testboxes.py =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra/examples/testboxes.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** testboxes.py 2001/09/15 18:52:40 1.1.1.1 --- testboxes.py 2002/01/03 22:44:04 1.2 *************** *** 37,41 **** def build_example1(self, plot): px1 = [0.0, 0.2, 0.4, 0.6, 0.8, 1.0] ! py1 = [0.2, 0.4, 0.5, 0.35, 0.30, 0.40] pz1 = [0.12, 0.22, 0.27, 0.12, 0.052, 0.42] dz1 = [0.0243, 0.045, 0.075, 0.0213, 0.05, 0.0324] --- 37,41 ---- def build_example1(self, plot): px1 = [0.0, 0.2, 0.4, 0.6, 0.8, 1.0] ! py1 = [0.56, 0.12, 0.123, 0.5, 0.2, 0.21] pz1 = [0.12, 0.22, 0.27, 0.12, 0.052, 0.42] dz1 = [0.0243, 0.045, 0.075, 0.0213, 0.05, 0.0324] *************** *** 51,55 **** data.set_dz(dz1) data.show_zerrbars() ! data.set_symbol(PLOT_SYMBOL_NONE, PLOT_SYMBOL_FILLED, 10, 2, yellow, red) data.set_line_attributes(PLOT_LINE_NONE, 1, red) --- 51,55 ---- data.set_dz(dz1) data.show_zerrbars() ! data.set_symbol(PLOT_SYMBOL_CIRCLE, PLOT_SYMBOL_FILLED, 10, 2, yellow, red) data.set_line_attributes(PLOT_LINE_NONE, 1, red) Index: testcontour.py =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra/examples/testcontour.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** testcontour.py 2001/09/15 18:52:36 1.1.1.1 --- testcontour.py 2002/01/03 22:44:04 1.2 *************** *** 30,34 **** surface.set_ystep(0.025) surface.set_legend("cos ((r-r\\s0\\N)\\S2\\N)") ! surface.set_gradient(0.2, 0.8, 6) plot.add_data(surface) --- 30,35 ---- surface.set_ystep(0.025) surface.set_legend("cos ((r-r\\s0\\N)\\S2\\N)") ! surface.set_gradient(0.2, 0.8, 6, 3) ! surface.set_lines_visible(FALSE) plot.add_data(surface) *************** *** 42,46 **** surface.set_ystep(0.025) surface.set_legend("cos ((r-r\\s0\\N)\\S2\\N)") ! surface.set_gradient(0.2, 0.8, 6) surface.set_grid_visible(FALSE) surface.set_lines_only(TRUE) --- 43,47 ---- surface.set_ystep(0.025) surface.set_legend("cos ((r-r\\s0\\N)\\S2\\N)") ! surface.set_gradient(0.2, 0.8, 6, 0) surface.set_grid_visible(FALSE) surface.set_lines_only(TRUE) Index: testgtkplot.py =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra/examples/testgtkplot.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** testgtkplot.py 2001/09/15 18:52:41 1.1.1.1 --- testgtkplot.py 2002/01/03 22:44:04 1.2 *************** *** 63,66 **** --- 63,67 ---- canvas.add_plot(plot, 0.15, 0.4) self.build_example2(plot) + canvas.connect("move_item", self.move_item) canvas.connect("select_item", self.select_item) *************** *** 85,88 **** --- 86,101 ---- pass + def move_item(self, canvas, item, new_x, new_y, *args): + if item.type == PLOT_CANVAS_DATA: + print "MOVING DATA" + (i, old_x, old_y) = canvas.get_active_point() + print "Active point: %d -> %f %f" % (i, new_x, new_y) + data = canvas.get_active_data() + points = data.get_points() + points[0][i] = new_x + points[1][i] = new_y + data.set_points(points) + return TRUE + def select_item(self, canvas, event, item, *args): if item.type == PLOT_CANVAS_TEXT: *************** *** 100,103 **** --- 113,122 ---- elif item.type == PLOT_CANVAS_DATA: print "Item selected: DATA" + (i, x, y) = canvas.get_active_point() + print "Active point: %d -> %f %f" % (i, x, y) + #canvas.get_active_data().add_marker(i) + #canvas.get_active_plot().queue_draw() + elif item.type == PLOT_CANVAS_MARKER: + print "Item selected: MARKER" elif item.type == PLOT_CANVAS_NONE: print "Item selected: NONE" Index: testgtksheet.py =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra/examples/testgtksheet.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** testgtksheet.py 2001/09/15 18:52:40 1.1.1.1 --- testgtksheet.py 2002/01/03 22:44:04 1.2 *************** *** 26,30 **** colormap = self.get_colormap() ! for column in xrange(self.get_columns_count()): name = chr(ord("A") + column) --- 26,33 ---- colormap = self.get_colormap() ! ! self.set_background(colormap.alloc("light yellow")) ! self.set_grid(colormap.alloc("light blue")) ! for column in xrange(self.get_columns_count()): name = chr(ord("A") + column) *************** *** 251,254 **** --- 254,259 ---- def __init__(self): GtkSheet.__init__(self, 1000, 26, "Example 3") + + self.show_grid(FALSE) colormap = self.get_colormap() |