[wxMac 2.8.7] Problem with native list control
Eran Ifrah
eran.ifrah at gmail.com
Wed Jan 2 21:39:19 PST 2008
I also encountered this bug, and used the first solution (item =3D
list->GetItemCount()+1) and it works properly.
anyways, just thought you would like to know that there is a bug open for
this already
http://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D1830927&group_=
id=3D9863&atid=3D109863
Eran
On Jan 2, 2008 10:26 AM, Fulvio Senore <mailing at fsoft.it> wrote:
> I have a program that is working well under Linux and Windows, and now I
> am trying to port it to OSX.
>
> Everything is working fine, but I have a problem with the wxListCtrl
> control. I am using it in report mode: I add rows to it but I always see
> only one row in the control. I use the following code (I removed some
> code to avoid line wrapping):
>
> wxListCtrl lctl;
> ...
> ...
> wxListItem item;
> item.SetMask(
> wxLIST_MASK_STATE|wxLIST_MASK_TEXT|wxLIST_MASK_IMAGE|wxLIST_MASK_DATA );
> int i =3D lctl->InsertItem( item );
> lctl->SetItem( i, 0, files.FileName, imageIndex );
> lctl->SetItem( i, 1, files.IsFolder() ? "" :
> CUtils::HumanReadableFileSize(files.FileSize) );
> lctl->SetItem( i, 2, files.FileExt );
> lctl->SetItem( i, 3, files.DateTime.FormatDate() + " " +
> files.DateTime.FormatTime() );
> lctl->SetItem( i, 4,
> FormatObjectDescriptionForListView(files.FileDescription) );
> MyListItemData *itemData =3D new MyListItemData( ... );
> lctl->SetItemData( i, (long) itemData );
>
>
> I have seen in the debugger that lctl->InsertItem() always returns 0: it
> should return increasing numbers.
> I tried "item.SetId()" to set increasing numbers to the item before
> adding it: I can see all the rows, but the control works in a weird way
> after sorting it clicking the column headers.
>
> I forced the use of the generic list control:
> wxSystemOptions::SetOption( wxT("mac.listctrl.always_use_generic"), 1 );
> and now everything is working well, so this is not a great problem for
> me, but I think that you would like to know about it.
>
> Fulvio Senore
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>
>
-- =
Eran Ifrah
eran.ifrah at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-users/attachments/20080103/80d=
f3dc1/attachment.htm
More information about the wx-users
mailing list