drop downs gtk_grab_add and focus



Hi,
I'm trying to create a calendar dropdown. I have the calendar popuping up and its possible to select a date and time and the dropdown window will disappear. In fact it appears to work just fine in linux with gtk+ 2.4.0 on a fc2 box with the default window manager. However, in windows it does not work the same. I'm sure it has something to do with how i'm grabbing the window focus and then restoring the focus when the user clicks but I'm not sure what the problem is. I know it is someting I'm doing wrong because the GtkComboBox works as does the GtkCombo. I've looked through the gtkcombo source and am having a hard time seeing where i'm off. Any help would be greatly appreciated. I've put my source
code here: http://severna.homeip.net/calendar.tar.gz

the logic of the showing and hiding the popup is as follows:

determine the position of the popup based on the button widget's position
move the popup into position
call gtk_grab_add on the popup window
show the popup window

when the button-pressed event is recieved
call gtk_grab_remove on the popup window
and hide the window

the problem i'm experiencing is that in windows once the user moves the mouse off the button it looses focus i.e. gtk_button_leave seems to be called. Then if the user moves the mouse back over the button it does not recieve a gtk_button_enter the popup closes however if the user tries to click on the button again the popup does not display. If the user moves the mouse off the button and back over it the button can be clicked and the popup will be displayed again. This isn't a problem on my linux machine but it is a problem on my windows machine.
any ideas?

thanks,
todd




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