Here is my problem: I am writing a simple childrens game (in Python),
and I would like them to be able to play it when I'm not around. The
problem is that they can really mess up icons, menus, and whatever
else can be randomly clicked on. I am using Redhat 8.0. If anyone
knows another (better) way of solving this problem, your comments are
welcome.
Thanks.
> Here is my problem: I am writing a simple childrens game (in Python),
> and I would like them to be able to play it when I'm not around. The
> problem is that they can really mess up icons, menus, and whatever
> else can be randomly clicked on. I am using Redhat 8.0. If anyone
> knows another (better) way of solving this problem, your comments are
> welcome.
>
You might want to try giving them an account which uses KDE for the desktop
in 'kiosk' mode. This is a restricted mode where users can make no changes
to the desktop, meant for kiosk-type computers in public areas. Even if
you develop the game using pygtk, this kind of account for kids might be
useful.
Cheers,
f.
Pygame (pygame.org) has a fullscreen mode, and IIRC it can be used
with WxPython. You can grab all control (except for ctrl-alt-backspace).
Just FYI.
yours,
Gerrit.
--
Asperger Syndroom - een persoonlijke benadering:
http://people.nl.linux.org/~gerrit/
Het zijn tijden om je zelf met politiek te bemoeien:
http://www.sp.nl/
Hey, thanks for the link. I'll definately check it out. I'm
relatively new to Python programming, and somewhat new to Linux (1.5
years). The last time I tried installing wxPython on Linux, I was
unsuccessful. But, it's been a while, and I've learned a lot since
then so I may give it a whirl.
> Does anyone know how to make a window "full-screen" with PyGTK-2? By
> full-screen, I mean no decoration and no task bar or panel visible,
> and preferably the ability to disable the alt-tab functionality. This
> would be the eqivalent of the "full-screen-exclusive-mode" in Java SDK
> 1.4.
I think this might do it:
window1.set_decorated(gtk.FALSE)
window1.fullscreen()
You'll need to do a bit more to disable alt-tab.
See the API docs for more info:
http://developer.gnome.org/doc/API/2.0/gtk/GtkWindow.html
Dave Cook
This will be perfect, if it works! I will try it tonight and let you
know how it goes. Thanks a lot for the link to some possible
documentation.
Question: How in the world did you interpret those two method calls
from the documentation? In the documentation the method names are
different and they both require that the GtkWindow be passed as the
first argument. However, what you have written in Python are
different method names and the exclusion of the GtkWindow argument.
How did you come up with this?
Better docs specifically for the Python API are being worked on.
Until then here are some rules for translating from C to Python:
Namespaces:
o gtk_ -> gtk.
o gnome_ -> gnome. or gnome.ui. (depending on header file)
o g_ -> gobject.
o gdk_ -> gtk.gdk.
Class names are in "StudlyCaps" (same as the C typenames without the "Gtk"
part):
o gtk_class_name_new() -> gtk.ClassName() e.g. gtk.TreeView()
o gtk_class_name_new_with_foo(myfoo) -> gtk.ClassName(myfoo)
e.g. gtk.TreeView(model)
Method names are generally the same as C method names.
gtk_class_name_method_name(instance, params)
-> instance.method_name(params)
e.g. gtk_tree_view_get_column(treeview, 4) -> treeview.get_column(4)
In general, in/out parameters become return values. Usually in cases where a
"failure" would be returned, None is returned.
gtk_class_name_method_name(instance, a, b, &c, &d)
-> c, d = instance.method_name(a, b)
e.g.
gtk_tree_view_get_path_at_pos(treeview, x, y, &path, &column, &cell_x,
&cell_y)
-> path, column, cell_x, cell_y = treeview.get_path_at_pos(x, y)
Constants, e.g.:
GTK_WINDOW_TOPLEVEL -> gtk.WINDOW_TOPLEVEL
GDK_KEY_PRESS -> gtk.gdk.KEY_PRESS
FALSE, TRUE -> gtk.FALSE, gtk.TRUE
Others:
o instance.connect() instead of signal_connect()
o paths in TreeView/Models are just tuples.
o string lengths do not need to be specified
o The TreeViewColumn constructor can take named parameters for the
CellRenderer properties:
cell = gtk.CellRendererText()
column = gtk.TreeViewColumn(colname, cell, text=i, editable=j)
Dave Cook