hopefully fixed gtk2 combobox popup problem

git-svn-id: trunk@10957 -
This commit is contained in:
andrew 2007-04-17 02:25:43 +00:00
parent 7ebf64c627
commit 5471f34e69

View File

@ -761,6 +761,12 @@ begin
LCLSendDropDownMsg(TControl(WidgetInfo^.LCLObject));
end;
function GtkComboButtonPressCB(AWidget: PGtkWidget; Event: PGdkEventButton; ComboBox: PGtkComboBox): Boolean;
begin
Result := False;
gtk_combo_box_popup(ComboBox);
end;
procedure GtkChangedCB(AWidget: PGtkWidget; WidgetInfo: PWidgetInfo); cdecl;
begin
if WidgetInfo^.UserData <> nil then Exit;
@ -825,7 +831,8 @@ begin
if GtkWidgetIsA(PGtkWidget(AChild), GTK_TYPE_ENTRY) then begin
// Anything?
end;
g_signal_connect(AButton, 'button_press_event', TGCallback(@GtkComboButtonPressCB), AWidget);
g_signal_connect(APrivate^.popup_widget, 'show', TGCallback(@GtkPopupShowCB), AWidgetInfo);
g_object_set_data(G_OBJECT(AWidget), 'Menu', APrivate^.popup_widget);
end;