Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TopWindow&PopUp, TrayIcon » how to communicate between windows?
Re: how to communicate between windows? [message #29615 is a reply to message #29604] Thu, 04 November 2010 04:29 Go to previous messageGo to previous message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
sorry i did not make it clear, since i thought it is simple.
here's my case, i have two TopWindows A & B. If user click a button in A, B shows something. If user click the other button in A, B shows something else. I need TopWindow::OpenMain(), then I donno whether it is multi-threaded. Anyway, my real case is more complicated and it IS multi-threaded and I want the code below is multi-thread compatible, too.
class B : public TopWindow
...

class A : public TopWindow
{
  B b;
  void shown() { b.OpenMain(); }
  Button ButA;
  Button ButB;
  void Button_A();
  void Button_B();
...

GUI_APP_MAIN
{
  A a;
  a.OpenMain();
  a.shown();
  Ctrl::EventLoop();
}

in Button_A() or _B(), A can tell B about which button is clicked, such as setting a flag. But how can B notice this? If i derive A & B from your EventHandler, how can I implement B's HandleEvent? This IS a threading problem. Maybe in a word, it is how to add my own procedure in TopWindow's main thread processing.
Thank you.
 
Read Message icon1.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Crash on ToolTip painting
Next Topic: TrayIcon Tool tips text lenght limited
Goto Forum:
  


Current Time: Fri Jul 18 03:42:41 CEST 2025

Total time taken to generate the page: 0.03577 seconds