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

ooDialog.4.2.3
closed
ooDialog (102)
complete
1
2014-01-19
2013-11-17
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-17
    • Pending work items: code+doc+test --> doc
     
  • Mark Miesfeld

    Mark Miesfeld - 2013-11-17

    Committed revision 9515. [r9515]

     

    Related

    Commit: [r9515]

  • Mark Miesfeld

    Mark Miesfeld - 2013-11-23
    • status: accepted --> pending
    • Pending work items: doc --> complete
    • Milestone: ooDialog.4.2.2 --> ooDialog.4.2.3
     
  • Mark Miesfeld

    Mark Miesfeld - 2013-11-23

    Committed revision 9549. [r9549] Doc

     

    Related

    Commit: [r9549]

  • Mark Miesfeld

    Mark Miesfeld - 2014-01-19
    • status: pending --> closed
     
  • Mark Miesfeld

    Mark Miesfeld - 2014-01-19

    Enhancement available in ooDialog 4.2.3 released 1/19/2014

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks