[Python-gtkextra-commits] CVS: python-gtkextra2/examples testgtkplot3d.py,1.1.1.1,1.2
Status: Beta
Brought to you by:
treeves
From: <pyt...@li...> - 2002-12-30 20:42:15
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/examples In directory sc8-pr-cvs1:/tmp/cvs-serv27635/examples Modified Files: testgtkplot3d.py Log Message: more Index: testgtkplot3d.py =================================================================== RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testgtkplot3d.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** testgtkplot3d.py 10 Jul 2002 19:06:52 -0000 1.1.1.1 --- testgtkplot3d.py 30 Dec 2002 20:42:12 -0000 1.2 *************** *** 1,35 **** #!/usr/bin/env python ! from gtk import * ! from gtkextra import * from math import cos ! class Application(GtkWindow): def __init__(self): ! GtkWindow.__init__(self, title="GtkPlot3D Demo") ! self.set_usize(550, 650) ! self.connect("destroy", mainquit) ! scrollwin = GtkScrolledWindow() ! scrollwin.set_policy(POLICY_ALWAYS, POLICY_ALWAYS) self.add(scrollwin) ! canvas = GtkPlotCanvas(PLOT_LETTER_W, PLOT_LETTER_H) ! canvas.plot_canvas_set_flags(PLOT_CANVAS_DND_FLAGS) scrollwin.add_with_viewport(canvas) ! plot = GtkPlot3D(width=0.7, height=0.7) ! plot.axis_set_minor_ticks(PLOT_AXIS_X, 1) ! plot.axis_set_minor_ticks(PLOT_AXIS_Y, 1) ! plot.axis_show_ticks(PLOT_SIDE_XY, PLOT_TICKS_OUT, PLOT_TICKS_OUT) ! plot.axis_show_ticks(PLOT_SIDE_XZ, PLOT_TICKS_OUT, PLOT_TICKS_OUT) ! plot.axis_show_ticks(PLOT_SIDE_YX, PLOT_TICKS_OUT, PLOT_TICKS_OUT) ! plot.axis_show_ticks(PLOT_SIDE_YZ, PLOT_TICKS_OUT, PLOT_TICKS_OUT) ! plot.axis_show_ticks(PLOT_SIDE_ZX, PLOT_TICKS_OUT, PLOT_TICKS_OUT) ! plot.axis_show_ticks(PLOT_SIDE_ZY, PLOT_TICKS_OUT, PLOT_TICKS_OUT) canvas.add_plot(plot, 0.10, 0.06) ! surface = GtkPlotSurface(self.function) surface.set_xstep(0.025) surface.set_ystep(0.025) --- 1,37 ---- #!/usr/bin/env python ! import gtk ! import gtkextra from math import cos ! class Application(gtk.Window): def __init__(self): ! gtk.Window.__init__(self) ! self.set_title=("GtkPlot3D Demo") ! self.set_size_request(550, 650) ! self.connect("destroy", self.quit) ! scrollwin = gtk.ScrolledWindow() ! scrollwin.set_policy(gtk.POLICY_ALWAYS, gtk.POLICY_ALWAYS) self.add(scrollwin) ! canvas = gtkextra.PlotCanvas(gtkextra.PLOT_LETTER_W, gtkextra.PLOT_LETTER_H) ! canvas.plot_canvas_set_flags(gtkextra.PLOT_CANVAS_DND_FLAGS) scrollwin.add_with_viewport(canvas) ! plot = gtkextra.Plot3D(width=0.7, height=0.7) ! plot.axis_set_minor_ticks(gtkextra.PLOT_AXIS_X, 1) ! plot.axis_set_minor_ticks(gtkextra.PLOT_AXIS_Y, 1) ! plot.axis_show_ticks(gtkextra.PLOT_SIDE_XY, gtkextra.PLOT_TICKS_OUT, gtkextra.PLOT_TICKS_OUT) ! plot.axis_show_ticks(gtkextra.PLOT_SIDE_XZ, gtkextra.PLOT_TICKS_OUT, gtkextra.PLOT_TICKS_OUT) ! plot.axis_show_ticks(gtkextra.PLOT_SIDE_YX, gtkextra.PLOT_TICKS_OUT, gtkextra.PLOT_TICKS_OUT) ! plot.axis_show_ticks(gtkextra.PLOT_SIDE_YZ, gtkextra.PLOT_TICKS_OUT, gtkextra.PLOT_TICKS_OUT) ! plot.axis_show_ticks(gtkextra.PLOT_SIDE_ZX, gtkextra.PLOT_TICKS_OUT, gtkextra.PLOT_TICKS_OUT) ! plot.axis_show_ticks(gtkextra.PLOT_SIDE_ZY, gtkextra.PLOT_TICKS_OUT, gtkextra.PLOT_TICKS_OUT) canvas.add_plot(plot, 0.10, 0.06) ! #surface = gtkextra.PlotSurface(self.function) #FIXME SOON ! surface = gtkextra.PlotSurface() surface.set_xstep(0.025) surface.set_ystep(0.025) *************** *** 37,49 **** plot.add_data(surface) ! button = GtkButton("Rotate X") button.connect("clicked", self.rotate_x, canvas, plot) canvas.put(button, 150, 0) ! button = GtkButton("Rotate Y") button.connect("clicked", self.rotate_y, canvas, plot) canvas.put(button, 230, 0) ! button = GtkButton("Rotate Z") button.connect("clicked", self.rotate_z, canvas, plot) canvas.put(button, 310, 0) --- 39,51 ---- plot.add_data(surface) ! button = gtk.Button("Rotate X") button.connect("clicked", self.rotate_x, canvas, plot) canvas.put(button, 150, 0) ! button = gtk.Button("Rotate Y") button.connect("clicked", self.rotate_y, canvas, plot) canvas.put(button, 230, 0) ! button = gtk.Button("Rotate Z") button.connect("clicked", self.rotate_z, canvas, plot) canvas.put(button, 310, 0) *************** *** 79,83 **** mainloop() ! if __name__ == '__main__': app = Application() ! app.mainloop() --- 81,88 ---- mainloop() ! def quit(self, *args): ! gtk.main_quit() ! ! if __name__ == '__main__': app = Application() ! gtk.main() |