pygtk - Create/update labels by gtk.Container.add_with_properties and gtk.Container.child_set_property -


I use Python to create a gtk.window with about 50 gtk I am doing Label is placed , these labels are required to be updated every 10/15 minutes each time, I choose to pack them using a fixed container and, to reduce coding, I have a list of labels Grouped in (Each item in the list is labeled text, X and Y, font family, and foreground is a sublink color). OK, I can easily add a label using the following code:

  in fine (gtc.fixed) in category (48): lbl = gtk.Label (data [i] [0]) Lbl.modify_fg (gtk.STATE_NORMAL, gtk.gdk.color_parse (data [i] [1])) lbl.modify_font (pango.FontDescription (data [i] [2])) fix.put (LLL, Data [i] [3], data [i] [4] win.add (fix)  

But the problem occurs when I need to type the label, if I write : / I> In category I (48): lbl.set_text (data [i] [0])

Nothing happens because it is not clear what data [i] [ 0 ] On which label I thought I would use gtk.container.add_with_properties to place the labels in the container and gtk.contenter.child_set_property for my updates I can solve the problem, but I got stuck because I have not searched for my use and documentation by Google, it is very bad. If I write this code, then I have tried something: i for category (<48): fix.add_with_properties (gtk.Label (), 'text ), Data [i] [0], "x", straw (data [i] [3]), "y", straw (data)

  fine = gtk.fixed () [I] [3]))  

The result is "Error type: Container property does not support 'text'" ... then I can use the container or its I am manipulating the widgets of the child, then I feel confused?!? Can someone explain me about using gtk.Container.add_with_properties and gtk.Container.child_set_property ?!? Also, I wonder if it's possible to give each label a type of "id" using " gtk.container.add_with_properties , so that I can easily identify and update later, or There are other ways to do this, I do not know? Thanks.


Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -