1
// included by gtk2callback.inc
4
*****************************************************************************
6
* This file is part of the Lazarus Component Library (LCL) *
8
* See the file COPYING.modifiedLGPL.txt, included in this distribution, *
9
* for details about the copyright. *
11
* This program is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
15
*****************************************************************************
18
procedure DrawNotebookPageIcon(Page: TCustomPage; Widget: PGtkWidget);
20
NoteBook: TCustomNotebook;
21
NoteBookWidget: PGtkWidget;
22
PageWidget: PGtkWidget;
23
TabWidget: PGtkWidget;
26
NoteBook := Page.Parent as TCustomNotebook;
27
ImageIndex := NoteBook.GetImageIndex(Page.PageIndex);
28
if (NoteBook.Images = nil) or (ImageIndex < 0)
29
or (Page.ImageIndex >= NoteBook.Images.Count)
30
or (not NoteBook.HandleAllocated)
31
or (not Page.HandleAllocated)
33
NoteBookWidget := PGtkWidget(NoteBook.Handle);
34
PageWidget := PGtkWidget(Page.Handle);
36
// get the tab container and the tab icon widget
37
TabWidget := gtk_notebook_get_tab_label(PGtkNoteBook(NotebookWidget),
39
if TabWidget = nil then exit;
40
{$IFDEF VerboseGtkToDos}{$note reimplement}{$ENDIF}
41
DrawImageListIconOnWidget(NoteBook.Images, ImageIndex, Widget);
44
function PageIconWidgetExposeAfter(Widget: PGtkWidget; Event: PGDKEventExpose;
45
Data: gPointer): GBoolean; cdecl;
50
//DebugLn('PageIconWidgetExposeAfter ',DbgS(Widget));
51
EventTrace('PageIconWidgetExposeAfter', Data);
52
if (Event^.Count > 0) then exit;
53
ThePage := TObject(Data) as TCustomPage;
54
DrawNotebookPageIcon(ThePage, Widget);
58
// included by gtk2callback.inc