Re: Adding text to a Gtk2::Label from another thread.



On Thu, Jan 01, 2004 at 03:44:57PM +0000, Toby A Inkster wrote:
| However, the GUI also has a Gtk2::Label control for displaying details
| about the current song (title, artist, album, etc) and I need a way of
| updating this control from the aforementioned while loop.

Thanks all for your replies. In the end I opted for this method...

Near the top:

        use Glib;
        
After creating $statusfield:

        Glib::Idle->add (sub {
                $statusfield->set_text($nowSong);
                return 1;
        });

The while loop just sets a value for $nowSong and then the status field
displays it whenever it gets the chance.

When I've finished I'll be sure to let you all know so that you can
tell me what I've done painfully wrong! ;-)

-- 
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

Attachment: pgpEKsBUbFUcD.pgp
Description: PGP signature



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