The CGUIMessage GetSenderId is a method in the C++ Common GUI (CGUI) library which retrieves the ID of the sender of a GUI message. This method can come in handy when handling messages within a GUI application.
Here are some code examples using CGUIMessage GetSenderId:
Example 1: Handling a button click event
void MyEventHandler(CGUIMessage& msg) { if (msg.GetType() == CGUIMessage::BUTTON_CLICKED) { int senderId = msg.GetSenderId(); // Do something with senderId... } }
In this example, when a button is clicked in the GUI, the MyEventHandler function is called with a CGUIMessage object containing the button click event. We can use the GetSenderId method to retrieve the ID of the button that was clicked.
Example 2: Implementing a custom message queue
class MyMessageQueue { public: void PushMessage(CGUIMessage msg) { m_queue.push_back(msg); }
In this example, we have implemented a simple message queue for GUI messages. The PushMessage method adds a message to the back of the queue, while the PopMessage method retrieves the next message from the front of the queue. We can use the CGUIMessage GetSenderId method to retrieve the ID of the sender of each message.
Package library: CGUI library.
C++ (Cpp) CGUIMessage::GetSenderId - 30 examples found. These are the top rated real world C++ (Cpp) examples of CGUIMessage::GetSenderId extracted from open source projects. You can rate examples to help us improve the quality of examples.