|
|
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
|
|