# Wx::FileDialog and common dialogs

**URL:** <https://www.ruby-forum.com/t/wx-filedialog-and-common-dialogs/119496>\
**Category:** wxRuby\
**Created:** [November 7, 2007, 1:47pm UTC](https://www.ruby-forum.com/t/wx-filedialog-and-common-dialogs/119496 "2007-11-07T13:47:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jari\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a698b9/32.png) [@Jari\_W](https://www.ruby-forum.com/u/Jari_W)\
**Post date:** [November 7, 2007, 1:47pm UTC](https://www.ruby-forum.com/t/wx-filedialog-and-common-dialogs/119496/1 "2007-11-07T13:47:54Z")

</div>

The documentation for Wx::FileDialog is incorrectly generated:  
[http://wxruby.rubyforge.org/doc/filedialog.html](http://wxruby.rubyforge.org/doc/filedialog.html)  
Every time the ‘\*’ (for the wildcard character in file filters) appears,  
the doc instead switches between boldface and normal.

Also, it seems like the links under “See also” are broken.

Feature request:  
Regarding all modal common dialogs (ColourDialog, DirDialog,  
FileDialog), it looks like it’s currently not possible to set the style  
element outside new(). For the modal ones, it would make lots of sense  
to be able to set the style separately prior to show\_modal:  
d.style = Wx::WHAT\_EVER\_STYLE

Best regards,

Jari W.

---

<div class="post-metadata">

**Author:** ![Jari\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a698b9/32.png) [@Jari\_W](https://www.ruby-forum.com/u/Jari_W)\
**Post date:** [November 7, 2007, 4:17pm UTC](https://www.ruby-forum.com/t/wx-filedialog-and-common-dialogs/119496/2 "2007-11-07T16:17:58Z")

</div>

Jari W. wrote:

> The documentation for Wx::FileDialog is incorrectly generated:  
> [http://wxruby.rubyforge.org/doc/filedialog.html](http://wxruby.rubyforge.org/doc/filedialog.html)  
> Every time the ‘\*’ (for the wildcard character in file filters) appears,  
> the doc instead switches between boldface and normal.

Thanks for the report; we’ll tidy it up for the next release.

> Feature request:  
> Regarding all modal common dialogs (ColourDialog, DirDialog,  
> FileDialog), it looks like it’s currently not possible to set the style  
> element outside new(). For the modal ones, it would make lots of sense  
> to be able to set the style separately prior to show\_modal:  
> d.style = Wx::WHAT\_EVER\_STYLE

For all Windows, which includes Dialogs, the style normally has to be  
set in the initializer - this is a WxWidgets restriction we can’t really  
work around. There is a method

d.window\_style = Wx::WHAT\_EVER  
[http://wxruby.rubyforge.org/doc/window.html#Window\_setwindowstyle](http://wxruby.rubyforge.org/doc/window.html#Window_setwindowstyle)

- but the catch is that some styles cannot be altered after  
initialization.

If you’re looking for a more self-documenting style of code, you could  
use keyword arguments to the constructor:

dlg = Wx::FileDialog.new(parent, :style =\> Wx::WHAT\_EVER)

hth  
alex
