Author Topic: [Scrubbed] Question about package loading and units that depend on them  (Read 191 times)

jamie

  • Hero Member
  • *****
  • Posts: 7937
I am writing a package, and I would like to know, how the "Printers" unit gets linked with the "Printer4Lazarus" package, which is needed to target the correct os/Widget etc.

 I have a case where I would like to have a single unit but would like to select the package that dictates its functionality.

 The Printer unit is a perfect example of what I want to do, can I get an explanation of how the compiler loads the packages and the associated unit gets defined?

Jamie




« Last Edit: August 09, 2026, 08:48:03 pm by jamie »
The only true wisdom is knowing you know nothing

jamie

  • Hero Member
  • *****
  • Posts: 7937
Re: Question about package loading and units that depend on them
« Reply #1 on: August 09, 2026, 08:47:34 pm »
apparently, there isn't too much magic to the compiler as I thought.

Using the Printer unit example, it appears you still need to invoke the OSPrinters to define the TWinPrinter class, and that can be done directly with using the OSPrinters or including a printer dialog which does that for you.

  I'll need to think about this concept and see if it will apply to my ideas.

Thank you, I'll stop wasting your time.

Jamie
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018