Re: [Fxruby-users] Default associations in FXFileList and FXDirList
Status: Inactive
Brought to you by:
lyle
|
From: Lyle J. <jl...@cf...> - 2003-09-15 14:44:44
|
Kristoffer Lund=E9n wrote:
> Then it would seem that it is either my code or FXRuby that is broken,=20
> here is a minimal example that only displays the C:\ drive (and I have=20
> drives up till I:\)
<snip>
> On my machine, all of those combinations display an unexpanded C:\=20
> drive, and when I start to navigate the tree, it is indeed C:\.
Jeroen: Kristoffer is absolutely correct, there is a bug in the=20
FXDirList widget, at least for the fox-1.0.x series. Have not checked it=20
on fox-1.1.x. The problem is that if you call FXDirList::setDirectory()=20
before calling create() on the directory list widget, the call to=20
scanRootDir() in FXDirList::create() blows away the previous tree structu=
re.
Kristoffer: Based on that, the workaround for your program is to first=20
save a reference to the directory list in an instance variable after=20
constructing it, i.e.
@dirlist =3D FXDirList.new(...)
and then set the directory in your MainWindow#create method, *after*=20
calling the base class version of create(), i.e.
class MainWindow
def create
# Do base class create first
super
# Now set the desired directory
@dirlist.directory =3D 'D:\\music'
# and show the main window
show(PLACEMENT_SCREEN)
end
end
Hope this helps,
Lyle
|