Re: gtk_widget_show - acts slowly



Simon Jerram wrote:
In part of a programme I have a call to a function
which calls
    gtk_widget_show(entry)

where entry is a pointer to an instance of GTK_ENTRY.

The actual entry box appears on the screen several
seconds after the fundction has returned, indeed
after several other components have been rendered.

    gtk_widget_show() will set the visible flag on the widget
and return, somewhere in gtk_main() there will eventually
be configure/expose events sent to the widget in question
and when they are handled, the widgets will show on screen.

If you are experiencing lengthly latencies and unresponsiveness
(you said a few seconds) this is probably because of some
lengthly excersize you are doing in your code, make sure
that your code segments are short and sweet and always
return to the event loop and then you shouldn't experience
these latencies.

If you need to do lengthly things and show hour-glasses and
progress bars, then you should either split up your operations
into short itterations and return to the event loop regularly
or optionally use worker threads.

Cheers,
                         -Tristan




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