You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
(1) |
Aug
|
Sep
(15) |
Oct
(32) |
Nov
(35) |
Dec
(48) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(46) |
Feb
(22) |
Mar
(65) |
Apr
(49) |
May
(22) |
Jun
(29) |
Jul
(51) |
Aug
(34) |
Sep
(32) |
Oct
(46) |
Nov
(30) |
Dec
(32) |
2002 |
Jan
(48) |
Feb
(4) |
Mar
(20) |
Apr
(28) |
May
(13) |
Jun
(34) |
Jul
(51) |
Aug
(15) |
Sep
(15) |
Oct
(35) |
Nov
(15) |
Dec
(20) |
2003 |
Jan
(31) |
Feb
(111) |
Mar
(41) |
Apr
(28) |
May
(36) |
Jun
(29) |
Jul
(27) |
Aug
(29) |
Sep
(47) |
Oct
(28) |
Nov
(7) |
Dec
(26) |
2004 |
Jan
(44) |
Feb
(9) |
Mar
(17) |
Apr
(26) |
May
(58) |
Jun
(13) |
Jul
(44) |
Aug
(64) |
Sep
(30) |
Oct
(11) |
Nov
(21) |
Dec
(28) |
2005 |
Jan
(29) |
Feb
(11) |
Mar
(11) |
Apr
(22) |
May
(85) |
Jun
(46) |
Jul
(17) |
Aug
(18) |
Sep
(14) |
Oct
(22) |
Nov
(1) |
Dec
(45) |
2006 |
Jan
(20) |
Feb
(36) |
Mar
(18) |
Apr
(24) |
May
(21) |
Jun
(48) |
Jul
(23) |
Aug
(20) |
Sep
(10) |
Oct
(41) |
Nov
(46) |
Dec
(40) |
2007 |
Jan
(40) |
Feb
(20) |
Mar
(13) |
Apr
(6) |
May
(24) |
Jun
(31) |
Jul
(30) |
Aug
(11) |
Sep
(11) |
Oct
(10) |
Nov
(56) |
Dec
(64) |
2008 |
Jan
(64) |
Feb
(22) |
Mar
(63) |
Apr
(28) |
May
(25) |
Jun
(36) |
Jul
(11) |
Aug
(9) |
Sep
(14) |
Oct
(41) |
Nov
(46) |
Dec
(130) |
2009 |
Jan
(95) |
Feb
(41) |
Mar
(24) |
Apr
(35) |
May
(53) |
Jun
(67) |
Jul
(48) |
Aug
(48) |
Sep
(86) |
Oct
(75) |
Nov
(64) |
Dec
(52) |
2010 |
Jan
(57) |
Feb
(31) |
Mar
(28) |
Apr
(40) |
May
(25) |
Jun
(42) |
Jul
(79) |
Aug
(31) |
Sep
(49) |
Oct
(66) |
Nov
(38) |
Dec
(25) |
2011 |
Jan
(29) |
Feb
(18) |
Mar
(44) |
Apr
(6) |
May
(28) |
Jun
(31) |
Jul
(36) |
Aug
(24) |
Sep
(30) |
Oct
(23) |
Nov
(21) |
Dec
(27) |
2012 |
Jan
(14) |
Feb
(11) |
Mar
(2) |
Apr
(48) |
May
(7) |
Jun
(32) |
Jul
(22) |
Aug
(25) |
Sep
(31) |
Oct
(32) |
Nov
(21) |
Dec
(17) |
2013 |
Jan
(44) |
Feb
(27) |
Mar
(3) |
Apr
(1) |
May
|
Jun
|
Jul
(3) |
Aug
(4) |
Sep
(1) |
Oct
(7) |
Nov
(5) |
Dec
(5) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
(2) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: P H B. <p.h...@bh...> - 2010-07-24 23:40:55
|
For those interested in BASIC, suggest you google "BBC BASIC for windows" and "Virtual Acorn" These relate to what is perhaps the best ever version of BASIC, viz BBC BASIC ----- Original Message ----- From: "Joel Kahn" <jj...@ya...> To: <vis...@li...> Sent: Saturday, July 24, 2010 1:13 AM Subject: [Visualpython-users] BASIC-256 This is technically off-topic, but hopefully not too far.... http://www.basic256.org BASIC-256 is a 2D environment as opposed to the 3D of VPython; however, BASIC-256 does have some very interesting features. Depending on what subjects you're teaching and how you're teaching them, BASIC-256 might be worth a long look. Joel ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Visualpython-users mailing list Vis...@li... https://lists.sourceforge.net/lists/listinfo/visualpython-users |
From: Bruce S. <bas...@nc...> - 2010-07-24 20:23:33
|
I'm not competent to comment on the other issues you raise, but the answer to the question below is no, you can run VPython on MacOSX by installing the binaries available on the Mac download page at vpython.org. Or you can use the packages available in fink. It is not necessary to build from source to be able to use VPython on the Mac. Bruce Sherwood On Sat, Jul 24, 2010 at 8:17 AM, K. Uebayashi <u.k...@gm...> wrote: > > Is it the only way to use source-built visualpython in MacOSX? > |
From: K. U. <u.k...@gm...> - 2010-07-24 14:17:40
|
Hi, Used this patch, https://build.opensuse.org/package/view_file?file=gtkglext-deprecated_macros.patch&package=gtkglext&project=home%3Acwh , I fixed gtkglext @1.2.0_4(MacPorts) bug in my local MacOSX. The bug(https://svn.macports.org/ticket/25160) is removed, so ghemical runs. # Although removing the gtkglext bug, Visualpython does not run with my patch for OSX_CPPFLAGS & $(GTHREAD_LIBS) visual-5.32_release has been build, but in the build directory(visual-5.32_release/site-packages) I can not import visual. When I import visual in python prompt, python is clashed. Is it the only way to use source-built visualpython in MacOSX? I attached "python -v" log after importing visual. -- K. Uebayashi |
From: K. U. <u.k...@gm...> - 2010-07-24 07:46:51
|
Hi, I found same problem in macports ticket . https://svn.macports.org/ticket/25782 It said " gtkglext @1.2.0_4 is not compatible with gtk2 @2.20.1_0 as revealed in ticket:25160. See the thread at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=585155 for further info. " I'm try to build locally with debian patch. -- K. Uebayashi |
From: Joel K. <jj...@ya...> - 2010-07-24 00:13:33
|
This is technically off-topic, but hopefully not too far.... http://www.basic256.org BASIC-256 is a 2D environment as opposed to the 3D of VPython; however, BASIC-256 does have some very interesting features. Depending on what subjects you're teaching and how you're teaching them, BASIC-256 might be worth a long look. Joel |
From: K. U. <u.k...@gm...> - 2010-07-21 02:14:56
|
Hi, I made this patch (now I'm using 5-3.2), ================ --- visual-5.32_releaseORIG/src/Makefile.in 2010-01-31 05:31:57.000000000 +0900 +++ visual-5.32_release/src/Makefile.in 2010-07-21 07:27:31.000000000 +0900 @@ -43,7 +43,8 @@ # Prevent using the broken Apple C preprocessor, # silence a warning from Python 2.3, which uses a long double for padding # in an inconvient place for Apple's GCC. -OSX_CPPFLAGS = #-no-cpp-precomp -fno-common -Wno-long-double +OSX_CPPFLAGS = -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include \ + #-no-cpp-precomp -fno-common -Wno-long-double # System configuration variables for Unix-like systems GTK_LIBS = @GTK_LIBS@ @@ -115,7 +116,7 @@ # and not another one with a similar name that you happen to fancy"), but it isn't. # On Leopard (10.5), it must be used whenever you link with /usr/X11/lib/libGL.dylib # (even indirectly, for example by linking with libgtkgl-2.0.dylib)." -_OSX_SORULE = $(CXX) -v -bundle -bundle_loader $(PYTHON) \ +_OSX_SORULE = $(CXX) -v -bundle -undefined dynamic_lookup \ $(CVISUAL_LDFLAGS) $(LDFLAGS) -o $@ $^ $(CVISUAL_LIBS) $(LIBS) \ -Wl,-exported_symbols_list,$(srcdir)/osx-symbols.txt \ -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib @@ -199,7 +200,7 @@ ifeq ($(PYTHON_PLATFORM),darwin) # Special rules for OSX CVISUAL_LIBS += $(filter-out $(_FILTER_OUT), $(GTK_LIBS) \ - $(GTHREAD_LIBS) /sw/lib/libboost_python-mt.a -lboost_thread-mt -lboost_signals) + $(GTHREAD_LIBS) /opt/local/lib/libboost_python-mt.a -lboost_thread-mt -lboost_signals) CXX_RULE = $(DEFAULT_CXX_RULE) LINK_RULE = $(OSX_SORULE) PLATFORM_TARGET = cvisualmodule.so =========== and , $ ./configure --prefix=/opt/local $ make , so they work.(I attached config.log & build.log) As I try to use visual python in site-packages/ directory, $ python Python 2.6.5 (r265:79063, Jul 9 2010, 16:00:04) [GCC 4.2.1 (Apple Inc. build 5659)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import visual Traceback (most recent call last): File "<stdin>", line 1, in <module> File "visual/__init__.py", line 59, in <module> import cvisual ImportError: dlopen(./cvisualmodule.so, 2): Symbol not found: _GTK_WIDGET_NO_WINDOW Referenced from: /opt/local/lib/libgtkglext-x11-1.0.0.dylib Expected in: flat namespace in /opt/local/lib/libgtkglext-x11-1.0.0.dylib >>> . These are new error message. Did I build visual python correctly with my patch ? Can I remove the new error message ? -- K. Uebayashi |
From: Daπid <dav...@gm...> - 2010-07-21 00:28:48
|
Hello. On Wed, Jun 9, 2010 at 6:11 PM, Davidmh <dav...@gm...> wrote: > Hello. I have finally fixed the problem in a somewhat silly way: > > try: from visual import * > except:pass > > I figure the crash is before the important parts of visual are > imported, so it can go ahead. It won't work on programs that depend on > materials. In some new scritps, when I compile them with py2exe, I get: Traceback (most recent call last): File "show_scene.py", line 5, in <module> NameError: name 'display' is not defined Of course, the original .py script, before Py2exe works great without raising errors. The five first lines, until the crash are: 1· try: from visual import * 2· except IOError: pass 3· 4· 5· scene=display() Trying to figure how to solve it, I remembered some VPython scripts I compiled some months ago, that were functional; but when I try to run them, I get similar errors. In this same computer, they ran perfectly time ago. I don't remember doing any big modification in the OS (appart from the security updates), nor touching the Python installation (although this should work anyway). More testing brings more weird results. Testing both old and new scripts in another similar computer, the old one works great (as it should), but the new one still says the same error. Anyone has any idea on why is it happening and how to solve? Thank you very much. David. P.D.: if anyone needs the complete scritps, just ask for them; I don't have any problem in publishing them. |
From: Bruce S. <bas...@nc...> - 2010-07-20 16:58:31
|
I see. Then let's hope that Martin Costabel's advice solves the problem for those interested. Bruce Sherwood On Tue, Jul 20, 2010 at 7:03 AM, Lenore Horner <lh...@si...> wrote: >> Also, what problem >> are you trying to address by trying to build Visual in the darwin >> environment rather than using the fink package or the native Mac >> package? >> >> Bruce Sherwood > > I'm not trying this, but I'd like to be able to do it. Installing Visual as instructed leads to yet another installation of Python on my system. ( I know, disks are huge, but it seems so silly.) I use MacPorts for a couple of packages and the general statement from both fink and MacPorts is don't use Fink and MacPorts at the same time (even though they install in different paths), so the Fink package isn't particularly helpful. If we figure out how to compile against some other python than MacPython, then we can make a MacPorts package and folks will have one more option for installation. > > Lenore Horner > > |
From: Bruce S. <bas...@nc...> - 2010-07-20 16:56:50
|
Thanks much for the helpful information, Martin. Why don't I have problems building the native-mode version of VPython on the Mac, using either Python 2.5 or Python 2.6? The makefile I'm using contains -bundle_loader. Bruce Sherwood On Tue, Jul 20, 2010 at 3:56 AM, Martin Costabel <cos...@wa...> wrote: > Bruce Sherwood wrote: >> >> The missing links all seem to be Python symbols such as >> _PyExc_RuntimeError and _PyInt_AsLong, which are part of the Python >> API for connecting to C. I don't have any experience with the darwin >> environment, but maybe someone on this list will recognize what the >> problem is. > > It is a problem with python-2.6. There the python executable does not export > the symbols such as PyExc_RuntimeError any more, as it did until python2.5. > > Up to python2.5, the external symbols in the python executable were > identical to those in the python library libpython. The recommended way to > link python modules on MacOSX (and this is what is coded in src/Makefile.in) > was to use the "-bundle_loader $PYTHON" flag, meaning that symbols in the > module were resolved from the python executable. Linking with the python > library instead led to a runtime error "interpreter version mismatch". > > On python2.6 (I haven't looked at later versions yet), this is different. > Now the python executable itself is linked with the python library. You need > to link the module with the flag "-undefined dynamic_lookup" instead of > -bundle_loader. At runtime, the symbols are then looked up from the python > library. > > For the Fink visual-py26 package, I am patching src/Makefile.in > correspondingly. I have not found a way to link cvisualmodule.so that would > work both with (Fink's) python2.5 and python2.6. > > -- > Martin > > |
From: Stefano M. <mwi...@gm...> - 2010-07-20 15:13:19
|
Thanks Stef On 07/20/2010 03:50 PM, Stef Mientki wrote: > On 20-07-2010 13:39, Stefano Mtangoo wrote: > >> seems like I'm missing something. >> Could you give an example on how you override that? >> > class My_App ( wx.App ) : > > def MainLoop(self): > # take over the event loop, but save the old one > self.My_EventLoop = wx.EventLoop () > old = wx.EventLoop.GetActive () > wx.EventLoop.SetActive ( self.My_EventLoop ) > > while PG.App_Running : > > do what ever you like here, e.g. do a step of VPython > > while self.My_EventLoop.Pending(): > self.My_EventLoop.Dispatch() > self.ProcessIdle() > > # normally 50 fps > ddT = Application.VM_Delay - ( time.time() - Loop_Time ) > if ddT> 0 : > time.sleep ( ddT ) > Loop_Time = time.time() > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |
From: Lenore H. <lh...@si...> - 2010-07-20 13:22:32
|
> Also, what problem > are you trying to address by trying to build Visual in the darwin > environment rather than using the fink package or the native Mac > package? > > Bruce Sherwood I'm not trying this, but I'd like to be able to do it. Installing Visual as instructed leads to yet another installation of Python on my system. ( I know, disks are huge, but it seems so silly.) I use MacPorts for a couple of packages and the general statement from both fink and MacPorts is don't use Fink and MacPorts at the same time (even though they install in different paths), so the Fink package isn't particularly helpful. If we figure out how to compile against some other python than MacPython, then we can make a MacPorts package and folks will have one more option for installation. Lenore Horner |
From: Stef M. <ste...@gm...> - 2010-07-20 12:50:53
|
On 20-07-2010 13:39, Stefano Mtangoo wrote: > seems like I'm missing something. > Could you give an example on how you override that? class My_App ( wx.App ) : def MainLoop(self): # take over the event loop, but save the old one self.My_EventLoop = wx.EventLoop () old = wx.EventLoop.GetActive () wx.EventLoop.SetActive ( self.My_EventLoop ) while PG.App_Running : do what ever you like here, e.g. do a step of VPython while self.My_EventLoop.Pending(): self.My_EventLoop.Dispatch() self.ProcessIdle() # normally 50 fps ddT = Application.VM_Delay - ( time.time() - Loop_Time ) if ddT > 0 : time.sleep ( ddT ) Loop_Time = time.time() |
From: Stefano M. <mwi...@gm...> - 2010-07-20 11:40:06
|
seems like I'm missing something. Could you give an example on how you override that? On 07/20/2010 02:35 PM, Stef Mientki wrote: > On 20-07-2010 10:44, Stefano Mtangoo wrote: > >> Definitely, >> How do you marry them? >> Do you alternate btwn eventloops? >> > The VPython event loop runs within the (overriden) wx-eventloop. > > cheers, > Stef > >> On 07/20/2010 11:11 AM, Stef Mientki wrote: >> >>> On 20-07-2010 07:47, Stefano Mtangoo wrote: >>> >>> >>>> Hello friends, >>>> I have been for long out of Vpython for long now, but I have plans to >>>> develop Scientific simulation >>>> Program for Physics students. As we know, Visual Did not support >>>> integration with wxPython or any toolkit. >>>> Is that possible now? If no what are plans to implement that feature? >>>> Thanks >>>> >>>> >>> you mean something like this >>> http://mientki.ruhosting.nl/data_www/pylab_works/pw_application_vpython3.html >>> >>> cheers, >>> Stef >>> >>> ------------------------------------------------------------------------------ >>> This SF.net email is sponsored by Sprint >>> What will you do first with EVO, the first 4G phone? >>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >>> _______________________________________________ >>> Visualpython-users mailing list >>> Vis...@li... >>> https://lists.sourceforge.net/lists/listinfo/visualpython-users >>> >>> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> Visualpython-users mailing list >> Vis...@li... >> https://lists.sourceforge.net/lists/listinfo/visualpython-users >> > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |
From: Stef M. <ste...@gm...> - 2010-07-20 11:35:19
|
On 20-07-2010 10:44, Stefano Mtangoo wrote: > Definitely, > How do you marry them? > Do you alternate btwn eventloops? The VPython event loop runs within the (overriden) wx-eventloop. cheers, Stef > > On 07/20/2010 11:11 AM, Stef Mientki wrote: >> On 20-07-2010 07:47, Stefano Mtangoo wrote: >> >>> Hello friends, >>> I have been for long out of Vpython for long now, but I have plans to >>> develop Scientific simulation >>> Program for Physics students. As we know, Visual Did not support >>> integration with wxPython or any toolkit. >>> Is that possible now? If no what are plans to implement that feature? >>> Thanks >>> >> you mean something like this >> http://mientki.ruhosting.nl/data_www/pylab_works/pw_application_vpython3.html >> >> cheers, >> Stef >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> Visualpython-users mailing list >> Vis...@li... >> https://lists.sourceforge.net/lists/listinfo/visualpython-users >> > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |
From: Martin C. <cos...@wa...> - 2010-07-20 09:56:58
|
Bruce Sherwood wrote: > The missing links all seem to be Python symbols such as > _PyExc_RuntimeError and _PyInt_AsLong, which are part of the Python > API for connecting to C. I don't have any experience with the darwin > environment, but maybe someone on this list will recognize what the > problem is. It is a problem with python-2.6. There the python executable does not export the symbols such as PyExc_RuntimeError any more, as it did until python2.5. Up to python2.5, the external symbols in the python executable were identical to those in the python library libpython. The recommended way to link python modules on MacOSX (and this is what is coded in src/Makefile.in) was to use the "-bundle_loader $PYTHON" flag, meaning that symbols in the module were resolved from the python executable. Linking with the python library instead led to a runtime error "interpreter version mismatch". On python2.6 (I haven't looked at later versions yet), this is different. Now the python executable itself is linked with the python library. You need to link the module with the flag "-undefined dynamic_lookup" instead of -bundle_loader. At runtime, the symbols are then looked up from the python library. For the Fink visual-py26 package, I am patching src/Makefile.in correspondingly. I have not found a way to link cvisualmodule.so that would work both with (Fink's) python2.5 and python2.6. -- Martin |
From: Stefano M. <mwi...@gm...> - 2010-07-20 08:44:43
|
Definitely, How do you marry them? Do you alternate btwn eventloops? On 07/20/2010 11:11 AM, Stef Mientki wrote: > On 20-07-2010 07:47, Stefano Mtangoo wrote: > >> Hello friends, >> I have been for long out of Vpython for long now, but I have plans to >> develop Scientific simulation >> Program for Physics students. As we know, Visual Did not support >> integration with wxPython or any toolkit. >> Is that possible now? If no what are plans to implement that feature? >> Thanks >> > you mean something like this > http://mientki.ruhosting.nl/data_www/pylab_works/pw_application_vpython3.html > > cheers, > Stef > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |
From: Stef M. <ste...@gm...> - 2010-07-20 08:11:51
|
On 20-07-2010 07:47, Stefano Mtangoo wrote: > Hello friends, > I have been for long out of Vpython for long now, but I have plans to > develop Scientific simulation > Program for Physics students. As we know, Visual Did not support > integration with wxPython or any toolkit. > Is that possible now? If no what are plans to implement that feature? > Thanks you mean something like this http://mientki.ruhosting.nl/data_www/pylab_works/pw_application_vpython3.html cheers, Stef |
From: Chris F. <cf...@th...> - 2010-07-20 07:46:55
|
You can run Visual Python "alongside" any toolkit, I believe. You can do this with most toolkits, actually, it's just a tricky juggling act, and usually not worth it. All you need to do is run one event loop at a time, and swap between (among?!) them. I've done this with wx and Tkinter in the past. I use GTK and VPython together. GTK has a quirk, though. On Windows, you need to tell GTK about it if you're using multithreading. Yeah, the naive approach runs fine (for the limited tests I've done, there's probably a way to break it) on Linux. Point is, VPython runs in a background thread under the hood, so you need this element if you're on Windows. Here's some demo code: ---------------------------------------------------------- import pygtk pygtk.require('2.0') import gtk from visual import display, frame, convex, color class GtkApp(gtk.Window): def buildVisual(self): scene0 = display(title='Visual Python') f = frame() half1 = convex(frame=f, pos=[ [-0.5,-0.5,-0.5], [0.5,0.5,0.5],[0.0,-0.5,0.5], [0.0,0.5,-0.5], [0.5,-0.5,0.5], [0.5,-0.5,-0.5], [0.5,0.5,-0.5] ], color=color.cyan) half0 = convex(frame=f, pos=[ [-0.5,-0.5,-0.5], [0.5,0.5,0.5], [0.0,-0.5,0.5], [0.0,0.5,-0.5], [-0.5,0.5,-0.5],[-0.5,0.5,0.5],[-0.5,-0.5,0.5] ], color=(0.0,.5,1.0)) def onPress(self, w): print 'close the Visual Python window to exit' def buildGUI(self): box = gtk.VBox(False, 0) btn = gtk.Button('press me') btn.connect('clicked', self.onPress) btn.set_border_width(5) box.pack_start(btn, False, False, 0) btn.show() self.add(box) box.show() def __init__(self): gtk.Window.__init__(self) self.set_title('GIMP Toolkit') self.buildGUI() self.buildVisual() if __name__ == '__main__': gtk.gdk.threads_init() myapp = GtkApp() myapp.show() gtk.gdk.threads_enter() gtk.main() gtk.gdk.threads_leave() ---------------------------------------------------------- Here's the relevant bit in the pygtk faq: http://faq.pygtk.org/index.py?req=show&file=faq20.006.htp I believe VPython will run your callbacks/handlers in the main thread, but check this before you try to call pygtk from the wrong thread.. ack! Cheers! On Tuesday 20 July 2010, Stefano Mtangoo wrote: > Hello friends, > I have been for long out of Vpython for long now, but I have plans to > develop Scientific simulation > Program for Physics students. As we know, Visual Did not support > integration with wxPython or any toolkit. > Is that possible now? If no what are plans to implement that feature? > Thanks > > --------------------------------------------------------------------------- > --- This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |
From: Stefano M. <mwi...@gm...> - 2010-07-20 05:48:07
|
Hello friends, I have been for long out of Vpython for long now, but I have plans to develop Scientific simulation Program for Physics students. As we know, Visual Did not support integration with wxPython or any toolkit. Is that possible now? If no what are plans to implement that feature? Thanks |
From: Bruce S. <bas...@nc...> - 2010-07-20 05:07:41
|
The missing links all seem to be Python symbols such as _PyExc_RuntimeError and _PyInt_AsLong, which are part of the Python API for connecting to C. I don't have any experience with the darwin environment, but maybe someone on this list will recognize what the problem is. It probably is irrelevant, but why are you using 5.2 rather than an up-to-date version of Visual, which is now at 5.32? Also, what problem are you trying to address by trying to build Visual in the darwin environment rather than using the fink package or the native Mac package? Bruce Sherwood On Mon, Jul 19, 2010 at 7:31 PM, K. Uebayashi <u.k...@gm...> wrote: > After adding some patchs, error message has changed. > # I use visual-5.2_release.tar.bz2. > > This is my patch.(thanks Mirko) > ======= > $ diff visual-5.2_releaseORIG/src/Makefile.in > visual-5.2_release/src/Makefile.in > 46c46 > < OSX_CPPFLAGS = #-no-cpp-precomp -fno-common -Wno-long-double > --- >> OSX_CPPFLAGS = -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include # -no-cpp-precomp -fno-common -Wno-long-double > 202c202 > < $(GTHREAD_LIBS) /sw/lib/libboost_python-mt.a > -lboost_thread-mt -lboost_signals) > --- >> $(GTHREAD_LIBS) /opt/local/lib/libboost_python-mt.a -lboost_thread-mt -lboost_signals) > ======= > > These are my process, > 1. adding my patch > 2. ./configure --prefix=/opt/local > 3. make, > then I met new error. > > I attached config.log and build.log. > > > > 2010/7/12 Bruce Sherwood <bas...@nc...>: >> The error indicates that some library was not found in the linking stage. If >> you showed just a bit more of the tail end of build.log, there might be a >> specific indication of what library it is. >> Bruce Sherwood >> >> On Sat, Jul 10, 2010 at 7:02 PM, K. Uebayashi <u.k...@gm...> wrote: >>> >>> I only replied to Steve, personally. >>> So, I resend my message to this list. >>> >>> >>> >>> After executed >>> ./configure --prefix=/opt/local \ >>> CPPFLAGS="-I/opt/local/Library/Frameworks/Python.framework/\ >>> Versions/2.6/lib/python2.6/site-packages/numpy/core/include/" >>> , I met "new" error message, >>> $ make >>> .... >>> Compiling ./gtk2/rate.cpp ... >>> Linking cvisualmodule.so ... >>> make[1]: *** [cvisualmodule.so] Error 1 >>> make: *** [all-recursive] Error 1 >>> . >>> >>> "src/build.log" ends with >>> $tail -3 src/build.log >>> Configured with: /var/tmp/gcc/gcc-5659~1/src/configure >>> --disable-checking --enable-werror --prefix=/usr --mandir=/share/man >>> --enable-languages=c,objc,c++,obj-c++ >>> --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ >>> --with-slibdir=/usr/lib --build=i686-apple-darwin10 >>> --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 >>> --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 >>> Thread model: posix >>> gcc version 4.2.1 (Apple Inc. build 5659) >>> . >>> >>> Could I fix the above error "Error 1" ? >>> >>> -- >>> K. Uebayashi >>> >>> 2010/7/4 Steve Spicklemire <st...@sp...>: >>> > OK.. here's the trouble: >>> > >>> > In file included from >>> > ../../visual-5.2_release/include/python/arrayprim.hpp:9:0, >>> > from >>> > ../../visual-5.2_release/src/python/arrayprim.cpp:1: >>> > ../../visual-5.2_release/include/python/num_util.hpp:73:31: fatal error: >>> > numpy/arrayobject.h: No such file or directory >>> > compilation terminated. >>> > >>> > Did you build/install numpy? Do you have the sources someplace where >>> > visual >>> > can find the header files? >>> > >>> > -steve >>> > >>> > On Jul 3, 2010, at 7:54 PM, K. Uebayashi wrote: >>> > >>> >> <build.log> >>> > >>> > >>> >>> >>> >>> -- >>> K. Uebayashi >>> >>> >>> ------------------------------------------------------------------------------ >>> This SF.net email is sponsored by Sprint >>> What will you do first with EVO, the first 4G phone? >>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >>> _______________________________________________ >>> Visualpython-users mailing list >>> Vis...@li... >>> https://lists.sourceforge.net/lists/listinfo/visualpython-users >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> Visualpython-users mailing list >> Vis...@li... >> https://lists.sourceforge.net/lists/listinfo/visualpython-users >> >> > > > > -- > K. Uebayashi > |
From: K. U. <u.k...@gm...> - 2010-07-20 01:40:15
|
After adding some patchs, error message has changed. # I use visual-5.2_release.tar.bz2. This is my patch.(thanks Mirko) ======= $ diff visual-5.2_releaseORIG/src/Makefile.in visual-5.2_release/src/Makefile.in 46c46 < OSX_CPPFLAGS = #-no-cpp-precomp -fno-common -Wno-long-double --- > OSX_CPPFLAGS = -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include # -no-cpp-precomp -fno-common -Wno-long-double 202c202 < $(GTHREAD_LIBS) /sw/lib/libboost_python-mt.a -lboost_thread-mt -lboost_signals) --- > $(GTHREAD_LIBS) /opt/local/lib/libboost_python-mt.a -lboost_thread-mt -lboost_signals) ======= These are my process, 1. adding my patch 2. ./configure --prefix=/opt/local 3. make, then I met new error. I attached config.log and build.log. 2010/7/12 Bruce Sherwood <bas...@nc...>: > The error indicates that some library was not found in the linking stage. If > you showed just a bit more of the tail end of build.log, there might be a > specific indication of what library it is. > Bruce Sherwood > > On Sat, Jul 10, 2010 at 7:02 PM, K. Uebayashi <u.k...@gm...> wrote: >> >> I only replied to Steve, personally. >> So, I resend my message to this list. >> >> >> >> After executed >> ./configure --prefix=/opt/local \ >> CPPFLAGS="-I/opt/local/Library/Frameworks/Python.framework/\ >> Versions/2.6/lib/python2.6/site-packages/numpy/core/include/" >> , I met "new" error message, >> $ make >> .... >> Compiling ./gtk2/rate.cpp ... >> Linking cvisualmodule.so ... >> make[1]: *** [cvisualmodule.so] Error 1 >> make: *** [all-recursive] Error 1 >> . >> >> "src/build.log" ends with >> $tail -3 src/build.log >> Configured with: /var/tmp/gcc/gcc-5659~1/src/configure >> --disable-checking --enable-werror --prefix=/usr --mandir=/share/man >> --enable-languages=c,objc,c++,obj-c++ >> --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ >> --with-slibdir=/usr/lib --build=i686-apple-darwin10 >> --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 >> --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 >> Thread model: posix >> gcc version 4.2.1 (Apple Inc. build 5659) >> . >> >> Could I fix the above error "Error 1" ? >> >> -- >> K. Uebayashi >> >> 2010/7/4 Steve Spicklemire <st...@sp...>: >> > OK.. here's the trouble: >> > >> > In file included from >> > ../../visual-5.2_release/include/python/arrayprim.hpp:9:0, >> > from >> > ../../visual-5.2_release/src/python/arrayprim.cpp:1: >> > ../../visual-5.2_release/include/python/num_util.hpp:73:31: fatal error: >> > numpy/arrayobject.h: No such file or directory >> > compilation terminated. >> > >> > Did you build/install numpy? Do you have the sources someplace where >> > visual >> > can find the header files? >> > >> > -steve >> > >> > On Jul 3, 2010, at 7:54 PM, K. Uebayashi wrote: >> > >> >> <build.log> >> > >> > >> >> >> >> -- >> K. Uebayashi >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> Visualpython-users mailing list >> Vis...@li... >> https://lists.sourceforge.net/lists/listinfo/visualpython-users > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > -- K. Uebayashi |
From: Robert F. <rf...@rf...> - 2010-07-19 17:44:19
|
Brilliant! I should've figured that one out myself. Thanks, it will handle my needs for now. Also thanks to Symion for a different approach, which I have also learned a lot from. Rob On Sun, 18 Jul 2010 01:08:02 -0700 (PDT), Kadir Haldenbilen <kha...@ya...> wrote: > I am not sure if I have misunderstood your requirement with > oversimplification, > or if this helps: > > LABEL object itself should provide what you want. > > If you place the label at pos = scene.center, then mouse operations > (zoom, > rotate, etc.) will not affect the label position. It will stay at the > center of > the screen. > > You may not wish to have the label at the center, as you may prefer to > have > your prime object at the center. Then, you can use xoffset, yoffset > parameters > to shift the label on the screen which are in pixel coordinates, not in > space > coordinates. > > So, pos = scene.center and the use of xoffset and yoffset serves as > positioning > the label on the screen with absolute pixel coordinates. > > For example, you can try the following simple code: > > # ============== > from visual import * > > scene.center = (1,2,3) > > plane = pyramid(pos=(1,1,1), size=(2,1,3)) > > tlabel = label(pos=scene.center, xoffset=0, yoffset=-100, line=0, > text="TIME") > slabel = label(pos=scene.center, xoffset=100, yoffset=-100, line=0, > text="SPEED") > glabel = label(pos=scene.center, xoffset=-100, yoffset=-100, line=0, > text="GFORCE") > > t = 0 > while 1: > > plane.pos -= (plane.pos.x, plane.pos.y, t) > t += 0.001 > plane.rotate(axis=(0,0,1), angle=pi/64) > rate(25) > > > > Was this what you needed? > > Kadir > > > ________________________________ > From: Robert French <rf...@rf...> > To: C Anthony Risinger <an...@ex...> > Cc: "vis...@li..." > <vis...@li...> > Sent: Sun, July 18, 2010 2:09:21 AM > Subject: Re: [Visualpython-users] Keeping labels in one place > > Yes, C Anthony is correct. I want it to stay at an absolute pixel > coordinate > (2-D) in the window. Completely unaffected by any rotations or zooms. > The > existing objects all move with the frame. > > > I had thought about the constantly-reposition option but was hoping there > was > something easier. This seems like it would be a common desire. For > example, to > put a title or timestamp or something in the display window. > > I'll try those suggestions and see if I can get it to work > > BTW, my application is orbit visualization of spacecraft. I just want the > date > and time to stay in one place. > > Thanks. > > On Jul 17, 2010, at 11:20 AM, C Anthony Risinger <an...@ex...> wrote: > >> >> >> On Sat, Jul 17, 2010 at 1:07 PM, Bruce Sherwood <bas...@nc...> >> wrote: >>> The current version of VPython (5.32) offers a text object as well as a >>> label object. The label object always faces the viewer, independent of >>> rotation, whereas the (new) text object is extruded text that behaves >>> like >>> all other objects. Seems like one of these two should do what you >>> want. The >>> text object can have zero thickness. >>> I'm not sure what you mean by a "time" display, but presumably you know >>> about the graphing option. >>> Bruce Sherwood >> >> i think what the OP is looking for is HUD functionality, ie. the >> "time" display stays locked to the viewport, regardless of zoom or >> rotation. >> >> AFIAK this is not currently supported in vpython. however, the same >> effect can be achieved by using a "HUD frame" and constantly >> recomputing it's position/zoom/rotation as the main frame moves. the >> other option is to put your app into a "container" frame, and ensure >> the main frame never moves... anything added to the main frame is a >> part of the HUD; i think the issue with this was mouse grabs are sent >> to the main frame (IIRC). sorry, i don't have any code examples on >> hand :-( >> >> C Anthony >> >> > ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first-- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> Visualpython-users mailing list >> Vis...@li... >> https://lists.sourceforge.net/lists/listinfo/visualpython-users >> >> >> -- >> Limited filtering has been provided due to external email forwarding. >> For details please review: >> http://www.onlymyemail.com/faqs/forwarding.html >> > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > > > > > > -- > Limited filtering has been provided due to external email forwarding. > For details please review: http://www.onlymyemail.com/faqs/forwarding.html |
From: Roberto S. <rsa...@bo...> - 2010-07-18 14:31:56
|
You could also update the text in the titlebar with scene.title. Rob |
From: Kadir H. <kha...@ya...> - 2010-07-18 08:08:10
|
I am not sure if I have misunderstood your requirement with oversimplification, or if this helps: LABEL object itself should provide what you want. If you place the label at pos = scene.center, then mouse operations (zoom, rotate, etc.) will not affect the label position. It will stay at the center of the screen. You may not wish to have the label at the center, as you may prefer to have your prime object at the center. Then, you can use xoffset, yoffset parameters to shift the label on the screen which are in pixel coordinates, not in space coordinates. So, pos = scene.center and the use of xoffset and yoffset serves as positioning the label on the screen with absolute pixel coordinates. For example, you can try the following simple code: # ============== from visual import * scene.center = (1,2,3) plane = pyramid(pos=(1,1,1), size=(2,1,3)) tlabel = label(pos=scene.center, xoffset=0, yoffset=-100, line=0, text="TIME") slabel = label(pos=scene.center, xoffset=100, yoffset=-100, line=0, text="SPEED") glabel = label(pos=scene.center, xoffset=-100, yoffset=-100, line=0, text="GFORCE") t = 0 while 1: plane.pos -= (plane.pos.x, plane.pos.y, t) t += 0.001 plane.rotate(axis=(0,0,1), angle=pi/64) rate(25) Was this what you needed? Kadir ________________________________ From: Robert French <rf...@rf...> To: C Anthony Risinger <an...@ex...> Cc: "vis...@li..." <vis...@li...> Sent: Sun, July 18, 2010 2:09:21 AM Subject: Re: [Visualpython-users] Keeping labels in one place Yes, C Anthony is correct. I want it to stay at an absolute pixel coordinate (2-D) in the window. Completely unaffected by any rotations or zooms. The existing objects all move with the frame. I had thought about the constantly-reposition option but was hoping there was something easier. This seems like it would be a common desire. For example, to put a title or timestamp or something in the display window. I'll try those suggestions and see if I can get it to work BTW, my application is orbit visualization of spacecraft. I just want the date and time to stay in one place. Thanks. On Jul 17, 2010, at 11:20 AM, C Anthony Risinger <an...@ex...> wrote: > > > On Sat, Jul 17, 2010 at 1:07 PM, Bruce Sherwood <bas...@nc...> wrote: >> The current version of VPython (5.32) offers a text object as well as a >> label object. The label object always faces the viewer, independent of >> rotation, whereas the (new) text object is extruded text that behaves like >> all other objects. Seems like one of these two should do what you want. The >> text object can have zero thickness. >> I'm not sure what you mean by a "time" display, but presumably you know >> about the graphing option. >> Bruce Sherwood > > i think what the OP is looking for is HUD functionality, ie. the > "time" display stays locked to the viewport, regardless of zoom or > rotation. > > AFIAK this is not currently supported in vpython. however, the same > effect can be achieved by using a "HUD frame" and constantly > recomputing it's position/zoom/rotation as the main frame moves. the > other option is to put your app into a "container" frame, and ensure > the main frame never moves... anything added to the main frame is a > part of the HUD; i think the issue with this was mouse grabs are sent > to the main frame (IIRC). sorry, i don't have any code examples on > hand :-( > > C Anthony > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first-- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > > -- > Limited filtering has been provided due to external email forwarding. > For details please review: http://www.onlymyemail.com/faqs/forwarding.html > ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Visualpython-users mailing list Vis...@li... https://lists.sourceforge.net/lists/listinfo/visualpython-users |
From: Symion <kn...@ip...> - 2010-07-18 05:17:24
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> On 18/07/2010 8:39 AM, Robert French wrote: <blockquote cite="mid:4E3...@rf..." type="cite"> <pre wrap="">Yes, C Anthony is correct. I want it to stay at an absolute pixel coordinate (2-D) in the window. Completely unaffected by any rotations or zooms. The existing objects all move with the frame. I had thought about the constantly-reposition option but was hoping there was something easier. This seems like it would be a common desire. For example, to put a title or timestamp or something in the display window. I'll try those suggestions and see if I can get it to work BTW, my application is orbit visualization of spacecraft. I just want the date and time to stay in one place. Thanks. On Jul 17, 2010, at 11:20 AM, C Anthony Risinger <a class="moz-txt-link-rfc2396E" href="mailto:an...@ex..."><an...@ex...></a> wrote: </pre> <blockquote type="cite"> <pre wrap=""> On Sat, Jul 17, 2010 at 1:07 PM, Bruce Sherwood <a class="moz-txt-link-rfc2396E" href="mailto:bas...@nc..."><bas...@nc...></a> wrote: </pre> <blockquote type="cite"> <pre wrap="">The current version of VPython (5.32) offers a text object as well as a label object. The label object always faces the viewer, independent of rotation, whereas the (new) text object is extruded text that behaves like all other objects. Seems like one of these two should do what you want. The text object can have zero thickness. I'm not sure what you mean by a "time" display, but presumably you know about the graphing option. Bruce Sherwood </pre> </blockquote> <pre wrap=""> i think what the OP is looking for is HUD functionality, ie. the "time" display stays locked to the viewport, regardless of zoom or rotation. AFIAK this is not currently supported in vpython. however, the same effect can be achieved by using a "HUD frame" and constantly recomputing it's position/zoom/rotation as the main frame moves. the other option is to put your app into a "container" frame, and ensure the main frame never moves... anything added to the main frame is a part of the HUD; i think the issue with this was mouse grabs are sent to the main frame (IIRC). sorry, i don't have any code examples on hand :-( C Anthony ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- <a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/sprint-com-first">http://p.sf.net/sfu/sprint-com-first</a> _______________________________________________ Visualpython-users mailing list <a class="moz-txt-link-abbreviated" href="mailto:Vis...@li...">Vis...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/visualpython-users">https://lists.sourceforge.net/lists/listinfo/visualpython-users</a> -- Limited filtering has been provided due to external email forwarding. For details please review: <a class="moz-txt-link-freetext" href="http://www.onlymyemail.com/faqs/forwarding.html">http://www.onlymyemail.com/faqs/forwarding.html</a> </pre> </blockquote> <pre wrap=""> ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- <a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/sprint-com-first">http://p.sf.net/sfu/sprint-com-first</a> _______________________________________________ Visualpython-users mailing list <a class="moz-txt-link-abbreviated" href="mailto:Vis...@li...">Vis...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/visualpython-users">https://lists.sourceforge.net/lists/listinfo/visualpython-users</a> </pre> </blockquote> Hi there,<br> Is this what you are looking for?<br> <br> ***********************<br> from visual import *<br> <br> move = {'up': (0,1,0), 'down': (0,-1,0),<br> 'left': (-1,0,0), 'right': (1,0,0)}<br> # Preset pos<br> loc = (0.0, 180.0, 0.0)<br> cli = label(pos=scene.center,<br> color=color.yellow,<br> opacity=0, box=0, line=0)<br> scene.show_rendertime=True<br> scene.visible = True<br> <br> scene.autoscale = False<br> scene.range = 10<br> box(color=color.red)<br> while 1:<br> cli.pos = scene.center # Maintain object pos<br> cli.xoffset = loc[0] # Constantly monitor<br> cli.yoffset = loc[1] # scene.size<br> cli.text = 'Time=%s' %(time.ctime())<br> if scene.mouse.events>0:<br> mk = scene.mouse.getevent()<br> if mk.release:<br> scene.center = scene.mouse.pos<br> elif scene.kb.keys>0:<br> km = scene.kb.getkey()<br> if move.has_key(km):<br> new = move.get(km)<br> loc = (new[0]+loc[0],new[1]+loc[1],0)<br> print 'Position = (%0.2f,%0.2f,%0.2f)' %(loc[0],loc[1],loc[2])<br> <br> ****************<br> <br> Use cursor keys to reposition time/date message.<br> I'm sure there is a better way of calculating the position but I<br> think you get the idea.<br> Note that show_rendertime places a message that is Really fixed,<br> even when changing window size!<br> I would like to know how That is achieved.<br> <br> Symion<br> <br> </body> </html> |