Opened 8 years ago

Closed 5 years ago

Last modified 5 years ago

#11831 closed defect (outdated)

wxTaskBarIcon problem in Mac OS

Reported by: TNikolay Owned by: csomor
Priority: normal Milestone:
Component: wxOSX Version: stable-latest
Keywords: wxTaskBarIconWindow Cc:
Blocked By: Blocking:
Patch: yes


When I try to use wxTaskBarIcon to adding status icon to Mac OS "tray area" (sorry don't know how it exactly called in mac os). I get assert - can't create window with null parent and wxTaskBarIcon does not work at all. I have changed

     wxTaskBarIconWindow(wxTaskBarIconImpl *taskBarIconImpl)
    :   wxWindow(NULL,-1)
   wxTaskBarIconWindow(wxTaskBarIconImpl *taskBarIconImpl)
  :   wxWindow(wxTheApp->GetTopWindow(),-1)

I am not sure that this way is correct, but after this changes it works (not perfect:().

Also example sample/statusbar does not work, it seems there is problem with defines in code...

I use Mac OS 10.5.6 x64, and wxWidgets trunk compiled as

../configure --disable-shared --enable-static --enable-unicode --enable-compat28 --with-cocoa --with-macosx-version-min=10.5 --with-macosx-sdk=/Developer/SDKs/MacOSX10.5.sdk CFLAGS="-arch i386" CXXFLAGS="-arch i386" CPPFLAGS="-arch i386" LDFLAGS="-arch i386" OBJCFLAGS="-arch i386" OBJCXXFLAGS="-arch i386" --enable-debug

Attachments (1)

wxTaskBarIconWindow.patch download (700 bytes) - added by TNikolay 8 years ago.

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by TNikolay

comment:1 Changed 8 years ago by csomor

please don't combine completely different problems into the same ticket, if you have problems with the statusbar sample, then enter a separate bug report with precise informations, I've built the statbar sample from trunk for osx_cocao without a problem now

comment:2 Changed 8 years ago by csomor

  • Status changed from new to infoneeded_new

do you get this crash in the sample ? I just built and run it without an assert

comment:3 Changed 8 years ago by csomor

  • Status changed from infoneeded_new to new

ok, I've seen the problem, related to using CUSTOM_STATUSITEM

comment:4 Changed 8 years ago by csomor

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

comment:5 Changed 6 years ago by vadz

Stefan, should we create wxTaskBarIcon with the top window as parent? I'm not sure if this is the right solution (what happens if there is no top window?) but if it really doesn't work at all now it could still be an improvement...

comment:6 Changed 5 years ago by vadz

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

The patch doesn't seem to be needed any more, the sample works fine for me now (after fixing compilation, will commit soon).

comment:7 Changed 5 years ago by VZ

(In [72806]) Fix taskbar sample compilation under wxOSX/Cocoa.

Use wxTBI_XXX constants instead of wxTaskBarIcon::XXX ones which don't seem to
exist any longer.

See #11831.

Note: See TracTickets for help on using tickets.