Jeffrey Barish wrote:
> I still don't understand what to do if my widget is composed of other
> widgets (rather than Cairo drawing and text).

Normally, you just use boxes or something else to align those widgets.
Or subclass e.g. gtk.HBox.  However, if you feel adventurous, you can
play with this incomplete but working example:

import gobject
import gtk

class CustomContainer (gtk.Container):

    def __init__(self, child):
        gtk.Container.__init__(self)

        self.__child = child
        self.__child.set_parent (self)

        self.set_flags (gtk.NO_WINDOW)


    def do_size_request (self, requisition):
        requisition.width, requisition.height = self.__child.size_request ()

    def do_size_allocate (self, allocation):
        self.__child.size_allocate (allocation)


    def do_forall (self, include_internals, callback, user_data):
        callback (self.__child, user_data)


gobject.type_register (CustomContainer)


window = gtk.Window ()
window.add (CustomContainer (gtk.Label ('test')))

window.show_all ()
window.present ()

window.connect ('destroy', lambda window: gtk.main_quit ())

gtk.main ()
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to