Opened 7 years ago

Closed 6 years ago

Last modified 3 years ago

#12754 closed defect (fixed)

[wxOSX-Cocoa] wxNotebook doesn't display icons

Reported by: jdiogo Owned by: csomor
Priority: normal Milestone:
Component: wxOSX Version: stable-latest
Keywords: wxNotebook, images, cocoa Cc: jndiogo@…
Blocked By: Blocking:
Patch: yes


Images added to a wxNotebook with AssignImageList are not being displayed.
The attached image shows a previous carbon build where images are displayed and a current cocoa build where they don't.

Attachments (2)

no-icons-notebook.png download (12.4 KB) - added by jdiogo 7 years ago.
osx_cocoa_notebook_tabimages.patch download (3.3 KB) - added by mmacleod 6 years ago.
Patch to implement image support for osx cocoa notebook tabs

Download all attachments as: .zip

Change History (10)

Changed 7 years ago by jdiogo

comment:1 Changed 7 years ago by vadz

  • Milestone 2.9.2 deleted

I guess this can be seen in the notebook sample too?

comment:2 Changed 7 years ago by jdiogo

Exactly - the notebook sample is also not displaying images for each tab.

comment:3 Changed 7 years ago by jdiogo

  • Cc jndiogo@… added

comment:4 Changed 6 years ago by mmacleod

  • Patch set

Attaching a patch I have used to implement notebook icon support on cocoa, most of the code is copied straight from the old cocoa port, and appears to work unchanged.

I know very little about objc or the cocoa APIs but from my limited understanding everything seems to be okay - I don't know if there is some better way to implement this, but seeing as this has been broken for over a year now with no interest from anyone I think it would be pragmatic to do it this way for now and implement a more ideal way (if there is one) later.

Changed 6 years ago by mmacleod

Patch to implement image support for osx cocoa notebook tabs

comment:5 Changed 6 years ago by csomor

  • Owner set to csomor
  • Status changed from new to accepted

comment:6 Changed 6 years ago by vadz

This doesn't work for the left/right tab orientation but it looks like it ought to be relatively simple to fix (just pass the orientation somehow to WXCTabViewImageItem and then take it into account in sizeOfLabel and drawLabel), and this is already much better than nothing so I'll apply this soon, thanks!

comment:7 Changed 6 years ago by VZ

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [72807]) Implement image support for wxNotebook pages in wxOSX/Cocoa.

This currently doesn't work correctly for left/right orientations but at least
it does work for the default top (and also bottom) one.

Closes #12754.

comment:8 Changed 3 years ago by Paul Cornett <paulcor@…>

In eed42abba5db06025ee75db0ef9265a894d4d97c/git-wxWidgets:

Don't change the clipboard in wxNotebook::SetPageImage() in wxOSX.

For some reason the implementation of this method (see #12754) also put the
image on the clipboard, which was completely unexpected and unnecessary, so
just don't do it.


(cherry picked from commit 10a4d15b273430dccc362bc703580742e27916d5)

Note: See TracTickets for help on using tickets.