FIleChooserDialogBox.show() ignores centreWithDefaultSize?


#1

Hi,

version 1.53

If I create a FileChooserDialogBox and call centreWithDefaultSize() and then call show(), the bounds established by the former seem to be ignored by the latter (the dialog always gets centered to the screen and not to the component). Is there a way to center a FileChooserDialogBox over a component?

Thanks.


#2

Yes, the show() method also tries to position it, and doesn’t take a component to centre around, so that’s what you’d expect really. You don’t actually need to use show(), you can just call runModalLoop on it yourself after calling centreWithDefaultSize(). (In fact, I’d recommend not using modal loops like show(), and if possible using the non-blocking enterModalState() instead).


#3

Makes sense … thanks!