Recent

Author Topic: Recommended way to build a resource file from a text file on macOS? [SOLVED]  (Read 981 times)

TRon

  • Hero Member
  • *****
  • Posts: 3271
Re: Recommended way to build a resource file from a text file on macOS?
« Reply #15 on: September 17, 2024, 10:43:43 pm »
@carl:
to remove resource directive from the main unit (and leave the main project directive as is).

But , quite honestly for a lazarus project and static data I would use the projects resource inclusion in the IDE options and for dynamic data I would manually load it.
This tagline is powered by AI

carl_caulkett

  • Sr. Member
  • ****
  • Posts: 450
Re: Recommended way to build a resource file from a text file on macOS?
« Reply #16 on: September 18, 2024, 12:13:25 am »
I've tried using the add resource facility in the lazarus IDE, but it doesn't let you add anything other than graphics files  :o
Unless i"ve missed something glaringly obvious...
"It builds... ship it!"

TRon

  • Hero Member
  • *****
  • Posts: 3271
Re: Recommended way to build a resource file from a text file on macOS?
« Reply #17 on: September 18, 2024, 06:02:51 am »
Unless i"ve missed something glaringly obvious...
You indeed did missed something obvious.

One of the reason why I let you struggle for a bit, hoping you would discover it yourself.

In the project options resources tab, is a add button. when you press that a dialog appears that let the user select a file. At the bottom right is a filename filter that is defaulting to graphic files. Click on it and it will collapse down and allows you to select *.* all files (at the very bottom).

That way it is possible to select any other file(name) that you wish to include as resource in your lazarus project.
This tagline is powered by AI

carl_caulkett

  • Sr. Member
  • ****
  • Posts: 450
Re: Recommended way to build a resource file from a text file on macOS?
« Reply #18 on: September 18, 2024, 04:17:44 pm »
On my Mac the filename filter is fiendishly hidden behind a "Show Options" button that I swear has just appeared overnight 😉
In any case I was able to get the manually loaded .RES file to work. The key was to specify the resource name with the .RC file in upper-case and then use the same uppercase name in the...
Code: Pascal  [Select][+][-]
  1. rs := TResourceStream.Create(HInstance, 'OSMOSEPRESETSRESOURCES', RT_RCDATA);
  2.  
It also helped to use a different name for the resource and the associated files from the project name, because the act of building project automatically generates a <project name>.res file.

Thanks for your guidance @TRon, even if you didn't hand it to me on a plate 😉
"It builds... ship it!"

TRon

  • Hero Member
  • *****
  • Posts: 3271
Re: Recommended way to build a resource file from a text file on macOS?
« Reply #19 on: September 18, 2024, 05:43:43 pm »
I do offer my apologies carl, and doing so for two reasons a) I was not aware dialogs work different for macos and b) I was very busy yesterday and hadn't had enough time to spend more time on your issue.

I sometimes forget that not everyone is familiar with how certain things work in the IDE (for whatever platform) even when it is just a click of a button away. Do note that it is (or can be) a painful process when you are completely unfamiliar with software development and GUI's in general (read IDE's). It simply takes time to learn where everything is hidden and tucked away , even though a lot of it is presented in the Lazarus IDE wiki.

Thank you carl for having reported back your findings and that you were able to solve your issue.
This tagline is powered by AI

carl_caulkett

  • Sr. Member
  • ****
  • Posts: 450
Re: Recommended way to build a resource file from a text file on macOS?
« Reply #20 on: September 18, 2024, 06:07:42 pm »
It's not that I am unfamiliar with software - I had a close on 20 year Delphi career but most of my experience was gained during version 1 to, and especially, version 7 which I regard as the golden age of Delphi, especially combined with Coderush 7.0.4. That combination was the closest, I think, that an IDE can have come to being telepathic 😉

Since then I have learnt Go, Java, Scala, Rust and Mojo, but building a UI in any of these is like pulling teeth, so for my current project, it's back to Pascal. This Lazarus variant is both reassuringly familiar and weirdly different, both in terms of the IDE, as I have demonstrated, and in the FPC language. I really need to find a nice easy to read summary of all of the enhancements to FPC compared to Delphi's Object Pascal 😉
"It builds... ship it!"

 

TinyPortal © 2005-2018