Re: text widget performance



On Fri, 17 May 2002 16:34:50 +0300 (EAT)
Paul Mugabi <paulm pop eahd or ug> wrote:

Hi,
Try doing a text->freeze() before doing the insert and then a text->thaw()
afterwards.

Not better! The socket task have the highest priority and the GUI freeze :-|

        ggrrrrrr !

        François   


Paul Mugabi
Computer Frontiers

On Thu, 16 May 2002, Francois Chenais wrote:

Hello,

    I'm build a GTK-- GUI for a log server.
    I uses Gtk::Text widget to print logs that come from the server.


    Basic solution
    ----------------------------------------------------------------------
    In my main program, I set a callback to read new datas received
    on my socket :

            gdk_input_add (sock, GDK_INPUT_READ, netInputCallback, data);

    and the netInputCallback does

            text->insert(dataRed)


    But I have a lake of performance when I receive many logs.


    (not) Improved solution
    ----------------------------------------------------------------------
    To improve the performances, I canged netInputCallback introducing
    a buffer and a timer.

    netInputCallback does

            _buffer+=datared

    I create a timer like this

            SigC::Slot0<gint> my_slot = bind(slot(this, flushText), 0);
            _connection = Gtk::Main::timeout.connect(my_slot, 500);

    where flushText does

            text->insert(_buffer)
            _buffer=""

    But it doesn't improve anything, the GUI is frozen while receiving datas :-|


    Is there any GTK's way to do this ?


            Thanks a lot

            François
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list







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