Gtk2: fixed setting imageindex in gtkcolumn in runtime, when there's no images in column during design time.issue #22811

git-svn-id: trunk@44698 -
This commit is contained in:
zeljko 2014-04-12 11:14:03 +00:00
parent cdf5900175
commit e0fa77db3d

View File

@ -1334,7 +1334,6 @@ var
begin begin
if not WSCheckHandleAllocated(ALV, 'ItemSetImage') if not WSCheckHandleAllocated(ALV, 'ItemSetImage')
then Exit; then Exit;
GetCommonTreeViewWidgets({%H-}PGtkWidget(ALV.Handle), Widgets); GetCommonTreeViewWidgets({%H-}PGtkWidget(ALV.Handle), Widgets);
with Widgets^ do with Widgets^ do
begin begin
@ -1349,7 +1348,6 @@ begin
else else
ItemRect.height := 1; // force redraw ItemRect.height := 1; // force redraw
gtk_tree_path_free(Path); gtk_tree_path_free(Path);
if ItemRect.height <> 0 then // item is visible if ItemRect.height <> 0 then // item is visible
begin begin
ImgList := TImageList.Create(nil); ImgList := TImageList.Create(nil);
@ -1407,6 +1405,8 @@ begin
end; end;
end; end;
Widgets^.Images.Items[AImageIndex] := pixbuf; Widgets^.Images.Items[AImageIndex] := pixbuf;
if GTK_IS_TREE_VIEW(MainView) then
gtk_tree_view_column_queue_resize(gtk_tree_view_get_column(PGtkTreeView(MainView), ASubIndex));
finally finally
BitImage.Free; BitImage.Free;
end; end;