poppath and popfile give segmentation fault on exit

Discuss GUI programming with the RapaGUI plugin here
Post Reply
walkero
Posts: 13
Joined: Fri Jul 29, 2022 11:59 pm

poppath and popfile give segmentation fault on exit

Post by walkero »

Hello everyone,
I am pretty new to coding with Hollywood. I am developing a small application where I have two poppers, asking the user two different paths. That window opens after a button is pressed in the main window.

I am doing the development on a Linux x64 system, with the latest Gnome installed, and I am using RapaGUI 2.2 and Hollywood 9

Whenever I close the application, I get a segmentation fault in the terminal, although the fields are visible and working as expected. This happens even if I just start the application, withought opening the window that contains those fields.

I tried to use popfile and I have the same issue. The popfont and the popcolor though are working without giving me the segmentation fault on exit.

Here is the code of how I set them in the window

Code: Select all

<window title="wizard" id="wizardWin" notify="closerequest">
	<vgroup frame="false" frametitle="">
		<colgroup columns="2">
			<label>Name</label>
			<textentry id="vmName" notify="text"/>
			<label>Choices</label>
			<choice id="choice">
				<item>choice 1</item>
				<item>choice 2</item>
			</choice>
			<label>Path 1</label>
			<vgroup>
				<poppath id="save_path" title="Please select a drawer..." notify="path"/>
				<label>Select the path 1</label>
			</vgroup>
			<label>Path 2</label>
			<vgroup>
				<poppath title="Please select a drawer..." notify="path"/>
				<label>Select the path 2</label>
			</vgroup>
		</colgroup>
		<hgroup frame="false">
			<button id="createButton">Create</button>
			<button id="cancelButton">Cancel</button>
		</hgroup>
	</vgroup>
</window>
I tried to have them outside the vgroups as well, and that doesn't make a difference. I made sure that this error comes from poppath and popfile because when I remove them, the problem disappears.

Is this a know issue? Is this something that was fixed in the later version of Hollywood? Any idea how to fix it?
plouf
Posts: 666
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: poppath and popfile give segmentation fault on exit

Post by plouf »

welcome to forum ;)

from my understing of your description, problem in not actually in poppath etc but in window close in general !?
so must happen in any window ?

BTW NO idea about linux, however bellow code closes quietly in win
you dont provide full test code, so do you use End in your program ?

here is a minimal example with End in hollywood10

Code: Select all

 @REQUIRE "RapaGUI"

moai.CreateApp([[
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app" >
<window title="wizard" id="wizardWin" notify="closerequest">
	<vgroup frame="false" frametitle="">
		<colgroup columns="2">
			<label>Name</label>
			<textentry id="vmName" notify="text"/>
			<label>Choices</label>
			<choice id="choice">
				<item>choice 1</item>
				<item>choice 2</item>
			</choice>
			<label>Path 1</label>
			<vgroup>
				<poppath id="save_path" title="Please select a drawer..." notify="path"/>
				<label>Select the path 1</label>
			</vgroup>
			<label>Path 2</label>
			<vgroup>
				<poppath title="Please select a drawer..." notify="path"/>
				<label>Select the path 2</label>
			</vgroup>
		</colgroup>
		<hgroup frame="false">
			<button id="createButton">Create</button>
			<button id="cancelButton">Cancel</button>
		</hgroup>
	</vgroup>
</window>
	 
</application>
]])

Function p_EventFunc(msg)
		Switch msg.attribute
			Case "CloseRequest":
				If SystemRequest("Close","really?","Yes|No") 
					moai.Set("wizardWin","Open",False)
					End
				EndIf
		EndSwitch
EndFunction

InstallEventHandler({RapaGUI = p_EventFunc})
Repeat
	WaitEvent
Forever

End
this is a compilation of above for linux x64 in hollywood10 for testing -> https://limewire.com/d/eQLsF#tnKerVAkga
Christos
walkero
Posts: 13
Joined: Fri Jul 29, 2022 11:59 pm

Re: poppath and popfile give segmentation fault on exit

Post by walkero »

@plouf
Thank you for your help.
Your example works fine. Maybe the problem is happening when I used these fields in a dialog I was opening third in a row. What I mean by that is that from the main app window, I opened a dialog where the user clicked a button to open a second dialog.

Now I changed the code completely, and I use the poppath fields in a dialog that has as parent the main app window, and this error is not there any more.

Thank you again for your valuable help.
Post Reply