Results 1 to 3 of 3

Thread: [RESOLVED] [2.0] Calling thread events

Threaded View

  1. #1

    Thread Starter
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051

    [RESOLVED] [2.0] Calling thread events

    I'm creating a card game. I've got a GUIControl Class and a GameControl Class.
    The easiest (i think) way for me to get the functionallity i want is to have a perminant thread running in the GameControl class that purely acts upon events raised by the GUIControl class, performs game logic, then fires various GUIControl events.

    For example.
    The user clicks a card, which fires an event in the GameControl Class. The GUIControl thread then goes back to it's automatic message pumping, waiting for any events.
    The GameControl acts upon the card clicked event, perhaps to remove the card from play. It fires an event in the GUIControl indicating that a card has been destroyed. Then it resumes waiting for events.
    The GUIControl acts upon the card destroyed event, but removing the card control from the GUI.
    Both the GUIControl (thread) and the GameControl wait to deal with another event.

    I've seen many, many examples of raising an event in the GUI from a worker thread (the thread in my GameControl), but i just can't work out how i fire an event (asynchronously) on a worker thread, from the main GUI thread.

    Any help would be greatly appreciated!
    Last edited by SLH; Nov 30th, 2006 at 07:30 PM.
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width