tags:

views:

27

answers:

1

I'm using pygtk then i used gtk.Combobox when i try to connect on chenged event its working but when i try to select an item that is already selected the changed method does not triggered since the selection does not changed..

so my question is how to connect the changed event even thought the selection does not changed tnx in advance

A: 

Well ... The changed event means just what it's called, that the selection has changed.

I suggest trying to listen to the popdown signal, which I believe is emitted when the menu closes.

If that doesn't work, perhaps notify::popup-shown can work. The ComboBox has a property called popup-shown, so listening to notifications when that property changes, and then checking if it's a transition from TRUE to FALSE, should help:

combo.connect("notify::popup-shown", popup_shown_callback)

In the callback, you can access the property value like this (assuming PyGTK 2.8 or later):

print "mycombo's popup-shown property is:", mycombo.props.popup_shown

I'm not 100% sure that the dash is mapped into an underscore; you will have to test this.

unwind
thanks for the fast reply i appreciated it I've already tried that one same problem, it does not enter the event when i tried to select same item
joven
when i tried popdown it does not work it does not enter the event/function
joven
what do you mean by that sir?
joven
thanks for the help :)
joven
how can i get the property if it is true or False ?? tnx
joven
@joven: Btw, feel free to vote this answer up if you feel it has been helpful.
unwind