Re: Two windows in GTKmm



Ok, a few more words (code) on this to clarify. It's untested.

class MyNewWindow : public Gtk::Window
{
  protected:
    virtual bool on_delete_event (GdkEventAny* event)
    { delete this; return false; }

  public:
    MyNewWindow (void) { this->show_all(); }
    virtual ~MyNewWindow (void) {}
};

...

void
YourClass::on_new_window (void)
{
  MyNewWindow* win = new MyNewWindow;
}

Cheers,
Simon

Adam Ch. wrote:
>   Hi.
> I'm newbie in GTKmm so I ask you. 
> How can I show secound window from the first window? 
> Maybe question is stupid, but I don't know answer.



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