Re: How to update the interface?



I apologize for the screwed up docs link. I guess my email client had a small brain fart there. Here is the link text: http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/ch09.html

Bob

Bob Caryl wrote:

Hello Mert:

"In my interface, I have button that is used to process an image. Since the process takes some time, the button is either left pressed, does not pop back during process or nothing happens. Is there any way to finish updating the interface first then finishing the call to a function?"

With regard to your first question: put the following at the beginning of the callback slot connected to your Gtk::Button::signal_clicked().

////////////////////////////////////////////////////////////////////
// code that allows the UI to update
while(Gtk::Main::instance()->events_pending())
Gtk::Main::instance()->iteration();
///////////////////////////////////////////////////////////////////

This will allow the UI to finish the button animation before you proceed with whatever the callback slot does.

"Also I have a textview widget I use in my application to show the user what steps are taken during the process. During the process, it doesn’t update (or print the text buffer) the textview widget also. "

Insert the foregoing code into the processing function immediately following your update to your Gtk::TextBuffer widget.

"Lastly, I would like to use the textview widget pretty much like a terminal. For example, how can I do like: textview_object << “string” << an integer << an stl vector << endl; so that I can print my stl vector variables or integers etc. "

See the docs <Lastly,%20I%20would%20like%20to%20use%20the%20textview%20widget%20pretty%20much%20like%20a%20terminal.%20For%20example,%20how%20can%20I%20do%20like:+textview_object+%3C%3C+%3Fstring%3F+%3C%3C+an+integer+%3C%3C+an+stl+vector+%3C%3C+endl;+so+that+I+can+print+my+stl+vector+variables+or+integers+etc.> for information on how to use the Gtk::TextView widget.

Bob Caryl

MERT TUGCU wrote:

Hi everyone,



In my interface, I have button that is used to process an image. Since the process takes some time, the button is either left pressed, does not pop back during process or nothing happens. Is there any way to finish updating the interface first then finishing the call to a function? Also I have a textview widget I use in my application to show the user what steps are taken during the process. During the process, it doesn’t update (or print the text buffer) the textview widget also. Lastly, I would like to use the textview widget pretty much like a terminal. For example, how can I do like: textview_object << “string” << an integer << an stl vector << endl; so that I can print my stl vector variables or integers etc.

Thank you for your response in advance,


_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


_______________________________________________
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]