Statusbar works not correctly by 2nd attempt

Just starting out? Need help? Post your questions and find answers here.
Ausprobieren
New User
New User
Posts: 6
Joined: Thu May 29, 2014 1:42 pm

Statusbar works not correctly by 2nd attempt

Post 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
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Statusbar works not correctly by 2nd attempt

Post 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.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: Statusbar works not correctly by 2nd attempt

Post by Tenaja »

I have used it successfully; can you post some code that is troubling you?
Post Reply