Isotropix Forums

Error when trying to create more than one UI dialog window

Clarisse Scripting related topics

Error when trying to create more than one UI dialog window

Unread postby bvz » Thu Nov 09, 2017 2:01 am

I don't know if this is an error on my part or if this is a bug. I'll post it here first in case it is something I am doing wrong. If it is a bug, I will repost it under the bug tracker.

This code:

Code: Select all
def makeUI():

 
    clarisse_win = ix.application.get_event_window()
    window = ix.api.GuiWindow(clarisse_win, 900, 450, 600, 600)
    window.set_title("Test")
    window.show()

    while window.is_shown():
        ix.application.check_for_events()

    print "destroying the window"
    window.destroy()
    print "just destroyed the window"

makeUI()
makeUI()



gives me this output and this error (after showing me the window for the first time and letting me close it once):

Code: Select all
destroying the window
just destroyed the window
Traceback (most recent call last):
  File "<string>", line 18, in <module>
  File "<string>", line 5, in makeUI
  File "/tapps/commercial/Linux.x86_64/clarisse-3.5sp3/python/gui.py", line 2680, in __init__
    this = _gui.new_GuiWindow(_self, *args)
ValueError: invalid null reference in method 'new_GuiWindow', argument 2 of type 'GuiApp &'



but if I remove the second

Code: Select all
makeUI()


line at the end of the script, everything works fine. Basically I can only create one window during any run of my code. Any subsequent attempts to create a window leads to this error. Am I not destroying the window correctly when I am done? Or is this a bug?

Thanks!
bvz
 
Posts: 12
Joined: Tue Dec 03, 2013 10:55 am

Re: Error when trying to create more than one UI dialog wind

Unread postby bvz » Thu Nov 09, 2017 2:34 am

Interestingly enough, the following kind of "works" (by "works" I mean that it doesn't error out... but it is of course completely unusable)


Code: Select all
def makeUI():
 
    clarisse_win = ix.application.get_event_window()
    window = ix.api.GuiWindow(clarisse_win, 900, 450, 600, 600)
    window.set_title("Test")
    window.show()

    #while window.is_shown():
    #    ix.application.check_for_events()

    print "destroying the window"
    window.destroy()
    print "just destroyed the window"

print "A"
makeUI()
print "B"
makeUI()
bvz
 
Posts: 12
Joined: Tue Dec 03, 2013 10:55 am

Re: Error when trying to create more than one UI dialog wind

Unread postby bvaldes » Thu Nov 09, 2017 10:32 am

Hi,

Indeed this is a bug. It appears only on Linux. You can create an entry in the bug tracker, we will confirm it.
Sorry about that. Regards
Benoit VALDES
Isotropix
Clarisse QA
User avatar
bvaldes
 
Posts: 160
Joined: Mon Sep 26, 2016 11:44 am

Re: Error when trying to create more than one UI dialog wind

Unread postby bvz » Thu Nov 09, 2017 7:55 pm

I'll post it now. Thanks.
bvz
 
Posts: 12
Joined: Tue Dec 03, 2013 10:55 am


Return to Scripting