>
> On 27.05.2011, at 17:22, anon wrote:
>
> >> On 27/05/11 12:28, anon wrote:
> >>> Hi!
> >>> I've been having trouble figuring out how exactly I'm supposed to =
> fetch the filename/path string from said widget when my callback is =
> invoked.
> >>> I have been looking through the relevant headers for FileBrowser and =
> Browser classes and haven't succeded locating anything of interest.
> >>>=20
> >>=20
> >> Hi,
> >>=20
> >> Does the value() method not do what you're looking for? Inside the
> >> FileChooser's callback:
> >>=20
> >> void chooserCB(fltk::FileChooser* fc, void* v) {
> >>  // code goes here
> >>  puts(fc->value());
> >>  // more code goes here
> >> }
> >>=20
> >> Hope this helps!
> >> Ben
> >=20
> > Thanks for the reply Ben. FYI I'm writing a barebone audio player.
> > I want to use FileBrowser and not FileChooser. While I admittedly =
> haven't tried the latter I presume it is not meant to do what I want: =
> have a directory browser in the left side of a window and when an item =
> (directory) is selected, a Browser in the right side of the window shows =
> a list of audio files that are contained in the selected directory.
> >=20
> > But, if I've misunderstood the roles of the two XxxBrowsers, then I'm =
> unavoidably led to wonder about the point of the FileBrowser; is the =
> point to fetch the index of selected item which is then passed to some =
> fltk::file_function() (I think, not sure, that I noticed some related =
> functions in the doc) to fetch the actual string(s) ?
>
> FileChooser::value() returns the path and name of the file as a =
> C-string.=20
>
> FileBrowser is a whole different beast. It is a (optionally) =
> hierarchical display of files and directories. The easiest way to find =
> out how it works is to look at the source code of FileChooser.cxx which =
> uses a FileBrowser among other things.
>
> But the FLTK 2 documentation is incomplete anyway and FLTK 2 is alpha. I =
> recommend that you use FLTK 1.3.
>

I will later. I have an actual gui class providing my app a specific API so 
that the class can be reimplemented to use any toolkit.

I have done basic tests with FileChooser and unless it provides API to strip it 
from unnecessary widgets (everything beside the actual file/dir structure/tree) 
and also embed it inside a Window than it won't fir my needs.

I've now sat down to look in the APIs to see if it does provide said APIs, but 
it would be nice to hear what's your recommendation on this: does it provide 
functionality for my aforementioned needs (two-paned audio player) or should I 
keep examining FileBrowser + other parts of FLTK ?
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to