Re: GtkComboBox: How to be notified of selection



Lars Clausen wrote:
> On 02 Aug 2002, Lars Clausen wrote:
> 
>>I'm using a GtkComboBox in Dia for zoom selection.  I can't quite get it
>>to behave the way I'd like.  It ought to be that when the user selects an
>>item from the drop-down list (making the drop-down disappear), the zoom
>>amount should be updated.  However, I haven't found a signal that will
>>tell me that the user made his or her final selection.  "select-child"
>>and "selection-changed" from the GtkList is called while the mouse is
>>dragged over the items.  "unmap", "hide" and "unrealize" don't get
>>called.  I don't want the user to have to press Enter after selecting
>>from the menu, that's all.  What should I do?
> 
> 
> In the end, I dropped the ComboBox and changed to combined Entry and
Button
> with menu-popup.  Works just the way the ComboBox should have.
> 
> -Lars
> 

Hi Lars, this is a bit late, but I got around this by catching "hide" on 
the combo's popup window:

   popwin = GTK_COMBO (fred)->popwin;
   gtk_signal_connect (GTK_OBJECT (popwin), "hide",
                       GTK_SIGNAL_FUNC (selected),
                       (gpointer) xx);

works in gtlk1.2 anyway

John



========================================================== 
Fabric of Vision 
Dress and Drapery in Painting 

19 June - 8 September 2002 

For information and tickets: 
http://www.nationalgallery.org.uk/exhibitions/fabric/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]