Recent

Author Topic: Help from Mac Gurus Please  (Read 5429 times)

huwmungous

  • New Member
  • *
  • Posts: 14
Help from Mac Gurus Please
« on: March 14, 2011, 02:31:21 pm »
Hi, all.

I have been asked to create a (command line) solution which will work on Windows and Mac simply to change the desktop background.  I supposed Lazarus would be a good choice but now I am not so sure. 

The requirements are very simple

  • The executable needs to be 100% standalone with no additional installs required.
  • When invoked the program must load a jpg or a bitmap to the desktop background
  • A GUI is not necessary, though possibly desirable
  • The solution needs to be 'lowest common denominator' - ie guaranteed to work on the most up-to-date OSs and then as many earlier versions as possible.

Any suggestions as to how I might aproach this would be very greatly appreciated.  I am a decent programmer but have virtually no Mac experience whatsoever.  The windows version is already written. 

  • I am unsure if I should be looking at widget-sets (and if so - which one) or scripts
  • I need some sort of VM as a development environment and dont know if a 680x0 emulator is the one to go for (I am aware of Universal Binaries btw).  I am guessing this is dependent upon the approach I take for the function itself.
  • I need to know what the most generic solution is likely to be
  • I am concerned there may be more questions I need to ask the customer before designing a solution
  • I do not know if there is some glaringly simple solution that I have not yet considered.  Possibly not involving Lazrus (?)

Sorry the question is a bit 'Noob' - the solution is doubtless not complicated when you know how.

Cheers
Hugh


Laksen

  • Hero Member
  • *****
  • Posts: 727
    • J-Software
Re: Help from Mac Gurus Please
« Reply #1 on: March 14, 2011, 04:04:45 pm »
This might be helpful: http://stackoverflow.com/questions/3220416/how-to-get-and-set-the-wallpaper-in-objective-c-on-mac-osx

I don't think it should be hard to convert to Objective Pascal, but I don't know.. :)

huwmungous

  • New Member
  • *
  • Posts: 14
Re: Help from Mac Gurus Please
« Reply #2 on: March 14, 2011, 05:22:26 pm »
Yes I saw that article, and I think it implies I should be programming Cocoa

JimBeam

  • New Member
  • *
  • Posts: 36
Re: Help from Mac Gurus Please
« Reply #3 on: March 15, 2011, 04:02:02 am »
  • I need some sort of VM as a development environment and dont know if a 680x0 emulator is the one to go for (I am aware of Universal Binaries btw).  I am guessing this is dependent upon the approach I take for the function itself.
... IIRC, if you're talking about ancient Macs (with the original Mac OS) then you'd need a 680x0 emulator. Newer Macs with OSX have either PowerPC (older) or Intel processors
Getting an emulator could be very tricky as it's against Apple's license to run the OS on non-Apple systems. You're probably better off with a real OSX machine.

As for the actual code for OSX:
A quick google led to this:
http://still-scripts.com/applescript/change-your-desktop-background-with-applescript/
You could use applescript to set the desktop background. Not very elegant but possibly quite simple.
See
http://wiki.lazarus.freepascal.org/Multiplatform_Programming_Guide
The alternative would be to use the native API, Cocoa or Carbon (thought Carbon is deprecated nowadays). There are some Mac programmers around here that can probably supply more info.

huwmungous

  • New Member
  • *
  • Posts: 14
Re: Help from Mac Gurus Please
« Reply #4 on: March 15, 2011, 08:29:03 pm »
Thanks, JimBeam.

The goalposts have moved slightly - for Mac I just need to support PowerPC and Intel.  Part of my problem is that it is such a small project I have to get it done without investing anything.

Applescript may end up being the answer, but I was asked to provide 3 .exe files  Wintel, Appletel and PPC.  So far I have not had success with VMs so I will just have to try borrowing some hardware.

 

TinyPortal © 2005-2018