On Tue, 27 Oct 2009 13:49:54 -0500
Steve Scott <
sjscott007 gmail com> wrote:
> I got a Gtk:Window (This is my main window). I also have a dialog
> box( which is still part of the main thread, and created by my main
> window). In the dialog I create a new thread and register with the
> new thread a callback(e.g. g_FileCopyDialog::progressBarUpdate). So
> it looks like this:
>
> Thread 1 - Main Gtk App (MainWindow, g_FileCopyDialog)
> Thread 2 - File COPY THREAD. This is a thread created in
> g_FileCopyDialog, (DirectFile::runCopyThread)
>
> Thread 1 registers the a callback to thread 1 via:
> file->copy_progress.connect( sigc::mem_fun(*this,
> &g_FileCopyDialog::progressBarUpdate) );
>
> Thread 1 creates the file copy thread via: Glib::Thread *const
> thread = Glib::Thread::create(sigc::
> mem_fun(*file, &DirectFile::runCopyThread), true );
>
> Thread 1 does NOT join thread 2 after its created
>
> Thread 2 will then "run" and call
> g_FileCopyDialog::progressBarUpdate every time 512 bytes are copied.
> This works like a charm.
>
> The problem is that even though the
> g_FileCopyDialog::progressBarUpdate is being called everytime like it
> should, the progress bar does not update unless I call
> m_pcopyprogressbar->set_fraction( .01) first with some fictionous
> value in THREAD 1.