On Thu, 30 May 2019 00:37:25 +0200, Mike Wey wrote:

On 29-05-2019 23:52, Alex X wrote:

[SKIP TO------>HERE]

There is no run:

Error: no property run for type gtk.Window.Window

(I'm using a window, trying with a real dialog)

Same problem. Shows up the first time but then corrupt the second(the window that pops up is smaller and just a gray rectangle with a square).

I feeling is that some how the popup handler is corrupting the window. I'm going to try to dispatch it... same issue.

dialog.run();
dialog.destroy();
dialog.run();
dialog.destroy();
dialog.run();
dialog.destroy();


does not work, unlike when I use a window and hide and show

For example, this works:

dialog.run();
dialog.showAll();
dialog.hide();
dialog.showAll();
dialog.hide();
dialog.showAll();
dialog.hide();
dialog.run();
dialog.run();


The showAll doesn't seem do do anything.

but running it 3 times requires me to close it 3 times... but it always shows up properly.

[------HERE]

What seems to be happening is something like this:

When closing out the window/dialog it destroys the window and it is not recovered(Remember, I'm using glade builder to generate the window).

If I do

 dialog.run();
 dialog.destroy();

dialog.run();

Then after the first close the window is screwed up on the next run

So it seems like the window is being destroyed and I'm trying to run a destroyed window/dialog.

I do not destroy it but only click on the x in upper right corner. So somewhere there is an implicit destroy in the code or something is trashing the window/dialog somehow.

If you are using a window, then the default handler for the close button
will destroy the window, and unref and possibly destroy it's children.

You will need to connect a handler that hides the window instead of
destroying it:

dialog.addOnDelete((_, widget){ widget.hide(); return true; });

A dialog.run does this for you, which is why you need to call hide
or destroy when run returns.

I just updated to your new release and it does not crash, but the second time the window opens only the title bar shows.

I added your onDelete and it works!

Thanks.

Only question I have left is, what is the diff between a dialog and a window? is it just the extra plumbing such as a parallel wnd proc? Basically is there any real use using a dialog over a window? I'm just having them pop up for user interaction and design my own using glade. I don't see any difference. Both can be modal, etc.

I didn't notice in difference in the libs from the new update. (the files were exactly the same size)

Also, what did chance was some icons now are much larger. Well, one is like 32x32 and is causing a row to be very large. Everything was defaulting before and was 16x16. Just curious. This was after updating the runtime.

Actually the icon is external so it hasn't changed... I'll just rescale it manually.