1{%mainunit gtk2wsprivate.pp} 2 3{ 4 ***************************************************************************** 5 This file is part of the Lazarus Component Library (LCL) 6 7 See the file COPYING.modifiedLGPL.txt, included in this distribution, 8 for details about the license. 9 ***************************************************************************** 10} 11 12 13{ TGtkPrivateList } 14 15class procedure TGtkPrivateList.SetCallbacks(const AGtkWidget: PGtkWidget; const AWidgetInfo: PWidgetInfo); 16begin 17end; 18 19procedure Gtk2WS_ListBoxChange({%H-}Selection: PGtkTreeSelection; WidgetInfo: PWidgetInfo); cdecl; 20var 21 Mess: TLMessage; 22begin 23 {$IFDEF EventTrace} 24 EventTrace('Gtk2WS_ListBoxChange', WidgetInfo^.LCLObject); 25 {$ENDIF} 26 FillChar(Mess{%H-}, SizeOf(Mess), 0); 27 Mess.msg := LM_SELCHANGE; 28 DeliverMessage(WidgetInfo^.LCLObject, Mess); 29end; 30 31{ TGtk2PrivateList } 32 33class procedure TGtk2PrivateList.SetCallbacks(const AGtkWidget: PGtkWidget; const AWidgetInfo: PWidgetInfo); 34var 35 Selection: PGtkTreeSelection; 36begin 37 TGtk2WSBaseScrollingWinControl.SetCallbacks(AGtkWidget, AWidgetInfo); 38 39 Selection := gtk_tree_view_get_selection(PGtkTreeView(AWidgetInfo^.CoreWidget)); 40 SignalConnect(PGtkWidget(Selection), 'changed', @Gtk2WS_ListBoxChange, AWidgetInfo); 41end; 42 43