mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 22:20:25 +02:00
gtk:
- remove obsoleted code - fix mem leak in TGtkWSCustomControl.CreateHandle git-svn-id: trunk@13494 -
This commit is contained in:
parent
e62b25127e
commit
6c90924c4c
@ -3741,11 +3741,8 @@ begin
|
||||
|
||||
WidgetInfo := GetWidgetInfo(Widget, True);
|
||||
WidgetInfo^.LCLObject := AnObject;
|
||||
//TODO: remove old compatebility
|
||||
gtk_object_set_data(Widget, 'Class', Pointer(AnObject));
|
||||
end;
|
||||
|
||||
//TODO: cleanup when WidgetInfo is fully implemented
|
||||
function GetLCLObject(const Widget: Pointer): TObject;
|
||||
var
|
||||
WidgetInfo: PWinWidgetInfo;
|
||||
@ -3757,10 +3754,6 @@ begin
|
||||
if WidgetInfo <> nil
|
||||
then Result := WidgetInfo^.LCLObject
|
||||
else Result := nil;
|
||||
|
||||
// Fallback;
|
||||
if Result = nil
|
||||
then Result := TObject(gtk_object_get_data(Widget, 'Class'));
|
||||
end;
|
||||
|
||||
{-------------------------------------------------------------------------------
|
||||
|
@ -4064,9 +4064,9 @@ var
|
||||
WinWidgetInfo: PWinWidgetInfo;
|
||||
begin
|
||||
Result := GTKAPIWidget_New;
|
||||
WinWidgetInfo:=GetWidgetInfo(Result,true);
|
||||
WinWidgetInfo^.CoreWidget:=PGTKAPIWidget(Result)^.Client;
|
||||
SetLCLObject(WinWidgetInfo^.CoreWidget,AWinControl);
|
||||
WinWidgetInfo := GetWidgetInfo(Result, True);
|
||||
WinWidgetInfo^.CoreWidget := PGTKAPIWidget(Result)^.Client;
|
||||
WinWidgetInfo^.LCLObject := AWinControl;
|
||||
|
||||
gtk_scrolled_window_set_policy(PGTKScrolledWindow(Result),
|
||||
GTK_POLICY_NEVER, GTK_POLICY_NEVER);
|
||||
|
@ -108,7 +108,7 @@ type
|
||||
protected
|
||||
class procedure SetCallbacks(const AWidget: PGtkWidget; const AWidgetInfo: PWidgetInfo); virtual;
|
||||
public
|
||||
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): HWND; override;
|
||||
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): HWND; override;
|
||||
end;
|
||||
|
||||
{ TGtkWSImageList }
|
||||
@ -909,7 +909,10 @@ begin
|
||||
Result := THandle(PtrUInt(Widget));
|
||||
if Result = 0 then Exit;
|
||||
|
||||
WidgetInfo := CreateWidgetInfo(Widget, AWinControl, AParams);
|
||||
WidgetInfo := GetWidgetInfo(Widget); // Widget info already created in CreateAPIWidget
|
||||
WidgetInfo^.Style := AParams.Style;
|
||||
WidgetInfo^.ExStyle := AParams.ExStyle;
|
||||
WidgetInfo^.WndProc := PtrUInt(AParams.WindowClass.lpfnWndProc);
|
||||
|
||||
// set allocation
|
||||
Allocation.X := AParams.X;
|
||||
|
Loading…
Reference in New Issue
Block a user