1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "listbox.h"
15 #include "wx/dynarray.h"
16 #include "wx/listbox.h"
19 #include "wx/checklst.h"
20 #include "wx/settings.h"
23 #include "wx/tooltip.h"
26 #if wxUSE_DRAG_AND_DROP
33 //-----------------------------------------------------------------------------
35 //-----------------------------------------------------------------------------
37 extern void wxapp_install_idle_handler();
40 //-------------------------------------------------------------------------
41 // conditional compilation
42 //-------------------------------------------------------------------------
44 #if (GTK_MINOR_VERSION > 0)
45 #define NEW_GTK_SCROLL_CODE
48 //-----------------------------------------------------------------------------
50 //-----------------------------------------------------------------------------
52 #define CHECKBOX_STRING "[-] "
54 // checklistboxes have "[±] " prepended to their lables, this macro removes it
55 // (NB: 4 below is the length of CHECKBOX_STRING above)
57 // the argument to it is a "const char *" pointer
58 #define GET_REAL_LABEL(label) ((m_hasCheckBoxes)?(label)+4 : (label))
60 //-----------------------------------------------------------------------------
62 //-----------------------------------------------------------------------------
64 extern bool g_blockEventsOnDrag
;
65 extern bool g_blockEventsOnScroll
;
67 static bool g_hasDoubleClicked
= FALSE
;
69 //-----------------------------------------------------------------------------
70 // "button_release_event"
71 //-----------------------------------------------------------------------------
73 /* we would normally emit a wxEVT_COMMAND_LISTBOX_DOUBLECLICKED event once
74 a GDK_2BUTTON_PRESS occurs, but this has the particular problem of the
75 listbox keeping the focus until it receives a GDK_BUTTON_RELEASE event.
76 this can lead to race conditions so that we emit the dclick event
77 after the GDK_BUTTON_RELEASE event after the GDK_2BUTTON_PRESS event */
80 gtk_listbox_button_release_callback( GtkWidget
*widget
, GdkEventButton
*gdk_event
, wxListBox
*listbox
)
82 if (g_isIdle
) wxapp_install_idle_handler();
84 if (g_blockEventsOnDrag
) return FALSE
;
85 if (g_blockEventsOnScroll
) return FALSE
;
87 if (!listbox
->m_hasVMT
) return FALSE
;
89 if (!g_hasDoubleClicked
) return FALSE
;
91 wxCommandEvent
event( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
, listbox
->GetId() );
92 event
.SetEventObject( listbox
);
94 wxArrayInt aSelections
;
95 int count
= listbox
->GetSelections(aSelections
);
98 event
.m_commandInt
= aSelections
[0] ;
99 event
.m_clientData
= listbox
->GetClientData( event
.m_commandInt
);
100 wxString
str(listbox
->GetString(event
.m_commandInt
));
101 if (!str
.IsEmpty()) event
.m_commandString
= str
;
105 event
.m_commandInt
= -1 ;
106 event
.m_commandString
.Empty();
109 listbox
->GetEventHandler()->ProcessEvent( event
);
114 //-----------------------------------------------------------------------------
115 // "button_press_event"
116 //-----------------------------------------------------------------------------
119 gtk_listbox_button_press_callback( GtkWidget
*widget
, GdkEventButton
*gdk_event
, wxListBox
*listbox
)
121 if (g_isIdle
) wxapp_install_idle_handler();
123 if (g_blockEventsOnDrag
) return FALSE
;
124 if (g_blockEventsOnScroll
) return FALSE
;
126 if (!listbox
->m_hasVMT
) return FALSE
;
128 int sel
= listbox
->GetIndex( widget
);
130 if ((listbox
->m_hasCheckBoxes
) && (gdk_event
->x
< 15) && (gdk_event
->type
!= GDK_2BUTTON_PRESS
))
132 wxCheckListBox
*clb
= (wxCheckListBox
*)listbox
;
134 clb
->Check( sel
, !clb
->IsChecked(sel
) );
136 wxCommandEvent
event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
, listbox
->GetId() );
137 event
.SetEventObject( listbox
);
139 listbox
->GetEventHandler()->ProcessEvent( event
);
142 /* emit wxEVT_COMMAND_LISTBOX_DOUBLECLICKED later */
143 g_hasDoubleClicked
= (gdk_event
->type
== GDK_2BUTTON_PRESS
);
148 //-----------------------------------------------------------------------------
150 //-----------------------------------------------------------------------------
153 gtk_listbox_key_press_callback( GtkWidget
*widget
, GdkEventKey
*gdk_event
, wxListBox
*listbox
)
155 if (g_isIdle
) wxapp_install_idle_handler();
157 if (g_blockEventsOnDrag
) return FALSE
;
159 if (!listbox
->m_hasVMT
) return FALSE
;
161 if (gdk_event
->keyval
!= ' ') return FALSE
;
163 int sel
= listbox
->GetIndex( widget
);
165 wxCheckListBox
*clb
= (wxCheckListBox
*)listbox
;
167 clb
->Check( sel
, !clb
->IsChecked(sel
) );
169 wxCommandEvent
event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
, listbox
->GetId() );
170 event
.SetEventObject( listbox
);
172 listbox
->GetEventHandler()->ProcessEvent( event
);
177 //-----------------------------------------------------------------------------
178 // "select" and "deselect"
179 //-----------------------------------------------------------------------------
181 static void gtk_listitem_select_callback( GtkWidget
*WXUNUSED(widget
), wxListBox
*listbox
)
183 if (g_isIdle
) wxapp_install_idle_handler();
185 if (!listbox
->m_hasVMT
) return;
186 if (g_blockEventsOnDrag
) return;
188 wxCommandEvent
event(wxEVT_COMMAND_LISTBOX_SELECTED
, listbox
->GetId() );
190 wxArrayInt aSelections
;
191 int count
= listbox
->GetSelections(aSelections
);
194 event
.m_commandInt
= aSelections
[0] ;
195 event
.m_clientData
= listbox
->GetClientData( event
.m_commandInt
);
196 wxString
str(listbox
->GetString(event
.m_commandInt
));
197 if (!str
.IsEmpty()) event
.m_commandString
= str
;
201 event
.m_commandInt
= -1 ;
202 event
.m_commandString
.Empty();
205 event
.SetEventObject( listbox
);
207 listbox
->GetEventHandler()->ProcessEvent( event
);
210 //-----------------------------------------------------------------------------
212 //-----------------------------------------------------------------------------
214 IMPLEMENT_DYNAMIC_CLASS(wxListBox
,wxControl
)
216 wxListBox::wxListBox()
218 m_list
= (GtkList
*) NULL
;
219 m_hasCheckBoxes
= FALSE
;
222 bool wxListBox::Create( wxWindow
*parent
, wxWindowID id
,
223 const wxPoint
&pos
, const wxSize
&size
,
224 int n
, const wxString choices
[],
225 long style
, const wxValidator
& validator
, const wxString
&name
)
228 m_acceptsFocus
= TRUE
;
230 PreCreation( parent
, id
, pos
, size
, style
, name
);
232 SetValidator( validator
);
234 m_widget
= gtk_scrolled_window_new( (GtkAdjustment
*) NULL
, (GtkAdjustment
*) NULL
);
235 if (style
& wxLB_ALWAYS_SB
)
237 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(m_widget
),
238 GTK_POLICY_AUTOMATIC
, GTK_POLICY_ALWAYS
);
242 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(m_widget
),
243 GTK_POLICY_AUTOMATIC
, GTK_POLICY_AUTOMATIC
);
246 m_list
= GTK_LIST( gtk_list_new() );
248 GtkSelectionMode mode
= GTK_SELECTION_BROWSE
;
249 if (style
& wxLB_MULTIPLE
)
250 mode
= GTK_SELECTION_MULTIPLE
;
251 else if (style
& wxLB_EXTENDED
)
252 mode
= GTK_SELECTION_EXTENDED
;
254 gtk_list_set_selection_mode( GTK_LIST(m_list
), mode
);
256 #ifdef NEW_GTK_SCROLL_CODE
257 gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW(m_widget
), GTK_WIDGET(m_list
) );
259 gtk_container_add( GTK_CONTAINER(m_widget
), GTK_WIDGET(m_list
) );
262 gtk_widget_show( GTK_WIDGET(m_list
) );
264 wxSize newSize
= size
;
265 if (newSize
.x
== -1) newSize
.x
= 100;
266 if (newSize
.y
== -1) newSize
.y
= 110;
267 SetSize( newSize
.x
, newSize
.y
);
269 for (int i
= 0; i
< n
; i
++)
271 m_clientDataList
.Append( (wxObject
*) NULL
);
272 m_clientObjectList
.Append( (wxObject
*) NULL
);
274 GtkWidget
*list_item
;
276 wxString
str(choices
[i
]);
279 str
.Prepend(CHECKBOX_STRING
);
282 list_item
= gtk_list_item_new_with_label( str
.mbc_str() );
284 gtk_container_add( GTK_CONTAINER(m_list
), list_item
);
286 gtk_signal_connect( GTK_OBJECT(list_item
), "select",
287 GTK_SIGNAL_FUNC(gtk_listitem_select_callback
), (gpointer
)this );
289 if (style
& wxLB_MULTIPLE
)
290 gtk_signal_connect( GTK_OBJECT(list_item
), "deselect",
291 GTK_SIGNAL_FUNC(gtk_listitem_select_callback
), (gpointer
)this );
293 gtk_signal_connect( GTK_OBJECT(list_item
),
294 "button_press_event",
295 (GtkSignalFunc
)gtk_listbox_button_press_callback
,
298 gtk_signal_connect_after( GTK_OBJECT(list_item
),
299 "button_release_event",
300 (GtkSignalFunc
)gtk_listbox_button_release_callback
,
305 gtk_signal_connect( GTK_OBJECT(list_item
),
307 (GtkSignalFunc
)gtk_listbox_key_press_callback
,
311 ConnectWidget( list_item
);
313 gtk_widget_show( list_item
);
316 m_parent
->DoAddChild( this );
320 SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_WINDOW
) );
321 SetForegroundColour( parent
->GetForegroundColour() );
322 SetFont( parent
->GetFont() );
329 wxListBox::~wxListBox()
334 void wxListBox::InsertItems(int nItems
, const wxString items
[], int pos
)
336 wxCHECK_RET( m_list
!= NULL
, _T("invalid listbox") );
338 GList
*children
= m_list
->children
;
339 int length
= g_list_length(children
);
340 wxCHECK_RET( pos
<= length
, _T("invalid index in wxListBox::InsertItems") );
342 // VZ: it seems that GTK 1.0.6 doesn't has a function to insert an item
343 // into a listbox at the given position, this is why we first delete
344 // all items after this position, then append these items and then
345 // reappend back the old ones.
347 // first detach the old items
352 // no need to do anything complicated
353 for ( n
= 0; n
< nItems
; n
++ )
361 wxArrayString deletedLabels
;
362 wxArrayPtrVoid deletedData
;
363 wxArrayInt deletedChecks
; // only for check list boxes
365 GList
*child
= g_list_nth( children
, pos
);
366 for ( n
= 0; child
!= NULL
; n
++, child
= child
->next
)
369 GtkBin
*bin
= GTK_BIN( child
->data
);
370 GtkLabel
*label
= GTK_LABEL( bin
->child
);
372 wxString
str(GET_REAL_LABEL(label
->label
));
373 deletedLabels
.Add(str
);
376 void *clientData
= NULL
;
379 if ( n
< (int)m_clientObjectList
.GetCount() )
380 node
= m_clientObjectList
.Nth( n
);
384 clientData
= node
->GetData();
385 m_clientObjectList
.DeleteNode( node
);
390 if ( n
< (int)m_clientDataList
.GetCount() )
391 node
= m_clientDataList
.Nth( n
);
395 clientData
= node
->GetData();
396 node
= m_clientDataList
.Nth( n
);
400 deletedData
.Add(clientData
);
403 if ( m_hasCheckBoxes
)
405 deletedChecks
.Add(((wxCheckListBox
*)this)->IsChecked(pos
+ n
));
409 int nDeletedCount
= n
;
411 gtk_list_clear_items( m_list
, pos
, length
);
413 // now append the new items
414 for ( n
= 0; n
< nItems
; n
++ )
419 // and append the old items too
420 pos
+= nItems
; // now the indices are shifter
421 for ( n
= 0; n
< nDeletedCount
; n
++ )
423 Append(deletedLabels
[n
], deletedData
[n
]);
425 if ( m_hasCheckBoxes
)
427 ((wxCheckListBox
*)this)->Check(pos
+ n
, (bool)deletedChecks
[n
]);
432 void wxListBox::AppendCommon( const wxString
&item
)
434 wxCHECK_RET( m_list
!= NULL
, _T("invalid listbox") );
436 GtkWidget
*list_item
;
438 wxString
label(item
);
441 label
.Prepend(CHECKBOX_STRING
);
444 list_item
= gtk_list_item_new_with_label( label
.mbc_str() );
446 gtk_container_add( GTK_CONTAINER(m_list
), list_item
);
448 gtk_signal_connect( GTK_OBJECT(list_item
), "select",
449 GTK_SIGNAL_FUNC(gtk_listitem_select_callback
), (gpointer
)this );
451 if (HasFlag(wxLB_MULTIPLE
))
452 gtk_signal_connect( GTK_OBJECT(list_item
), "deselect",
453 GTK_SIGNAL_FUNC(gtk_listitem_select_callback
), (gpointer
)this );
455 gtk_signal_connect( GTK_OBJECT(list_item
),
456 "button_press_event",
457 (GtkSignalFunc
)gtk_listbox_button_press_callback
,
460 gtk_signal_connect_after( GTK_OBJECT(list_item
),
461 "button_release_event",
462 (GtkSignalFunc
)gtk_listbox_button_release_callback
,
467 gtk_signal_connect( GTK_OBJECT(list_item
),
469 (GtkSignalFunc
)gtk_listbox_key_press_callback
,
473 gtk_widget_show( list_item
);
475 ConnectWidget( list_item
);
477 if (GTK_WIDGET_REALIZED(m_widget
))
479 gtk_widget_realize( list_item
);
480 gtk_widget_realize( GTK_BIN(list_item
)->child
);
482 if (m_widgetStyle
) ApplyWidgetStyle();
484 #if wxUSE_DRAG_AND_DROP
485 #ifndef NEW_GTK_DND_CODE
486 if (m_dropTarget
) m_dropTarget
->RegisterWidget( list_item
);
491 if (m_tooltip
) m_tooltip
->Apply( this );
496 void wxListBox::Append( const wxString
&item
)
498 m_clientDataList
.Append( (wxObject
*) NULL
);
499 m_clientObjectList
.Append( (wxObject
*) NULL
);
501 AppendCommon( item
);
504 void wxListBox::Append( const wxString
&item
, void *clientData
)
506 m_clientDataList
.Append( (wxObject
*) clientData
);
507 m_clientObjectList
.Append( (wxObject
*) NULL
);
509 AppendCommon( item
);
512 void wxListBox::Append( const wxString
&item
, wxClientData
*clientData
)
514 m_clientObjectList
.Append( (wxObject
*) clientData
);
515 m_clientDataList
.Append( (wxObject
*) NULL
);
517 AppendCommon( item
);
520 void wxListBox::SetClientData( int n
, void* clientData
)
522 wxCHECK_RET( m_widget
!= NULL
, _T("invalid combobox") );
524 wxNode
*node
= m_clientDataList
.Nth( n
);
527 node
->SetData( (wxObject
*) clientData
);
530 void* wxListBox::GetClientData( int n
)
532 wxCHECK_MSG( m_widget
!= NULL
, NULL
, _T("invalid combobox") );
534 wxNode
*node
= m_clientDataList
.Nth( n
);
535 if (!node
) return NULL
;
540 void wxListBox::SetClientObject( int n
, wxClientData
* clientData
)
542 wxCHECK_RET( m_widget
!= NULL
, _T("invalid combobox") );
544 wxNode
*node
= m_clientObjectList
.Nth( n
);
547 wxClientData
*cd
= (wxClientData
*) node
->Data();
550 node
->SetData( (wxObject
*) clientData
);
553 wxClientData
* wxListBox::GetClientObject( int n
)
555 wxCHECK_MSG( m_widget
!= NULL
, (wxClientData
*)NULL
, _T("invalid combobox") );
557 wxNode
*node
= m_clientObjectList
.Nth( n
);
558 if (!node
) return (wxClientData
*) NULL
;
560 return (wxClientData
*) node
->Data();
563 void wxListBox::Clear()
565 wxCHECK_RET( m_list
!= NULL
, _T("invalid listbox") );
567 gtk_list_clear_items( m_list
, 0, Number() );
569 wxNode
*node
= m_clientObjectList
.First();
572 wxClientData
*cd
= (wxClientData
*)node
->Data();
576 m_clientObjectList
.Clear();
578 m_clientDataList
.Clear();
581 void wxListBox::Delete( int n
)
583 wxCHECK_RET( m_list
!= NULL
, _T("invalid listbox") );
585 GList
*child
= g_list_nth( m_list
->children
, n
);
587 wxCHECK_RET( child
, _T("wrong listbox index") );
589 GList
*list
= g_list_append( (GList
*) NULL
, child
->data
);
590 gtk_list_remove_items( m_list
, list
);
593 wxNode
*node
= m_clientObjectList
.Nth( n
);
596 wxClientData
*cd
= (wxClientData
*)node
->Data();
598 m_clientObjectList
.DeleteNode( node
);
601 node
= m_clientDataList
.Nth( n
);
604 m_clientDataList
.DeleteNode( node
);
608 void wxListBox::Deselect( int n
)
610 wxCHECK_RET( m_list
!= NULL
, _T("invalid listbox") );
612 gtk_list_unselect_item( m_list
, n
);
615 int wxListBox::FindString( const wxString
&item
) const
617 wxCHECK_MSG( m_list
!= NULL
, -1, _T("invalid listbox") );
619 GList
*child
= m_list
->children
;
623 GtkBin
*bin
= GTK_BIN( child
->data
);
624 GtkLabel
*label
= GTK_LABEL( bin
->child
);
626 wxString str
= GET_REAL_LABEL(label
->label
);
635 // it's not an error if the string is not found -> no wxCHECK
640 int wxListBox::GetSelection() const
642 wxCHECK_MSG( m_list
!= NULL
, -1, _T("invalid listbox") );
644 GList
*child
= m_list
->children
;
648 if (GTK_WIDGET(child
->data
)->state
== GTK_STATE_SELECTED
) return count
;
655 int wxListBox::GetSelections( wxArrayInt
& aSelections
) const
657 wxCHECK_MSG( m_list
!= NULL
, -1, _T("invalid listbox") );
659 // get the number of selected items first
660 GList
*child
= m_list
->children
;
662 for (child
= m_list
->children
; child
!= NULL
; child
= child
->next
)
664 if (GTK_WIDGET(child
->data
)->state
== GTK_STATE_SELECTED
)
673 aSelections
.Alloc(count
); // optimization attempt
675 for (child
= m_list
->children
; child
!= NULL
; child
= child
->next
, i
++)
677 if (GTK_WIDGET(child
->data
)->state
== GTK_STATE_SELECTED
)
685 wxString
wxListBox::GetString( int n
) const
687 wxCHECK_MSG( m_list
!= NULL
, _T(""), _T("invalid listbox") );
689 GList
*child
= g_list_nth( m_list
->children
, n
);
692 GtkBin
*bin
= GTK_BIN( child
->data
);
693 GtkLabel
*label
= GTK_LABEL( bin
->child
);
695 wxString str
= GET_REAL_LABEL(label
->label
);
700 wxFAIL_MSG(_T("wrong listbox index"));
705 wxString
wxListBox::GetStringSelection() const
707 wxCHECK_MSG( m_list
!= NULL
, _T(""), _T("invalid listbox") );
709 GList
*selection
= m_list
->selection
;
712 GtkBin
*bin
= GTK_BIN( selection
->data
);
713 GtkLabel
*label
= GTK_LABEL( bin
->child
);
715 wxString str
= GET_REAL_LABEL(label
->label
);
720 wxFAIL_MSG(_T("no listbox selection available"));
724 int wxListBox::Number()
726 wxCHECK_MSG( m_list
!= NULL
, -1, _T("invalid listbox") );
728 GList
*child
= m_list
->children
;
730 while (child
) { count
++; child
= child
->next
; }
734 bool wxListBox::Selected( int n
)
736 wxCHECK_MSG( m_list
!= NULL
, FALSE
, _T("invalid listbox") );
738 GList
*target
= g_list_nth( m_list
->children
, n
);
741 GList
*child
= m_list
->selection
;
744 if (child
->data
== target
->data
) return TRUE
;
748 wxFAIL_MSG(_T("wrong listbox index"));
752 void wxListBox::Set( int WXUNUSED(n
), const wxString
*WXUNUSED(choices
) )
754 wxFAIL_MSG(_T("wxListBox::Set not implemented"));
757 void wxListBox::SetFirstItem( int WXUNUSED(n
) )
759 wxFAIL_MSG(_T("wxListBox::SetFirstItem not implemented"));
762 void wxListBox::SetFirstItem( const wxString
&WXUNUSED(item
) )
764 wxFAIL_MSG(_T("wxListBox::SetFirstItem not implemented"));
767 void wxListBox::SetSelection( int n
, bool select
)
769 wxCHECK_RET( m_list
!= NULL
, _T("invalid listbox") );
772 gtk_list_select_item( m_list
, n
);
774 gtk_list_unselect_item( m_list
, n
);
777 void wxListBox::SetString( int n
, const wxString
&string
)
779 wxCHECK_RET( m_list
!= NULL
, _T("invalid listbox") );
781 GList
*child
= g_list_nth( m_list
->children
, n
);
784 GtkBin
*bin
= GTK_BIN( child
->data
);
785 GtkLabel
*label
= GTK_LABEL( bin
->child
);
789 str
+= CHECKBOX_STRING
;
792 gtk_label_set( label
, str
.mbc_str() );
796 wxFAIL_MSG(_T("wrong listbox index"));
800 void wxListBox::SetStringSelection( const wxString
&string
, bool select
)
802 wxCHECK_RET( m_list
!= NULL
, _T("invalid listbox") );
804 SetSelection( FindString(string
), select
);
807 int wxListBox::GetIndex( GtkWidget
*item
) const
811 GList
*child
= m_list
->children
;
815 if (GTK_WIDGET(child
->data
) == item
) return count
;
824 void wxListBox::ApplyToolTip( GtkTooltips
*tips
, const wxChar
*tip
)
826 GList
*child
= m_list
->children
;
829 gtk_tooltips_set_tip( tips
, GTK_WIDGET( child
->data
), wxConv_local
.cWX2MB(tip
), (gchar
*) NULL
);
833 #endif // wxUSE_TOOLTIPS
835 #if wxUSE_DRAG_AND_DROP
836 void wxListBox::SetDropTarget( wxDropTarget
*dropTarget
)
838 wxCHECK_RET( m_list
!= NULL
, _T("invalid listbox") );
840 #ifndef NEW_GTK_DND_CODE
843 GList
*child
= m_list
->children
;
846 m_dropTarget
->UnregisterWidget( GTK_WIDGET( child
->data
) );
852 wxWindow::SetDropTarget( dropTarget
);
854 #ifndef NEW_GTK_DND_CODE
857 GList
*child
= m_list
->children
;
860 m_dropTarget
->RegisterWidget( GTK_WIDGET( child
->data
) );
868 GtkWidget
*wxListBox::GetConnectWidget()
870 return GTK_WIDGET(m_list
);
873 bool wxListBox::IsOwnGtkWindow( GdkWindow
*window
)
875 if (wxWindow::IsOwnGtkWindow( window
)) return TRUE
;
877 GList
*child
= m_list
->children
;
880 GtkWidget
*bin
= GTK_WIDGET( child
->data
);
881 if (bin
->window
== window
) return TRUE
;
888 void wxListBox::ApplyWidgetStyle()
892 if (m_backgroundColour
.Ok())
894 GdkWindow
*window
= GTK_WIDGET(m_list
)->window
;
897 m_backgroundColour
.CalcPixel( gdk_window_get_colormap( window
) );
898 gdk_window_set_background( window
, m_backgroundColour
.GetColor() );
899 gdk_window_clear( window
);
903 GList
*child
= m_list
->children
;
906 gtk_widget_set_style( GTK_WIDGET(child
->data
), m_widgetStyle
);
908 GtkBin
*bin
= GTK_BIN( child
->data
);
909 GtkWidget
*label
= GTK_WIDGET( bin
->child
);
910 gtk_widget_set_style( label
, m_widgetStyle
);