簡體   English   中英

wxListCtrl 不顯示圖像

[英]wxListCtrl does not show images

我使用了一個只有一列的 wxListCtrl(這是一個非常簡單的列表)。 基於 listctrl-sample,我嘗試讓列表項前面有一個圖標。 不幸的是,只顯示文本而不顯示圖像。

那是我的代碼(僅相關部分):

m_toolImages=new wxImageList(25,25);

m_hideList=new wxListCtrl(toolPanel,wxID_ANY,wxDefaultPosition,wxSize(180,-1),wxLC_REPORT|wxLC_NO_HEADER|wxLC_SINGLE_SEL);
m_hideList->AppendColumn(wxEmptyString);
m_hideList->SetColumnWidth(0,250);
m_hideList->SetImageList(m_toolImages,wxIMAGE_LIST_NORMAL);

imageID=m_toolImages->Add(bm); // bm is a wxBitmap wit a size of 25x25 pixels

m_hideList->InsertItem(i,"ItemName",imageID);

那么...這里可能缺少什么?

報告模式使用“小”圖像列表而不是普通的圖像列表,它只在“圖標”模式下使用,所以你需要設置那個。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM