Stefano Mtangoo
2014-02-02 10:52:51 UTC
I have List control with files and want to put all known files to their
respective icons and generic icon for non ecognized files.
So used the function which under wxGTK returns false. Tracking down
debugger I found sTmp always is empty and since
I do not know how it the mime class works under GTK (I cannot find file
under src/gtk folder). So where do I go to pinpoint
whats the issue? I use post-wx3.0 svn version with GTK2, Ubuntu 13.04
Here is how I call it
wxIconLocation IconLocation;
wxFileType *FileType =
wxTheMimeTypesManager->GetFileTypeFromExtension(fname.GetExt()); // get the
file type for the extension
if(FileType) // if the file type was found
{
if(FileType->GetIcon(&IconLocation)) // if the icon for the file type
was found
{
imgIdx = m_imgList->Add(wxIcon(IconLocation));
}
else
{
imgIdx = 1; //generic aka unknown
}
}
Here is the function that returns mpty sTmp
bool wxFileTypeImpl::GetIcon(wxIconLocation *iconLoc) const
{
wxString sTmp;
size_t i = 0;
while ( (i < m_index.GetCount() ) && sTmp.empty() )
{
sTmp = m_manager->m_aIcons[m_index[i]];
i++;
}
if ( sTmp.empty() )
return false;
if ( iconLoc )
{
iconLoc->SetFileName(sTmp);
}
return true;
}
respective icons and generic icon for non ecognized files.
So used the function which under wxGTK returns false. Tracking down
debugger I found sTmp always is empty and since
I do not know how it the mime class works under GTK (I cannot find file
under src/gtk folder). So where do I go to pinpoint
whats the issue? I use post-wx3.0 svn version with GTK2, Ubuntu 13.04
Here is how I call it
wxIconLocation IconLocation;
wxFileType *FileType =
wxTheMimeTypesManager->GetFileTypeFromExtension(fname.GetExt()); // get the
file type for the extension
if(FileType) // if the file type was found
{
if(FileType->GetIcon(&IconLocation)) // if the icon for the file type
was found
{
imgIdx = m_imgList->Add(wxIcon(IconLocation));
}
else
{
imgIdx = 1; //generic aka unknown
}
}
Here is the function that returns mpty sTmp
bool wxFileTypeImpl::GetIcon(wxIconLocation *iconLoc) const
{
wxString sTmp;
size_t i = 0;
while ( (i < m_index.GetCount() ) && sTmp.empty() )
{
sTmp = m_manager->m_aIcons[m_index[i]];
i++;
}
if ( sTmp.empty() )
return false;
if ( iconLoc )
{
iconLoc->SetFileName(sTmp);
}
return true;
}
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users