On 2/27/07, Francesco Montorsi <[EMAIL PROTECTED]> wrote:
> Anders F Björklund ha scritto:
> >> and we need to implement the MacOpenFile method in wxApp:
> >>
> >>      // in response of an open-document apple event
> >>      virtual void         MacOpenFile(const wxString &fileName) ;
> >
> > Did a quick copy/paste implementation of this, but it wasn't
> > perfect: it opened up the first empty window anyway on launch,
> > and then did the requested script afterwards (on top of that).
> > What was worse was that if you close them in the wrong order,
> > the application doesn't quit - but has to be force-quitted...
> > So it probably needs some more thought-through implementation :-)

What triggers this function to be called?

This is something you override in include/wx/mac/carbon/app.h ?
wxApp::MacOpenFile(filename)
I see in src/mac/carbon/app.h they use it to open a document if there
is a wxDocManager::GetDocumentManager().

Maybe we should create a new wxEvent, wxLuaMacOpenFilesEvent, that in
wxLua you'd handle by having

wx.wxGetApp():Connect(wx.wxID_ANY, wxEVT_WXLUA_MAC_OPEN_FILES,...)

It's a little bit of a hack and I would prefer to keep as close to C++
as possible, since that way we don't have too many gotcha's and can
use their docs, but this is pretty clean.

In fact we could implement this in wxDropTarget (which is not
currently implemented in any useable way) with a special function for
mac. If you create a wxLuaDropTarget drop target for your frame you
also get this functionality too. Does this make more sense?

Regards,
    John Labenski

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to