How to display two dialogs on each other

Discussion of Lua and LuaWML support, development, and ideas.

Moderator: Forum Moderators

Post Reply
User avatar
ZombieKnight
Posts: 187
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

How to display two dialogs on each other

Post by ZombieKnight »

Hi,
I'd like to have my custom dialog in the background
And over whole screen focused text input dialog.
Any ideas how to do so?
I had saurian in profile before, but I've merged my discord profile with forum one...
white_haired_uncle
Posts: 1231
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: How to display two dialogs on each other

Post by white_haired_uncle »

I don't know if this will help, but I recently built an example of placing a label over another widget. I didn't have much luck with the fonts, and I don't know if this could be used to stack dialogs, but...

https://wiki.wesnoth.org/Sandbox/GUI/Ge ... d#Canvases
Speak softly, and carry Doombringer.
User avatar
Celtic_Minstrel
Developer
Posts: 2246
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: How to display two dialogs on each other

Post by Celtic_Minstrel »

This is very easy. The first dialog (ie, the one in the background) must call the second dialog in either the pre_show or a callback function (depending on how your logic works).

That example you posted is about placing things on top of things within a single dialog, so it's not relevant to the question.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
white_haired_uncle
Posts: 1231
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: How to display two dialogs on each other

Post by white_haired_uncle »

So your foreground/background canvas can't be another dialog? It may seem like a silly idea, but I had it and now the concept interests me.

[EDIT: No, probably not. The wiki lists the things you can put "on" a canvas, and dialogs and arbitrary widgets and any other silly thing I can think of are on the list]

P.S. Don't mean to hijack the thread, but if you have any ideas on why I had problems with text size on a label on a canvas, or even why the progress_bar doesn't(?) include a text (X%) overlay option I'd be very interested.
Last edited by white_haired_uncle on April 21st, 2024, 3:34 pm, edited 1 time in total.
Speak softly, and carry Doombringer.
User avatar
ZombieKnight
Posts: 187
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

Re: How to display two dialogs on each other

Post by ZombieKnight »

Thank you both, I'll try it (tho it'll take some time).
I had saurian in profile before, but I've merged my discord profile with forum one...
User avatar
ZombieKnight
Posts: 187
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

Re: How to display two dialogs on each other

Post by ZombieKnight »

Celtic_Minstrel wrote: April 20th, 2024, 2:03 pm This is very easy. The first dialog (ie, the one in the background) must call the second dialog in either the pre_show or a callback function (depending on how your logic works).

That example you posted is about placing things on top of things within a single dialog, so it's not relevant to the question.
Oh, I wasn't clear with my question.

I'd like to have invisible text input all over the screen, under it visible custom dialog (message).
How to do so?
Use one or two dialogs?
I had saurian in profile before, but I've merged my discord profile with forum one...
Post Reply