2

I wrote a Pharo program that generates my daily task non-stop.

The program itself works fine, however I always need to instantiate my object in the playground to run it. Is there some other way of doing it automatically without having to create an object and send a message to it?

eMBee
  • 793
  • 6
  • 16
ludo
  • 543
  • 3
  • 14
  • 1
    please don't forget to mark your questions answered when you are happy with an answer! For more see https://stackoverflow.com/help/someone-answers – tukan Jul 12 '18 at 09:52

2 Answers2

2

Yes, you can. Save the image after you have instantiated your application and closed everything else. Then just start pharo from the image and you will have your application started.

If you want to do it more production wise you could use pharo-launcher.

For more detailed information you could squeak wiki which you can adjust to Pharo.

tukan
  • 17,050
  • 1
  • 20
  • 48
0

I would do one of three thing here:

  1. Add an item to the World menu, so you can bring up the menu and select your task. See a Stackoverflow Answer on that same topic.
  2. You could write some triggering code in a .st file on your file system, then use StartupPreferencesLoader to load it on startup.
  3. Create a window morph with a button that, once pressed, runs your code. Open the window, quit and save image changes. Never close the window.
RyanWilcox
  • 13,890
  • 1
  • 36
  • 60