On Tue, Oct 30, 2001 at 04:47:47PM +0530, Arun wrote:

> Hi James,
> 
>     But i am thinking of a situation where i dont know what the next widget is
> (when connecting the signal).Consider extending GtkEntry/GnomeEntry. I want 
> to use it as any other widget. During packing of widgets we wont say what the 
> next widget is. Focus cycling will work with out that. 
> 
> Is there any way one widget find out which widget comes next when a focus change
> happens ?
> 
  Not James, but I've solved a similar problem -- if all the 
widgets of interest are children of a container, you can use 
the appropriate get_children to get a list of them.  Depending on
how much state information you're saving, finding the "next"
one may be as easy as retrieving list[index+1].
  
  In the more general case, you have to define for yourself
what "next" means.  Python makes it quite easy to build a
a hierarchy of stateful logical "wrapper" objects which 
contain the pyGTK objects.  These highest-level objects can
then have arbitrary logical relationships designed into them,
including customized predecessor/successor relationships which
are not constrained by the structure of the GTK widget tree.

  There's some overhead, of course, but it's probably small.

                                -- A.


_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to