Notes about implementing CreatePopupMenu for the future
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27677 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -50,11 +50,53 @@ enum {
|
||||
wxEVT_TASKBAR_LEFT_DCLICK = 0,
|
||||
wxEVT_TASKBAR_RIGHT_DCLICK = 0,
|
||||
};
|
||||
|
||||
|
||||
#else
|
||||
// // Otherwise make a class that can virtualize CreatePopupMenu
|
||||
// class wxPyTaskBarIcon : public wxTaskBarIcon
|
||||
// {
|
||||
// DECLARE_ABSTRACT_CLASS(wxPyTaskBarIcon);
|
||||
// public:
|
||||
// wxPyTaskBarIcon() : wxTaskBarIcon()
|
||||
// {}
|
||||
|
||||
// wxMenu* CreatePopupMenu() {
|
||||
// wxMenu *rval = NULL;
|
||||
// bool found;
|
||||
// bool blocked = wxPyBeginBlockThreads();
|
||||
// if ((found = wxPyCBH_findCallback(m_myInst, "CreatePopupMenu"))) {
|
||||
// PyObject* ro;
|
||||
// wxMenu* ptr;
|
||||
// ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
|
||||
// if (ro) {
|
||||
// if (wxPyConvertSwigPtr(ro, (void **)&ptr, wxT("wxMenu")))
|
||||
// rval = ptr;
|
||||
// Py_DECREF(ro);
|
||||
// }
|
||||
// }
|
||||
// wxPyEndBlockThreads(blocked);
|
||||
// if (! found)
|
||||
// rval = wxTaskBarIcon::CreatePopupMenu();
|
||||
// return rval;
|
||||
// }
|
||||
|
||||
// PYPRIVATE;
|
||||
// };
|
||||
|
||||
// IMPLEMENT_ABSTRACT_CLASS(wxPyTaskBarIcon, wxTaskBarIcon);
|
||||
|
||||
#endif
|
||||
%}
|
||||
|
||||
|
||||
|
||||
// NOTE: TaskbarIcon has not yet been changed to be able to virtualize the
|
||||
// CreatePopupMenu method because it is just before a release and I worry that
|
||||
// there will be a problem in this case with it holding a reference to itself
|
||||
// (since it depends on the dtor for cleanup.) Better safe than sorry!
|
||||
//
|
||||
// Perhaps a better mechanism for wxPython woudl be to turn CreatePopupMenu
|
||||
// into an event...
|
||||
|
||||
MustHaveApp(wxTaskBarIcon);
|
||||
|
||||
@@ -79,7 +121,7 @@ public:
|
||||
bool IsIconInstalled() const;
|
||||
|
||||
bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxPyEmptyString);
|
||||
bool RemoveIcon(void);
|
||||
bool RemoveIcon();
|
||||
bool PopupMenu(wxMenu *menu);
|
||||
#endif
|
||||
};
|
||||
|
Reference in New Issue
Block a user