From aaronc at DatalogTechnology.com Mon Jun 4 14:10:17 2007 From: aaronc at DatalogTechnology.com (Aaron Caza) Date: Mon, 4 Jun 2007 12:10:17 -0600 Subject: [fxruby-users] MDIClient with ScrollArea Message-ID: Gentlemen, I'm trying to determine if it is possible to make an MDI interface in FXRuby which is capable of supporting large work areas whether they're virtual (eg. panning on one monitor) or multi-monitor capable. I've tried modifying the mditest example code to use an FXScrollArea (FXMainWindow->FXScrollArea->FXMDIClient) but I couldn't get it to work. So, what I'm wondering if a) this is actually possible with FXRuby and b) how I should go about doing this. Thanks in advance, Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20070604/a225adb8/attachment.html From jeroen at fox-toolkit.org Mon Jun 4 23:15:11 2007 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Mon, 4 Jun 2007 22:15:11 -0500 Subject: [fxruby-users] MDIClient with ScrollArea In-Reply-To: References: Message-ID: <200706042215.11876.jeroen@fox-toolkit.org> On Monday 04 June 2007 13:10, Aaron Caza wrote: > Gentlemen, > > > > I'm trying to determine if it is possible to make an MDI interface in FXRuby > which is capable of supporting large work areas whether they're virtual (eg. > panning on one monitor) or multi-monitor capable. I've tried modifying the > mditest example code to use an FXScrollArea > (FXMainWindow->FXScrollArea->FXMDIClient) but I couldn't get it to work. I see no reason why you'd want to scroll FXMDIClient, but if you do, it should be inside FXScrollWindow, not FXScrollArea. I have used dual-head configured machines with FXMainWindow stretched over both screens. That works fine. Your FXMDIChild can thus span two screens. > So, what I'm wondering if a) this is actually possible with FXRuby and b) > how I should go about doing this. FXScrollArea is really meant as base-class for scrolled widgets. For scrolling GUI, use FXScrollWindow. It expects a single child, and that child will be scrollable. Regards, - Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 22:10 06/ 4/2007 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ From aaronc at DatalogTechnology.com Tue Jun 5 13:29:06 2007 From: aaronc at DatalogTechnology.com (Aaron Caza) Date: Tue, 5 Jun 2007 11:29:06 -0600 Subject: [fxruby-users] MDIClient with ScrollArea In-Reply-To: <200706042215.11876.jeroen@fox-toolkit.org> Message-ID: Jeroen, Thanks for your response and your insights. As for the reasoning behind the scrolling, it is intended as a way to give the user...flexibility. In this case, I will have users that have various screens configured (a "screen" in this instance refers to the widgets a user has chosen to display in the current view). For users that move between machines (home and work, for example, with server-based user preferences), this will eliminate the problem of resolution changes causing (unwanted) screen layout/configuration changes. Then, at the user's option, they can manually select a "Fit-to-Display" button to resize should they desire. Cheers, Aaron -----Original Message----- From: Jeroen van der Zijp [mailto:jeroen at fox-toolkit.org] Sent: June-04-07 9:15 PM To: fxruby-users at rubyforge.org Cc: Aaron Caza Subject: Re: [fxruby-users] MDIClient with ScrollArea On Monday 04 June 2007 13:10, Aaron Caza wrote: > Gentlemen, > > > > I'm trying to determine if it is possible to make an MDI interface in FXRuby > which is capable of supporting large work areas whether they're virtual (eg. > panning on one monitor) or multi-monitor capable. I've tried modifying the > mditest example code to use an FXScrollArea > (FXMainWindow->FXScrollArea->FXMDIClient) but I couldn't get it to work. I see no reason why you'd want to scroll FXMDIClient, but if you do, it should be inside FXScrollWindow, not FXScrollArea. I have used dual-head configured machines with FXMainWindow stretched over both screens. That works fine. Your FXMDIChild can thus span two screens. > So, what I'm wondering if a) this is actually possible with FXRuby and b) > how I should go about doing this. FXScrollArea is really meant as base-class for scrolled widgets. For scrolling GUI, use FXScrollWindow. It expects a single child, and that child will be scrollable. Regards, - Jeroen -- +--------------------------------------------------------------------------- -+ | Copyright (C) 22:10 06/ 4/2007 Jeroen van der Zijp. All Rights Reserved. | +--------------------------------------------------------------------------- -+ From lyle.johnson at gmail.com Wed Jun 6 10:05:04 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Wed, 6 Jun 2007 09:05:04 -0500 Subject: [fxruby-users] adding text to a running FXApp In-Reply-To: <244914.19256.qm@web82006.mail.mud.yahoo.com> References: <244914.19256.qm@web82006.mail.mud.yahoo.com> Message-ID: On 5/29/07, Tom wrote: > I am trying to write my first Ruby FX App. > I have modified the Babel example to so what I want. > I can append the text in the bottom window by pushing > the button. My app downloads data from a server and > need to do many calculation on it and then display the > results. > I was hoping you can show me how to do this operation. > Remember the data can come at any time so it > needs to be asyncronous of any event. > Here's the modified babel program. > > The Thread didn't work as expected! Sorry for the delayed response, this one slipped through the cracks. Once you call FXApp#run, the application enters the event loop (waiting for events) and doesn't return until the application exits. So in your example, the thread doesn't even get created until the application is done and returns from run(). Take a look at the groupbox.rb example program in the FXRuby distribution; that one creates a thread and it should give you a frame of reference for how to get it working in your program. Hope this helps, Lyle From lyle.johnson at gmail.com Wed Jun 6 12:03:36 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Wed, 6 Jun 2007 11:03:36 -0500 Subject: [fxruby-users] adding text to a running FXApp In-Reply-To: <240543.16390.qm@web82004.mail.mud.yahoo.com> References: <240543.16390.qm@web82004.mail.mud.yahoo.com> Message-ID: On 6/6/07, Tom wrote: > Does this mean if I pass the app variable into the new > Thread, I could get access to all functions and vars > in this new FXWindow class? In *what* new FXWindow class? I don't understand the question. > Also, I don't see app.enableThreads being used, when is this function > call out or used? FXRuby's support for cooperating with Ruby threads is enabled by default, so you don't have to explicitly call enableThreads() unless you've previously called disableThreads(). From lyle.johnson at gmail.com Mon Jun 11 12:51:44 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Mon, 11 Jun 2007 11:51:44 -0500 Subject: [fxruby-users] input.rbw In-Reply-To: <454594.60380.qm@web82012.mail.mud.yahoo.com> References: <454594.60380.qm@web82012.mail.mud.yahoo.com> Message-ID: On 6/11/07, Tom wrote: > I'm trying to understand what type of command you > should enter into the command label. Is it something > like 'dir'? If you inspect the source code for the "inputs.rb" example program, you'll see that the command text is passed verbatim to Ruby's IO.popen() method: @pipe = IO.popen(@cmdInput.text) When I run this program under Windows XP (using the Ruby 1.8.6 one-click installer), I can type (for example) "dir c:\" into the command text field, and press the Enter key, and the directory listing appears in the window above the text field. > I've tried many different commands but they don't > work. Not sure how to advise you on this. I am Cc'ing the mailing list to see if anyone else has a suggestion. > Is there any docs on what each program is supposed to > do? No, they're just short examples. The point of "inputs.rb" is to demonstrate how to use the FXApp#addInput method to listen to an IO (File) object's output. From lyle.johnson at gmail.com Mon Jun 11 13:01:04 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Mon, 11 Jun 2007 12:01:04 -0500 Subject: [fxruby-users] FXRuby app In-Reply-To: <9A154D34BDC9AF40BA0C9EB957E15E74D02021@mlbe2k7.cs.myharris.net> References: <9A154D34BDC9AF40BA0C9EB957E15E74D02021@mlbe2k7.cs.myharris.net> Message-ID: On 6/11/07, Connelly, Stephen wrote: > I'm trying to write some FXRuby code that is similar to a Tcl/Tk example in > John Ousterhout's Tcl/Tk book. This code allows the user to create a "ball > and stick" graph using nodes and edges. The part that is troubling me is > the capability to drag nodes in the canvas. Quick note: FOX's Canvas widget is just a basic drawing area, and is not really anything like the venerable Tk Canvas widget. > I have a start on the FXRuby code that uses some of your > DragDropWindow example. I need to replace the FXWindow.colorType with > something else in order to drag and drop the rectangles that I am using as > nodes. I tried FXWindow.rectType and FXWindow.rectangleType. Neither of > these attempts worked. Perhaps the drag and drop paradigm is not what > should be used here. Can you advise me? The FXWindow.colorType is a built-in, predefined drag type. Generally speaking, you'd need to define your own application-specific drag type for something like a "rectangle" drag type. The "Working with the Clipboard" tutorial talks about how to do this. Having said that, I don't believe that drag and drop is really applicable for what you're trying to do anyways. FOX's drag and drop support primarily facilitates data transfer between windows or applications; it's probably overkill for what you're doing. I think you'd probably want to focus on handling the SEL_LEFTBUTTONPRESS, SEL_LEFTBUTTONRELEASE and SEL_MOTION messages from the FXCanvas to keep track of where the user is "dragging" whatever it is that they clicked on. That of course means that you'll need to do hit testing (to figure out what it is that they clicked on in the first place), etc. Hope this helps, Lyle