Try to iterate Gtk::Main while has pending events...

On 05/16/2012 01:00 PM, [email protected] wrote:
Date: Tue, 15 May 2012 17:08:43 +0200
From: jody<[email protected]>
To: gtkmm-list<[email protected]>
Subject: Immediately updating status bar
Message-ID:
        <cakbzmgduf1jofuyszd734ud_jsomdymsywafgznj+chzrzf...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi

I have a window with some buttons and a status bar.
When i click one of the buttons this starts a lengthy operation.
I would like to have a  message like "loading data..." appear
on the status bar as soon as i press the button.

This is what i do:

void IQWin::on_button_load_data_clicked() {
     m_Status.push("loading data...");
    while (Gtk::Main::events_pending ())
    {
        Gtk::Main::iteration ();
    }
     m_IQScene.loadData(m_txtDataFile.get_text().c_str());
}

But that way the message on the status bar only appears when
the function has completed (after all the data has been loaded).

I guess by starting a thread which does the loading i could solve this problem,
but is there a more simple way to do this?

Thank You
   Jody

Luis Vaz

_______________________________________________
gtkmm-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Reply via email to