RE: How to show new window?



	Ahh, ok, so the secret is to move the second window into a function
in the class
	of the first window. I think I have it mostly working now. Thanks!
	
	Is there another secret about how to share data between the two
windows? I suppose
	I could write class functions to pass data in and out, but is there
a better way? I'd
	like to have Window #2 be a configuration dialog, so it will need to
read/write the same
	configuration data that Window #1 is using. I could somehow pass a
pointer to a
	seperate configuration class, but I don't want to make this more
complicated than it
	needs to be.



There is a certain something to be said for seperating UI code from 'core'
application code, portability et cetera.

How about an arrangement like ...

class c_data_manager
{
  public:
    void process_some_stuff();
    int get_some_data();

  private:
    int m_n_some_data_to_share;
};

class c_window2
{
  public:
    c_window2(c_data_manager * p_data_manager) :
      m_p_data_manager(p_data_manager)
    {
    }

  private:
    c_data_manager * m_p_data_manager;
};

class c_window1
{
  public:
    c_window1() :
      m_p_data_manager(new c_data_manager()),
      m_p_window2(new c_window2())
    {
    }

  private:
    c_window2 * m_p_window2;
    c_data_manager * m_p_data_manager;
};



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]