I have done a little software Server Side for run some program or restart the pc but I have a little problem:
I make a litthe thred where each seconds write the text on label in GLADE Interface,
but after some minutes the interface stop the refreshing, the software is like freezed but its work if I click on close button the program end like normal work , work all but without show the animation like the Menus, the animation button (press and release)
and the label text and the entry is like freezed because if I put text inside the entry is appen nothing but the text is in memory and if I click in the save button the text will be saved .
That is differend from PC and PC that depend how memory have , biggher is the memory longer time work without problem.
I try this script with a simple glade ui
1) close button
2) label text
and that appen too then I dont understand how I can solve this problem because the program have to work for one week , the text mode work but the problem is the GTK where I show the status and the time .
I working on GTK 3 with TOBAC
Code: Select all
Dim Shared ControlTime as Integer
ControlTime = 1
Sub TimeControl(Funzione As Any Ptr)
Dim TmStart as Integer
Dim TmStop as Integer
Dim as zstring ptr ZTesto
Dim as String STesto
Dim as Integer SNumero
Dim As Double t = Timer
While( 1 )
If not ControlTime = 3 Then TmStart = TmStart - 1
If CTReset = 1 then
CTReset = 0
TmStart = TempoCic
End If
If TmStart < 0 Then
TmStart = TempoCic
End If
If ControlTime = 3 Then
TmStop = TmStart
TmStart = TempoCic
STesto = Str(TmStop)
ZTesto = StrPtr(STesto)
gtk_label_set_label (GTK_LABEL (STimer), *ZTesto)
End If
If ControlTime = 2 Then
STesto = Str(TmStart)
ZTesto = StrPtr(STesto)
gtk_label_set_label (GTK_LABEL (STimer), *ZTesto)
End If
Sleep 1000
If ControlTime = 1 Then Exit Sub
Wend
End Sub
SetCommand()
ConfigFile(0)
WriteLog(0)
Dim shared thread As Any Ptr
thread = ThreadCreate( @TimeControl, 0 )
I hope someone ca help me with a solution.