Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structure for new program with params? #1

Closed
kirkins opened this issue Mar 5, 2017 · 4 comments
Closed

Structure for new program with params? #1

kirkins opened this issue Mar 5, 2017 · 4 comments

Comments

@kirkins
Copy link

kirkins commented Mar 5, 2017

I have a question about your recommendation for coding style if I want to create a new application for your windows 98 program.

I want to create a notepad function like this:

new $DesktopIcon("Notepad", ("notepad"), NotepadFile, "shortcut");

Lets say the third param NotepadFile is a function like this:

function NotepadFile(file, title){
  var $win = new $IframeWindow("notepad/index.html?file="+file, "Notepad");
  $win.title(title);
  return new Task($win);
}

How can I re-write the $DesktopIcon structure to keep your coding style but allow programs to have params passed in like this:

new $DesktopIcon("Notepad", ("notepad"), NotepadFile("fileName", "title"), "shortcut");
@1j01
Copy link
Owner

1j01 commented Mar 7, 2017

Yeah, so I've pretty much just made it handle the current usage and fleshed it out as needed.
I'd accept a PR with params as you've done, preferably along with usage, but Windows shortcuts don't specify the executable explicitly when it's a shortcut to a file, so I'd probably replace the exe parameter with a file_name parameter and add some basic file extension handling, with a hard-coded map of extensions to functions that take a file_name.
I'd also do a whole bunch of other refactoring. This is some old code.

@kirkins
Copy link
Author

kirkins commented Mar 8, 2017

Thanks I'll try to make the change to use file type as you suggest!

@kirkins
Copy link
Author

kirkins commented Feb 15, 2018

I will close this. The website is down for me https://98.js.org/

@kirkins kirkins closed this as completed Feb 15, 2018
@1j01
Copy link
Owner

1j01 commented Feb 15, 2018

The website hasn't actually been up yet at https://98.js.org/, but hopefully it will be soon 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants