RE: date/time in statusbar



Maybe you need to use a Glibmm timeout/callback? It goes something like ...

Glib::timeout_signal.connect(sigc::memfunc(*this, &MainPage::checkTime),
1000);

Look up the Glibmm docs on http://gtkmm.org for the full documentation.

Cheers,

Gaz


> -----Original Message-----
> From: Anca Mitrica [mailto:ancamitrica yahoo com] 
> Sent: 11 July 2005 13:59
> To: gtkmm-list gnome org
> Subject: date/time in statusbar
> 
> Hello,
> 
> I am working on an Gtkmm application that demands the
> current date/time in  the application statusbar. I am
> able to take the current time and put it in the
> statusbar, but when I'm trying to display the current
> time dynamically into the status bar, i get a
> segmentation fault.
> 
> I am "using g_timeout_add" function to call at each
> second the function that put time in the status bar.
> Here is the code :
> 
> gboolean MainPage::checkTime(void){
> 
> time_t timp;
> time(&timp);
> Glib::ustring strtime(ctime(&timp));
> // cout<<strtime<<endl;
> 
> status.statusBar->pop();
>   Gtk::Label *timeLabel = new Gtk::Label(strtime);
>   status.statusBar->pack_end(*timeLabel,
> Gtk::PACK_SHRINK);
> status.statusBar->push(strtime);
> 
> return true;
> 
> }
> 
> ..............................................
> g_timeout_add(1000,(GSourceFunc)checkTime(),NULL);
> 
> Can anyone tell me what is wrong with my code or give
> me an idea how to do this?
> 
> Thank you .
>     Anka 
> 
> 
> 		
> ____________________________________________________
> Sell on Yahoo! Auctions - no fees. Bid on great items.  
> http://auctions.yahoo.com/
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
> 



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