Hey!
Does SCAR have a function to redraw a form window (Like while a (runescape) script runs.).
Because windows freeze, when theyre not redrawn, and i'm searching for a ways to prevent that :' D.
~caused
Hey!
Does SCAR have a function to redraw a form window (Like while a (runescape) script runs.).
Because windows freeze, when theyre not redrawn, and i'm searching for a ways to prevent that :' D.
~caused
Re-draw a form window? You mean to overwrite it?
TForms have a property called repaint. That may be what you want.
They do ?. How does that Work ?.
I dont think a property would be the sollution though.
//Trying out the repaint property :3
Doesnt work.
I only would need something that would redraw/paint the window. The problem is:
Once a "larger" function is called the window freezes, and it doesnt seem to react on ".Repaint" anymore.
~caused
nope; what you want to do is change the way you're showing the form; right now you're probably using MyForm.ShowModal; well, just change that to MyForm.Show; and you'll be good!
(btw, you don't need to use the .repaint or .refresh methods when you use .show, just change .showmodal to .show and it will "multithread" [sort of] your SCAR script)
Originally Posted by IRC
With .show, the window freezes immediately, before anything has happened :O.
Heres an example Programm.
I want it to react While it "waits";
Code:program New; var frmDesign : TForm; Button1 : TButton; procedure buttonclick(sender: TObject); begin Writeln('Button pressed!'); wait(5000); // Window should still react and beeing repainted while it waits procedure InitForm; begin frmDesign := CreateForm; frmDesign.Left := 250; frmDesign.Top := 114; frmDesign.Width := 696; frmDesign.Height := 480; frmDesign.Caption := 'frmDesign'; frmDesign.Color := clBtnFace; frmDesign.Font.Color := clWindowText; frmDesign.Font.Height := -11; frmDesign.Font.Name := 'MS Sans Serif'; frmDesign.Font.Style := []; frmDesign.Visible := True; frmDesign.PixelsPerInch := 96; Button1 := TButton.Create(frmDesign); Button1.Parent := frmDesign; Button1.Left := 104; Button1.Top := 160; Button1.Width := 497; Button1.Height := 169; Button1.Caption := 'Do Lots of Stuff'; Button1.TabOrder := 8; Button1.OnClick:= @buttonclick; end; procedure SafeInitForm; var v: TVariantArray; begin setarraylength(V, 0); ThreadSafeCall('InitForm', v); end; procedure ShowFormModal; begin frmDesign.Show; end; procedure SafeShowFormModal; var v: TVariantArray; begin setarraylength(V, 0); ThreadSafeCall('ShowFormModal', v); end; begin SafeInitForm; SafeShowFormModal; repeat wait(100); until(false=true); end.
?.SCAR Code:repeat
wait(100);
until(false=true);
Thats going to result in false anyway. Moreover, you need to add an 'end' as you missed one.
doesnt matter =). I made it multithreading with some timer now, works brilliant :3
There are currently 1 users browsing this thread. (0 members and 1 guests)