wxFilePickerCtrl size problem/question [ wxGTK 2.8.0 ]

Francesco Montorsi f18m_cpp217828 at yahoo.it
Mon Mar 12 11:52:08 PDT 2007


Hi,

Ian Britten ha scritto:
> [ wxGTK v2.8.0 ]
> 
> Hi all,
> When using the wxFilePickerCtrl, shouldn't the full name of the selected
> file be shown (Up to some practical length), such as is shown in the
> example:
> http://developer.gnome.org/doc/API/2.0/gtk/GtkFileChooserButton.html
> 
> [ BTW - It would be really nice if wx included screenshots of the
> various widgets in their docs like that! :) - Very nice touch! ]
right, it would be really nice to have such screenshots, maybe one for
win, one for GTK+2 and one for Mac.
But I feel someone would have to contribute it ;)

> Currently, when I run the 'widgets' sample (And in my own code), only
> the first letter or two is shown, with some dots.  For example,
> "Makefile" becomes "M..."
that's because the wxFilePickerCtrl is left to its "best initial 
size"... I think.

> 
> This is very frustating, and is almost useless, since you can't see
> what the file name actually is.
> [ NOTE - I'm aware of the 'proportional' sizing stuff on the
> wxFilePickerCtrl, but that's not what I'm looking for.  I don't want
> the button to resize when the window is resized - I just want the
> button to be 'big enough' to show most/all of the file name. ]
> 
> Is there some way that I can make it resize itself to be big enough
> (I didn't see anything hopeful in the API docs)?
sure and you do it as you would do for any other wx control:

     // e.g.: if you want the picker to be at least 300 pixels wide:
     pMyFilePicker->SetMinSize(300, -1);

I didn't test the call above but it should work just fine...

Francesco







More information about the wx-users mailing list