[pygtk] General PyGtk design question

Paco Moreno packo at assamita.net
Wed Jun 25 20:13:33 WST 2008


Python is an Object Oriented Language, the correct access to a class
attribute is with class methods. Is a good practice.

The method "set_text" change the label attribute and do other tasks like
redraw the widget. That's the target of object orientation, you don't have
to know how to do the label change, you only have to run the method.

Regards,


2008/6/25 Walter Leibbrandt <walter en translate.org.za>:

> Good day,
>
> I would just like to ask a question about the design of PyGtk: What were
> the reasons for the C-like deisgn of PyGtk? For example having to use
> "label.set_text('bleh')" in stead of "label.text =3D 'bleh'" and "txt =3D
> label.get_text()" in stead of "txt =3D label.text".
>
> Not that I'm criticizing, I was just wondering since I've used Gtk# before
> PyGtk and its C# adaptation works quite well. I know Python language
> features are used to a certain extent (ie. iterating over a gtk.ListStore=
),
> but the question remains. It seems that Python properties are the only
> example I can think of now, and if PyGtk has been around since before Pyt=
hon
> 2.2, that could answer my question. Can anyone confirm this or are there
> other reasons?
>
> Thanks in advance,
>
> Walter
>
> _______________________________________________
> pygtk mailing list   pygtk en daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
>
>


-- =

|Paco Moreno
|web: http://www.assamita.net
|blog: http://blog.assamita.net
|correo: packo en assamita punto net
|jabber: packo en assamita.net
------------ pr=F3xima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20080625/5b4d4b57/at=
tachment.htm


More information about the pygtk mailing list