[Pygui] Dynamically changing Column or Row contents.

Steve McClure smcclure at racemi.com
Mon Oct 18 23:04:56 CEST 2010


On Oct 18, 2010, at 4:50 PM, Steve McClure wrote:

> 
> On Oct 18, 2010, at 4:27 PM, Steve McClure wrote:
> 
>> Oops, sorry, I was wrong.  I was connecting to a different web service than I thought so the data was different.
> 
> I think I get it now.  I'm iterating over the contents and removing them, thus changing the contents midstream.

Not completely.  I still get an empty Column if I:

self.servers = Column([])

then run the code below.  There must be some property or method that causes the column/window to be resized according to its contents.  It looks like calling shrink_wrap() will resize that one Column but then the parent Row and its parent Window don't resize.  I must be doing something wrong because I doubt that manual geometry management is a goal of PyGUI.

Thanks,
Steve

> 
>> 
>> On Oct 18, 2010, at 3:32 PM, Steve McClure wrote:
>> 
>>> Does this work?  I tried this where self.servers is a Column of Buttons:
>>> 
>>>      # get rid the old servers
>>>      for server in self.servers.contents:
>>>          #print 'deleting server:',server
>>>          self.servers.remove(server)
>>> 
>>>      for server in servers:
>>>          #print 'adding server:',server
>>>          b = Button(title=server, action=(self.show_details,'server',server))
>>>          self.servers.add(b)
>>> 
>>> But the windows doesn't get updated.
>>> 
>>> I've done quite a bit of Motif and PyGTK programing but this is my first cut at PyGUI.  I'm on OS X Snow Leopard if that makes any difference.
>>> 
>>> Thanks for any pointers,
>>> Steve
>>> --
>>> Steve McClure
>>> smcclure at racemi.com
>>> 
>>> _______________________________________________
>>> Pygui mailing list
>>> Pygui at python.org
>>> http://mail.python.org/mailman/listinfo/pygui
>> 
>> --
>> Steve McClure
>> smcclure at racemi.com
>> 
> 
> --
> Steve McClure
> smcclure at racemi.com
> 

--
Steve McClure
smcclure at racemi.com



More information about the Pygui mailing list