represented filename

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, LCMark

Locked
monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

represented filename

Post by monte » Fri Oct 09, 2015 9:21 pm

Hi

I was wondering about adding a window decoration or other property to allow NSWindow setRepresentedFilename to work. Originally I thought we might need to have a separate path saved for the stack but then I realised it's not that tricky to fiddle with there stack filename on the fly so it points at some underlying data source file. So a decoration flag will cover it.

Any thoughts or should I just go ahead and submit a PR?

Cheers

Monte
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1206
Joined: Thu Apr 11, 2013 11:27 am

Re: represented filename

Post by LCMark » Sat Oct 10, 2015 2:05 pm

@monte: I presume this would add the little 'document' icon next to the title bar text?

I'd suggest making it a transient 'documentFilename' property - after all, a stack might be an editor for a file in an application and as such would have no relation to the stack filename. Indeed, if the stack is created on the fly, it wouldn't have a filename at all.

If the documentFIlename is empty, then no icon is shown; otherwise one representing the specified filename would be.

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: represented filename

Post by monte » Sat Oct 10, 2015 9:37 pm

Yes, that's it the icon in the title.

I was thinking that if the stack were created on the fly then you could still set the filename. It doesn't worry me either way but I think some users use ui stacks as the saved file and using the standard filename and a decoration would make the behavior automatic once the file is saved in those cases while for those that clone a template stack or just create one on the fly it's just a matter of setting the filename.

Like I said I'm happy either way so whatever you want. I'm also unsure if there's a similar feature on Windows or Linux so I'll research that.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1206
Joined: Thu Apr 11, 2013 11:27 am

Re: represented filename

Post by LCMark » Sun Oct 11, 2015 9:43 am

The two main use-cases I think are this:

Someone writes a stack which allows you to edit a file of some sort. It is a single-document editor, so the actually editor stack always hosts the file. In this instance, the filename of the document is distinct from that of the stack (indeed, the stack might use its filename to find resources). This would require a distinct property.

Someone writes a multi-view editor which works by replication of a template stack. Now, in this case the editor stacks would never be saved so whilst the 'filename' property of them might be something which could be used for the actual document filename it mixes up two things. Particularly if you think about editing in the IDE - if you accidentally save one of your replicated editors whilst debugging the editing of a specific file, you'd end up overwriting your test document file by accident.

Having an explicitly separate property to control the document filename is definitely going to be the much more common case, and something which will avoid any accidents whilst editing in the IDE.

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: represented filename

Post by monte » Sun Oct 11, 2015 11:43 am

OK, no problem, probably simpler to implement anyway. Particularly if it's just a transient property as you suggested earlier.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: represented filename

Post by monte » Mon Oct 12, 2015 12:45 am

LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Locked

Return to “Engine Contributors”