> Jon Nelson <[EMAIL PROTECTED]> writes:
>
> I want to attach a signal handler to a signal for a Window
> (I would also like to do this for other widgets, but I'll hold
> off for now on that)
>
> What I want is a smart widget -- when it gets "shown" I want it
> to populate some widgets in it with data. I would prefer to do this
> rather than use whatever causes the window to be shown to handle
> it.
>
> Assume I have a simple Window with a single button.
> When that button is clicked, the signal handler causes
> another window to be shown via show() (i use glade and
> it has the 'visible' flag set to off). When the window
> is shown, I want it to populate a list in it with data,
> everytime it is shown. And by 'shown' here I mean made
> visible. How do I do this?
>
> Can I do this for other widgets? Can I make them "smart" so that
> when they become visible they populate themselves?
> I also use notebooks, but don't want widgets in the notebooks
> to trigger every time I switch pages.
>
> Secondly, what are map, realize, show in terms that I can
> understand? I use show() and hide() all the time for stuff,
> but what are map and realize?
realize is called when the dialog is first created.
map is called each time show() is called.
I believe the widget.show() method generates a map-event which
generates a map signal. You can see that if you connect both 'map' and
'map-event' to the dialog.
I use the map signal, not map-event, for dialogs to populate
themselves then use this function instead of widget.show():
def showDialog(self, dialogName, title = None):
d = self.wtree.get_widget(dialogName)
if title:
d.set_title(title)
if d.flags(gtk.MAPPED) == 0:
d.show()
else:
d.get_window()._raise()
# call map again so dialogs will refresh their contents
return d.emit('map', d)
> --
> Jon Nelson \|/ ____ \|/ Gort,
> [EMAIL PROTECTED] "@'/ ,. \`@" Klaatu
> C and Python Programmer /_| \__/ |_\ barada
> Motorcycle Enthusiast \__U_/ nikto.
> _______________________________________________
> pygtk mailing list [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
--
Steve McClure 430 10th St NW
Racemi Suite N-210
http://www.racemi.com Atlanta, GA 30318
[EMAIL PROTECTED] voice/fax: 404-892-5850
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk