[Gambas-user] How to program a restart function?

Steven Lobbezoo steven at ...1652...
Fri Mar 14 17:15:21 CET 2008


Hi,

My 2 cents :

Just before closing your app, you do

SHELL"sleep 2;start command for your app &"

Steven

Le jeudi 13 mars 2008 à 22:49 -0700, jbskaggs a écrit :
> Thanks to both of you for that advice.  I think I may have asked the wrong
> question.
> 
> I got the restart to work (thanks) when I was still running i the console. 
> BUt when I compiled to .exe my skinning failed. Or rather when I made the
> program exe then the skinning only partially worked- the pictures in
> picturebox and the images (or pictures) in Menus did not update when the
> program restarts.  It updated all my sounds, and my drawingarea images but
> nothing else when in exe.
> 
> How do I make the program  update those files?  
> 
> Currently the way I am doing it is I have different theme dir's in my
> relative path.  The program will then delete the grphx and sound files and
> replace them with the new files from the theme directory. (same files names
> diff content)
> 
> here is the code to do so (Remember I am a novice)
> 
> PUBLIC SUB B2cute_Click()
>   'copy portrait gifs
>   textlabel1.Show
>   bcloseme.Hide
>   bexit.Hide
>   b2cute.hide
>   picturebox2.Hide
>   bfantasy.Hide
> 
>   
> KILL application.path & "/0.gif"  
> COPY application.path & "/themes/2cute/grfx/0.gif"  TO application.path &
> "/0.gif"
> WAIT 0.5
> 
> REPEAT
> WAIT 0.1
> fff=fff+1
> textlabel1.Text=application.path & "/themes/2cute/grfx/"& fff &".gif"
>  KILL application.path & "/" & fff & ".gif"
>  COPY application.path & "/themes/2cute/grfx/"& fff &".gif"  TO
> application.path & "/"& fff &".gif"
> UNTIL fff=44
> 
> 
> 'copy icons
> fff=0
> REPEAT
> WAIT 0.1
> fff=fff+1
> textlabel1.Text=application.path & "/themes/2cute/icons/"& fff &".png"
>  KILL application.path & "/"& fff &".png"
>  COPY application.path & "/themes/2cute/icons/"& fff &".png"  TO
> application.path & "/"& fff &".png"
> UNTIL fff=16
> 
> 'COPY music
> textlabel1.Text=application.path & "/themes/2cute/grfx/10.mp3"
>  KILL application.path & "/10.mp3"
>  COPY application.path & "/themes/2cute/music/10.mp3"  TO application.path &
> "/10.mp3"
> 
> ' sounds
> textlabel2.Show
> button1.Show
> textlabel1.Text="All finished with no errors."
> END
> 
> 
> 
> 
> And I thought they would load these new images but it did not reload them
> all.
> 
> So what do I need to do to get the controls to reload the files?
> 
> Thanks
> JB Skaggs
> 
> 
> jbskaggs wrote:
> > 
> > I have a program I wrote skinnable theme options for.  But I need to have
> > the program either restart or reload all the grphx files other wise my
> > grphx don't refresh.
> > 
> > What is the simplest way to do this besides having the user end the
> > program and manually restart?
> > 
> > JB Skaggs
> > 
> 





More information about the User mailing list