Re: [Fxruby-users] Default associations in FXFileList and FXDirList
Status: Inactive
Brought to you by:
lyle
|
From: <kun...@ho...> - 2003-09-13 08:29:08
|
jeroen wrote:
> Well, I only fix what's known to be broken, and AFAIK, it isn't... I just
> checked again; a call to
>
> dirbox->setDirectory("d:\");
>
> switches FXDirList's display to that of the D: drive as expected (FXDirDialog
> has a drive box and switching drive letters with it works).
>
Then it would seem that it is either my code or FXRuby that is broken,
here is a minimal example that only displays the C:\ drive (and I have
drives up till I:\)
####################################
#!/usr/bin/env ruby
require 'fox'
include Fox
class MainWindow < FXMainWindow
def initialize(app)
# Invoke base class initialize first
super(app, 'FXDirList Test case', nil, nil, DECOR_ALL, 100, 100, 800, 600)
contents = FXHorizontalFrame.new(self,
LAYOUT_SIDE_TOP|FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y|PACK_UNIFORM_WIDTH)
dirlist = FXDirList.new(contents, 0, nil, 0,
LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_RIGHT)
# All of these result in just C:\ being displayed, closed, and when
one navigates
# it is indeed the C:\ drive. D:\music exists.
dirlist.directory = 'd:/'
#dirlist.directory = 'd:'
#dirlist.directory = 'd:\\'
#dirlist.directory = 'd:/music'
#dirlist.directory = 'd:\\music'
end
def create
super
show(PLACEMENT_SCREEN)
end
end
application = FXApp.new
mainWindow = MainWindow.new(application)
application.create
application.run
##########################
On my machine, all of those combinations display an unexpanded C:\
drive, and when I start to navigate the tree, it is indeed C:\.
FXRuby does not seem to have a setDirectory method for that widget, and
that would probably be a bit unrubyish, but I did try with several such
calls too, with no result.
Anybody see anything immediately wrong with the above code, so I can
correct it? :) I would rather have the "all drives" widget, but getting
this to work is definitely good enough. (Btw, any unrelated code errors
is also up for critisism, I'm here to learn :)
Still Windows XP, ruby 1.8.0 and FXRuby 1.0.22.
Thanks,
-- Kristoffer
--
Sent using:
Mozilla Thunderbird 0.2 (20030901)
http://www.mozilla.org/projects/thunderbird/
|