Is there anyway to listen to a bool value? I have a login window that has a loggedIn boolean value, I need to watch that value in the main thread so when it changes to true it returns to the main thread and loads up the rest of the program, i used to have it trailing through the program, ie, if you logged in the login listener would then start the main program but due to threading problems i am trying to keep it returning the the main thread to control it all. If there is another way i havent thought of that doesnt use listeners let me know, I dont really want to have to use a loop which checks it all the time.
Black Knight 0 Light Poster
Recommended Answers
Jump to PostI think you need to look at the Observer class. I'm not entirely sure how to use it, but it sounds like thats what you need.
Jump to PostI don't think you would have to use loops to continously check to see if it's true. I think you could just use some simple if statements or something simple to check if it's true.
Paradox has a neat solution to it..Have a method that makes it true, and …
All 8 Replies
Phaelax 52 Practically a Posting Shark
paradox814 1 Posting Whiz
server_crash 64 Postaholic
Black Knight 0 Light Poster
paradox814 1 Posting Whiz
jwenting 1,905 duckman Team Colleague
Black Knight 0 Light Poster
Black Knight 0 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.