1. New Thread re- Old Dos Programme ---- Works but has Black Screen "window" c:\Euphoria\BIN\exw.exe in background ??

Hello,

Selgor here

Don and Dan ....and anyone else viewing

Modifications made "it" work.

But, it has 2 windows

The c:\Euphoria\Bin\exw.exe a black window in the background

and Main window in the foreground.

I can see the kaleidoscope

But any ideas to get rid of Black window

NEW code as suggested is below

In anticipation

Thank you

Cheers Selgor

 
 
----------------------------------------------------- 
--------------------  Kaleidoscope  ALL ------------- 
--------------------    Version  2.09   ------------- 
----------------------------------------------------- 
include win32lib.ew 
without warning 
 
include graphics.e 
include  machine.e 
 
if graphics_mode(18) then end if 
 
 
constant Win = 
    create( Window, "Kal", 0, 100, 100, 640,520, 0 ) 
 
setPenColor(Win, Red ) 
 
atom     a,b,c,d,a1,b1,c1,d1,a2,b2,c2,d2,a3,b3,c3,d3, 
         x,y,x1,y1,xx,yy,xx1,yy1,xxx,yyy,xxx1,yyy1,xxxx,yyyy,xxxx1,yyyy1, 
         lt,tp,rt,bt,lt1,tp1,rt1,bt1,lt2,tp2,rt2,bt2,lt3,tp3,rt3,bt3, 
         kount,kcount,kcol 
                          
         kount=0  kcol=rand(16)  kcount=0 
 
         lt=0 tp=0 bt=300 rt=405 
         lt1=225 tp1=0 bt1=300 rt1=630 
         lt2=0 tp2=180 bt2=480 rt2=405 
         lt3=225 tp3=180 bt3=480 rt3=630 
 
         x=235 x1=205 y=80 y1=220 
	 xx=392 xx1=422 yy=80 yy1=220 
         xxx=235 xxx1=205 yyy=400 yyy1=260 
         xxxx=392 xxxx1=422 yyyy=400 yyyy1=260 
 
         a=1   b=1   c=2   d=1 
         a1=a  b1=b  c1=c  d1=d 
         a2=a  b2=b  c2=c  d2=d 
         a3=a  b3=b  c3=c  d3=d 
 
 
 
procedure val() 
     x-=a y-=b x1-=c y1-=d 
     xx+=a1 yy-=b1 xx1+=c1 yy1-=d1 
     xxx-=a2 yyy+=b2 xxx1-=c2 yyy1+=d2 
     xxxx+=a3 yyyy+=b3 xxxx1+=c3 yyyy1+=d3 
end procedure 
 
procedure xyopp() 
     if  x<lt or  x>rt then a=-a   end if 
     if  y<tp or  y>bt then b=-b   end if 
     if x1<lt or x1>rt then c=-c   end if 
     if y1<tp or y1>bt then d=-d   end if 
end procedure 
 
procedure xyopp2() 
     if  xx<lt1 or  xx>rt1 then a1=-a1   end if 
     if  yy<tp1 or  yy>bt1 then b1=-b1   end if 
     if xx1<lt1 or xx1>rt1 then c1=-c1   end if 
     if yy1<tp1 or yy1>bt1 then d1=-d1   end if 
end procedure 
 
procedure xyopp3() 
     if  xxx<lt2 or  xxx>rt2 then a2=-a2   end if 
     if  yyy<tp2 or  yyy>bt2 then b2=-b2   end if 
     if xxx1<lt2 or xxx1>rt2 then c2=-c2   end if 
     if yyy1<tp2 or yyy1>bt2 then d2=-d2   end if 
end procedure 
 
procedure xyopp4() 
     if  xxxx<lt3 or  xxxx>rt3 then a3=-a3   end if 
     if  yyyy<tp3 or  yyyy>bt3 then b3=-b3   end if 
     if xxxx1<lt3 or xxxx1>rt3 then c3=-c3   end if 
     if yyyy1<tp3 or yyyy1>bt3 then d3=-d3   end if 
end procedure 
 
procedure stall() 
     for i=1 to 1500000 do end for 
end procedure 
 
procedure draw_it(integer self, integer event, sequence params) 
 
 
     for i= 1 to 65 by .1 do 
         kount+=1 
         drawLine(Win,x+a,y+b,x1+c,y1+d) 
         drawLine(Win,xxx+a2,yyy+b2,xxx1+c2,yyy1+d2) 
         drawLine(Win,xx+a1,yy+b1,xx1+c1,yy1+d1) 
         drawLine(Win,xxxx+a3,yyyy+b3,xxxx1+c3,yyyy1+d3) 
         if get_key()=27 then abort(0) end if 
	           stall() val() xyopp() xyopp2() xyopp3() xyopp4() 
     end for 
     kcount+=1 
    -- clear_screen() 
 
end procedure 
 
setHandler(Win,w32HActivate, routine_id("draw_it")) 
 
 WinMain( Win, Normal ) 
new topic     » topic index » view message » categorize

2. Re: New Thread re- Old Dos Programme ---- Works but has Black Screen "window" c:\Euphoria\BIN\exw.exe in background ??

Hello Signor,

include win32lib.ew  
without warning  
  
include graphics.e  
include  machine.e  
  
--if graphics_mode(18) then end if  
  
  
constant Win =  
    create( Window, "Kal", 0, 100, 100, 640,520, 0 )  
  
setPenColor(Win, Red )  
  
atom     a,b,c,d,a1,b1,c1,d1,a2,b2,c2,d2,a3,b3,c3,d3,  
         x,y,x1,y1,xx,yy,xx1,yy1,xxx,yyy,xxx1,yyy1,xxxx,yyyy,xxxx1,yyyy1,  
         lt,tp,rt,bt,lt1,tp1,rt1,bt1,lt2,tp2,rt2,bt2,lt3,tp3,rt3,bt3,  
         kount,kcount,kcol  
                           
         kount=0  kcol=rand(16)  kcount=0  
  
         lt=0 tp=0 bt=300 rt=405  
         lt1=225 tp1=0 bt1=300 rt1=630  
         lt2=0 tp2=180 bt2=480 rt2=405  
         lt3=225 tp3=180 bt3=480 rt3=630  
  
         x=235 x1=205 y=80 y1=220  
         xx=392 xx1=422 yy=80 yy1=220  
         xxx=235 xxx1=205 yyy=400 yyy1=260  
         xxxx=392 xxxx1=422 yyyy=400 yyyy1=260  
  
         a=1   b=1   c=2   d=1  
         a1=a  b1=b  c1=c  d1=d  
         a2=a  b2=b  c2=c  d2=d  
         a3=a  b3=b  c3=c  d3=d  
  
  
  
procedure val()  
     x-=a y-=b x1-=c y1-=d  
     xx+=a1 yy-=b1 xx1+=c1 yy1-=d1  
     xxx-=a2 yyy+=b2 xxx1-=c2 yyy1+=d2  
     xxxx+=a3 yyyy+=b3 xxxx1+=c3 yyyy1+=d3  
end procedure  
  
procedure xyopp()  
     if  x<lt or  x>rt then a=-a   end if  
     if  y<tp or  y>bt then b=-b   end if  
     if x1<lt or x1>rt then c=-c   end if  
     if y1<tp or y1>bt then d=-d   end if  
end procedure  
  
procedure xyopp2()  
     if  xx<lt1 or  xx>rt1 then a1=-a1   end if  
     if  yy<tp1 or  yy>bt1 then b1=-b1   end if  
     if xx1<lt1 or xx1>rt1 then c1=-c1   end if  
     if yy1<tp1 or yy1>bt1 then d1=-d1   end if  
end procedure  
  
procedure xyopp3()  
     if  xxx<lt2 or  xxx>rt2 then a2=-a2   end if  
     if  yyy<tp2 or  yyy>bt2 then b2=-b2   end if  
     if xxx1<lt2 or xxx1>rt2 then c2=-c2   end if  
     if yyy1<tp2 or yyy1>bt2 then d2=-d2   end if  
end procedure  
  
procedure xyopp4()  
     if  xxxx<lt3 or  xxxx>rt3 then a3=-a3   end if  
     if  yyyy<tp3 or  yyyy>bt3 then b3=-b3   end if  
     if xxxx1<lt3 or xxxx1>rt3 then c3=-c3   end if  
     if yyyy1<tp3 or yyyy1>bt3 then d3=-d3   end if  
end procedure  
  
procedure stall()  
     for i=1 to 1500000 do end for  
end procedure  
  
procedure draw_it(integer self, integer event, sequence params)  
  
  
     for i= 1 to 65 by .1 do  
    doEvents(0)--this checks for keystrokes 
         kount+=1  
         drawLine(Win,x+a,y+b,x1+c,y1+d)  
         drawLine(Win,xxx+a2,yyy+b2,xxx1+c2,yyy1+d2)  
         drawLine(Win,xx+a1,yy+b1,xx1+c1,yy1+d1)  
         drawLine(Win,xxxx+a3,yyyy+b3,xxxx1+c3,yyyy1+d3)  
    --   if get_key()=27 then abort(0) end if  
               stall() val() xyopp() xyopp2() xyopp3() xyopp4()  
     end for  
     kcount+=1  
    -- clear_screen()  
  
end procedure  
  
setHandler(Win,w32HActivate, routine_id("draw_it"))  
 
procedure close(integer self,integer event,sequence params) 
   if params[1]=27 then--esc 
    closeWindow(Win) 
   end if 
end procedure 
setHandler(Win,w32HKeyDown,routine_id("close")) 
 
 WinMain( Win, Normal )  
 

I removed

 
if graphics_mode(18) then end if  

It's not needed in windows.

and removed

 
         if get_key()=27 then abort(0) end if  

and added

procedure close(integer self,integer event,sequence params) 
   if params[1]=27 then--esc 
    closeWindow(Win) 
   end if 
end procedure 
setHandler(Win,w32HKeyDown,routine_id("close")) 
 

Also notice the deEvents(0) in draw_it().

It checks for events like keystrokes,

Don cole

new topic     » goto parent     » topic index » view message » categorize

3. Re: New Thread re- Old Dos Programme ---- Works but has Black Screen "window" c:\Euphoria\BIN\exw.exe in background ??

Hello
Selgor here again

Thank you Don very much.

It works beaut on 1 round
but a problem ..

If I may ask 1 more favour

The programme has to clear the screen

otherwise it becomes a "mess"

In the "old" clear_screen() did the trick

What is the "new" way to clear the screen??

I tried clearWindow(Win)

and repaint etc

If you know how could you set me on the way ??

Again many thanks ....

Maybe I stick with the old ??

cheers

Selgor.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu