Page 1 of 1

Statusbar works not correctly by 2nd attempt

Posted: Sat Sep 13, 2014 11:45 am
by Ausprobieren
Hello together,

ich have the following problem:
I initialize a statusbar correctly in the main program and give a statsubar line by the progress of the threads via 'StatusBarProgress(#Statusleiste, Feld, Wert [, Aussehen [, Min, Max]])'.

In the first call, the statusbar works correctly, in the second by recall the same thread, it doesn't display the progress as in the case of the first call. It display nothing. The 'IsStatusBar(#Statusleiste)' ist correct and an attempt with display text in the statusbar runs correct in both cases.

Have any user an idea, what's the probleme here ...?

OS: Win 7, DirectX 9c, Purebasic 5.3

Greetings IH

Re: Statusbar works not correctly by 2nd attempt

Posted: Sat Sep 13, 2014 12:14 pm
by ts-soft
Have you any sourcecode? Only a example to show your problem.

Code: Select all

EnableExplicit

Procedure UpdateStatusBar(value)
  Protected time
  
  Repeat
    Delay(1000)
    time + 2
    If time = 100 : time = 0 : EndIf
    StatusBarProgress(0, 0, time)
  ForEver
EndProcedure

OpenWindow(0, #PB_Ignore, #PB_Ignore, 640, 480, "")
If CreateStatusBar(0, WindowID(0))
  AddStatusBarField(200)
EndIf

Define thread = CreateThread(@UpdateStatusBar(), 0)

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Works without problem.

Re: Statusbar works not correctly by 2nd attempt

Posted: Sat Sep 13, 2014 12:15 pm
by Tenaja
I have used it successfully; can you post some code that is troubling you?