giu icon indicating copy to clipboard operation
giu copied to clipboard

msgbox: workaround for n-call of PrepareMsgbox (fix #288)

Open gucio321 opened this issue 4 years ago • 6 comments

gucio321 avatar Aug 28 '21 18:08 gucio321

I'm thinking about to refine the whole concept of Popup. This is the most tricky part of imgui from my point of view. Mostly the rule 'popup could only be opened by the invoker who is defined at the same widget hierarchy'. It's very confusing. It makes me feels very hard to understand why popup doesn't work at the begining of learning imgui.

I have few thoughts here:

  1. The popup should be defined at very certain position, rather than random layout in random widget hierarchy.
  2. If two popups get same id, both of them should be opened, rather than merging their body.

AllenDang avatar Aug 30 '21 09:08 AllenDang

The popup should be defined at very certain position, rather than random layout in random widget hierarchy.

what do you mean? what could the demo code look like?

If two popups get same id, both of them should be opened, rather than merging their body.

sure, the other option is to disable such the solution - all popups should be its unique id - no duplicates else - panic

gucio321 avatar Sep 09 '21 15:09 gucio321

@gucio321 The popup should be defined at very certain position, rather than random layout in random widget hierarchy. I mean, for example, we have a method in window widget named Popups, where is the only place to define popup.

AllenDang avatar Sep 10 '21 02:09 AllenDang

hmm, @AllenDang I just got an idea. Maybe for now, change PopupModal() function name to RegisterPopupModal? Then, everyone'll know that this method doesn't actually make popup appear but just add it to the system?

gucio321 avatar Nov 26 '21 11:11 gucio321

@AllenDang what should I do with this? close?

gucio321 avatar Feb 09 '22 09:02 gucio321

@gucio321 Let's leave it here as a reminder to refine Popup related code in future.

AllenDang avatar Feb 09 '22 10:02 AllenDang

closing, as #288 exists

gucio321 avatar May 10 '23 19:05 gucio321