1j01 / 98

💿 Web-based Windows 98 desktop recreation █████▓█▓▓▒▓▒▒░▒░░░🗕︎🗗︎🗙︎
https://98.js.org
1.15k stars 183 forks source link

Is there a way to trigger launch of programs other than clicking on desktop icons? #25

Closed sweinberg closed 4 years ago

sweinberg commented 4 years ago

I started working on a start menu for the desktop with the intent of submitting a PR once it's complete. I have the look and functionality locked down except I can't figure out a way to launch programs by clicking on their respective menu item. I'm new to javascript so forgive me if it's an obvious answer.

I know that the functions for launching the program windows is in programs.js, so I'm assuming it's possible to create an onclick event that would trigger said functions? I tried tinkering around with it but I couldn't figure out how to make it happen. Any pointers?

programs.js: function Minesweeper(){ var $win = new $IframeWindow({ src: "programs/minesweeper/index.html", icon: "minesweeper", title: "Minesweeper", innerWidth: 280, innerHeight: 320 }); return new Task($win); }

index.html: <div class="start-menu-item" onclick="[insert calling of function Minesweeper here?]">Minesweeper</div>

sweinberg commented 4 years ago

never mind, figured this out!

Aiyush-G commented 3 years ago

Please could you say how?

Thanks