Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

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

ooDialog.4.2.3
closed
Mark Miesfeld
ooDialog (102)
complete
1
2014-01-19
2013-11-17
Mark Miesfeld
No

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

Discussion

  • Mark Miesfeld
    Mark Miesfeld
    2013-11-23

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


Anonymous


Cancel   Add attachments