#559 ooDialog - add a convenience function to help locate resource files

Mark Miesfeld
ooDialog (102)
Mark Miesfeld

Many ooDialog programs need to load resource files, resource scripts, resource DLLs, bit maps, etc.. If the ooDialog program is run from a command prompt in the directory the program file is located in then the path name to these resources can just be a relative path name and all works well.

But if the program is executed in some way such that the the directory the program resides in is not the current directory then things don't work.

I would like to have a convenient way for the program to get the complete path name to the directory it is located in so it could set up complete path names to the resource files it needs. Once the complete path name to the directory is determined, it should be accessible within dialog subclasses without having to pass arguments to the subclasses.

This is a convenience only, it would be no different then this:

parse source . . prgName
srcDir = filespec('L', prgName)
.local~srcDir = srcDir

dlg = .SimpleDialog~new

::method initDialog
say 'dir:' .srcDir

ooDialog would add a function, locate() that would return the source directory and add that value as an attribute of the existing .application object. The above code would then look like:

srcDir = locate()

dlg = .SimpleDialog~new

::method initDialog
say 'dir:' .application~srcDir


  • Mark Miesfeld
    Mark Miesfeld

    • status: accepted --> pending
    • Pending work items: doc --> complete
    • Milestone: ooDialog.4.2.2 --> ooDialog.4.2.3


Cancel   Add attachments