Re: [Fxruby-users] multiple FXDirLists all get same drive from different FXDriveBoxs
Status: Inactive
Brought to you by:
lyle
From: jeroen <je...@fo...> - 2004-05-26 22:34:08
|
On Tuesday 25 May 2004 08:41 pm, Tom wrote: > Here is something very interesting. This only affects windows, of > course. When I have two FXDriveBox's and two FXDirList's, paired up so > the dirlists are supposed to only respond to their own drive box's > events, it turns out that when I select a drive in either of the > FXDriveBox's, both of the FXDirLists change! Is there some way to keep > the FXDirList's separate so that each FXDriveBox only changes the > appropriate FXDirList? > > When I comment out the connect() for either the left or the right, > changing the live drive box still changes the directories both dirlists. > With neither connected, of course, nothing happens, but as long as > one is connected, all FXDirLists get the same thing. I *must* be doing > something wrong here. > > Here's the sample code: > > > require 'fox' > > include Fox > > class DriveDialogs < FXMainWindow > def initialize(owner) > super(owner, "DriveDialogThingy", nil, nil, DECOR_ALL, 0, 0, 0, 0) > createUI() > end > > def create > super() > show(PLACEMENT_SCREEN) > end > > def createUI() > @contents = FXHorizontalFrame.new(self, > LAYOUT_FILL_X|LAYOUT_FILL_Y) > @leftvframe = FXVerticalFrame.new(@contents, > LAYOUT_FILL_X|LAYOUT_FILL_Y) > @rightvframe = FXVerticalFrame.new(@contents, > LAYOUT_FILL_X|LAYOUT_FILL_Y) > @leftdrivebox = FXDriveBox.new(@leftvframe,5) > @rightdrivebox = FXDriveBox.new(@rightvframe,5) > @leftdirlist = FXDirList.new(@leftvframe,10) > @rightdirlist = FXDirList.new(@rightvframe,10) > > @leftdrivebox.connect(SEL_COMMAND) { |send,sel,ptr| > @leftdirlist.directory = @leftdrivebox.drive > } > @rightdrivebox.connect(SEL_COMMAND) { |send,sel,ptr| > @rightdirlist.directory = @rightdrivebox.drive > } > > end > > end > > def run > application = FXApp.new("DriveDialogThingy","DriveDialogThingy") > DriveDialogs.new(application) > application.create > application.run > end Just asking, is this FOX 1.0 or FOX 1.2? - Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 23:50 12/11/2003 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ |