How do I load a dialog "resource" in Python?

ChrisEykamp Posts: 6
edited March 2023 in Oasis montaj

I want to run the following snippet of Python code:

    window = gxapi.GXDGW.create("my_dialog")

gxapi.GXDGW.create() creates a dialog object, and run_dialog() displays it.

The docs for create say:

        This method creates a Dialog window from a specified
        resource. The Resource is loaded into memory but not displayed.

The function takes a single parameter, name, which is a string, and is the "Name of the Window Resource to use".  I know this name could refer to a definition in a .grh file.
My question is where does the "resource" come from?  

I know one way to define a dialog, by compiling a .grh file, and it looks like if I were writing in GX, I could compile that resource into my program code, but I can find no mention of how to do this with Python.

Alternately, is there a better way to create a customized dialog using Python?




  • VictorSavenije
    By any chance, have you been able to find a solution to your problem of creating a customized dialog using Python?
  • ChrisEykamp
    It's like pulling teeth, but I ended up creating my UI system using tkinter.  There are lots and lots of pain points in doing that, but ultimately I was able to make it work, and I can run my code from both inside and outside geosoft.
  • VictorSavenije
    Thanks your insight. 
    I guess I can too create a UI using tkinter/pyqt, but it's sad that this is not easy using the API system of geosoft. 
  • ChrisEykamp
    I agree.  It seems like the API is very capable, but we need lots more documentation and samples of how to do stuff.  I came to dread working on this project, and I'm a very capable developer.