// ----------------------------------------------------------------------------
void wxListBox::GtkInsertItems(const wxArrayString& items,
// ----------------------------------------------------------------------------
void wxListBox::GtkInsertItems(const wxArrayString& items,
wxASSERT_MSG(pos <= nCurCount, wxT("Invalid index passed to wxListBox"));
GtkTreeIter* pIter = NULL; // append by default
wxASSERT_MSG(pos <= nCurCount, wxT("Invalid index passed to wxListBox"));
GtkTreeIter* pIter = NULL; // append by default
gboolean res = gtk_tree_model_iter_nth_child(
GTK_TREE_MODEL(m_liststore),
&iter, NULL, //NULL = parent = get first
gboolean res = gtk_tree_model_iter_nth_child(
GTK_TREE_MODEL(m_liststore),
&iter, NULL, //NULL = parent = get first
GtkInsertItems(items, NULL, pos);
}
int wxListBox::DoAppend( const wxString& item )
{
// Call DoInsertItems
GtkInsertItems(items, NULL, pos);
}
int wxListBox::DoAppend( const wxString& item )
{
// Call DoInsertItems
GTK_TREE_MODEL(m_liststore),
&iter, NULL, //NULL = parent = get first
n
GTK_TREE_MODEL(m_liststore),
&iter, NULL, //NULL = parent = get first
n
{
// wxItemContainer already deletes data for us
wxListBox::DoSetItemClientData(n, (void*) clientData);
{
// wxItemContainer already deletes data for us
wxListBox::DoSetItemClientData(n, (void*) clientData);
wxCHECK_RET( m_treeview != NULL, wxT("invalid listbox") );
GtkTreeEntry* entry = GtkGetEntry(n);
wxCHECK_RET( m_treeview != NULL, wxT("invalid listbox") );
GtkTreeEntry* entry = GtkGetEntry(n);
wxCHECK_MSG( m_treeview != NULL, wxNOT_FOUND, wxT("invalid listbox") );
//Sort of hackish - maybe there is a faster way
wxCHECK_MSG( m_treeview != NULL, wxNOT_FOUND, wxT("invalid listbox") );
//Sort of hackish - maybe there is a faster way
void wxListBox::DoSetFirstItem( int n )
{
wxCHECK_RET( m_treeview, wxT("invalid listbox") );
void wxListBox::DoSetFirstItem( int n )
{
wxCHECK_RET( m_treeview, wxT("invalid listbox") );
//RN: I have no idea why this line is needed...
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (m_treeview))
//RN: I have no idea why this line is needed...
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (m_treeview))
wxString str(GetString(i));
GetTextExtent(str, &wLine, NULL);
lbWidth = wxMax(lbWidth, wLine);
wxString str(GetString(i));
GetTextExtent(str, &wLine, NULL);
lbWidth = wxMax(lbWidth, wLine);
- // don't make the listbox too tall (limit height to around 10 items) but don't
- // make it too small neither
+ // don't make the listbox too tall (limit height to around 10 items) but don't
+ // make it too small neither