Re: Statusbar not showing proper message

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

 



On Fri, Feb 23, 2007 at 04:42:33AM -0500, ashok@xxxxxxxxxxxxx wrote:
> 
> void
> on_button1_clicked                     (GtkButton       *button,
>                                         gpointer         user_data)
> {
>   GtkWidget *stat;
>   guint cont;

 From here...

>   stat=lookup_widget(window1,"statusbar1");
> 
>   cont=gtk_statusbar_get_context_id(stat,"context");
>   gtk_statusbar_push(stat,cont,"statusbar one");
>   system("find /home/ashok -name abc -type f");
> 
>   cont=gtk_statusbar_get_context_id(stat,"context");
>   gtk_statusbar_push(stat,cont,"statusbar two");
>   system("find /home/ashok -name abc -type f");

 ...to here

The Gtk+ main loop has no chance to run.

> }
> 
> But when i run this program it shows only "statusbar two" string, means it
> shows only last entry.

Therefore the labels have no chance to be redrawn, and if
the program execution took any nonnegligible time you
probably noticed the GUI was completely non-responsive.

You can use for instance g_spawn_async...() + some
non-blocking form of communication (non-blocking waitpid,
GIOChannels), whatever suits you, but in any case you have
to run the command asynchronously and return control to the
Gtk+ main loop to get a responsive GUI.  This was discussed
many times here, search the archives.

Yeti


--
Whatever.
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux