[gtk-server] Re: busy loop on startup with fifo method

  • From: Peter van Eerten <administrator@xxxxxxxxxxxxxx>
  • To: gtk-server@xxxxxxxxxxxxx, Frantisek Dufka <dufkaf@xxxxxxxxx>
  • Date: Tue, 17 Apr 2007 15:23:26 +0200

Quoting Frantisek Dufka <dufkaf@xxxxxxxxx>:

Well, if I understood it correctly IPC method means executing
gtk-server executable for each gtk call. Not very good for more calls
on slower devices like Nokia N770, process forking and dynamic linking
on startup takes time. FIFO method means just writing to file
descriptor without executing anything (read and echo are internal shell
commands).

You understood well :-)


But your first suggestion is a good idea, I think. I am already working on 2.1.4 and will make the necessary changes according to your remarks.

Thanks. The pre-created fifo method seems a bit easier to me. Maybe
with forking to background it would be harder to kill gtk-server on
shell script exit. But maybe not. Well at least you need to find out
its PID.

Well, the first method also could involve a change in the syntax of the GTK-server, for example:

gtk-server fifo=/tmp/bla nocreate

If that's OK with you then it's easy indeed.

With the background forking, you do not need the PID, because the call "gtk_exit" will automatically also exit the GTK-server. Next to this call you can send a plain "gtk_server_exit" as well.


I'm currently examining gtk-server for simple shell scripting with GUI
on Nokia 770. So far I am not sure how useful/powerful it is. The
startup speed is excellent - 1 second or less until simple window is
shown. Also the calculator example with glade (bash-isms removed :-)
starts in ~1 second and works :-) Python with pygtk takes 3-4 seconds
for simple window (=almost unusable).

But with gtk-server I'm afraid I need to write lot of gtk code for
simple things. Would be nice to have some simple dialog calls builtin
in gtk-server like zenity has
http://www.linuxmanpages.com/man1/zenity.1.php

Gtk-server is better than zenity/dialog because it can be scripted and
runs continuously on background. Zenity just shows dialog and exits
which is not enough for something with main window. Some mix between
those two would be nice. Or is it easy to write shell wrappers/funcions
for same basic dialogs like zenity has?

Of course I know Zenity, but with this tool you can only write dialogs, and it has not the flexibility of GTK-server.

Adding some default dialogs would be contradictory to GTK-server logic, I would say, as it is only a 'gateway' for interpreted languages to the GTK API. But it should be rather easy to write some simple dialogs using the built-in dialogs from GTK, like the GtkAboutDialog, GtkMessageDialog, GtkColorSelectionDialog, GtkFileChooserDialog and so on.

Regards
Peter

Other related posts: