POV-Ray : Newsgroups : povray.general : Re: POV-Ray & Databases Server Time
15 Nov 2024 07:12:19 EST (-0500)
  Re: POV-Ray & Databases (Message 1 to 1 of 1)  
From: Mark Ulrich
Subject: Re: POV-Ray & Databases
Date: 4 Nov 2004 20:20:01
Message: <web.418ad308e4dee74da3009e2a0@news.povray.org>
Here is a working example (2 files).

It needs wxBasic
http://wxbasic.sourceforge.net/bleed.php

Run it with
wxbasic povexec.wxb

(Linux: ./wxbasic povexec.wxb)

I just tested it on Linux, it should work on Windows as well.


------------------------
povexec.wxb
------------------------

#!/usr/bin/wxbasic

//-- start povray without blocking this one --
// on Windows98, try to replace "wxExecute" with "Shell",
// if wxExecute blocks this program


 wxExecute("povray povexec.pov")



 Dim frame = new wxframe( nothing, -1,"PoV-exec",
                      wxPoint(1,1),wxSize(-1,-1))

 dim vsizer = new wxBoxSizer( wxVERTICAL)

 dim button=new wxButton(frame, -1, "exit")
 connect(button,wxEVT_COMMAND_BUTTON_CLICKED,"onQuit")
 vsizer.AddWindow(button,1,wxEXPAND)



 timer = new wxTimer( frame )
 timer.Start( 250 )
 Connect( frame, -1, wxEVT_TIMER, "myProcess" )

 frame.SetSizer( vsizer  )
 frame.Show( 1 )


sub myProcess( event )

  if wxFileExists("povexec.txt") then

   handle = fOpen("povexec.txt" , "r" )
    buffer= fGets( handle )
   fclose( handle )

   timer.Stop()
   wxExecute(buffer)
   wxMessagebox("Your program should have started now... exiting...")
   end // quit program after Execution of Pov-Generated Command
  end if

end sub

Sub onQuit( event )
   end
End Sub

------------------------
povexec.pov
------------------------

#fopen MyFile "povexec.txt" write


// windows:
//#write(MyFile,"notepad.exe")

// linux:
#write(MyFile,"kedit")

#fclose MyFile


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.