From: Lyle Johnson Date: 2002-03-26T06:59:46+09:00 Subject: Re: FXDCWindow, event, screen... > - I don't exactly understand the use of FXDC or FXDCWindow. > I saw FXDCWindow.new(canvas) and FXDCWindow.new(canvas, event), but > FXDCWindow.html (in fox-api's doc) doesn't explain the constructor's > parameters. The two-argument constructor for FXDCWindow (where you pass an FXEvent as the second argument) clips any drawing commands against the event's "expose" rectangle. So, for example, if you're handling a SEL_PAINT message (which is generated by FOX when part or all of a window is "exposed") you'd want to use this constructor. If you're doing some drawing outside of one of these SEL_PAINT events, or for whatever other reasons you don't want the drawing to be clipped against this rectangle, you can just use the one-argument constructor for FXDCWindow and draw all over the thing. > - I want to get screen parameters (width & height, colors, ...) from a ruby > program, but I don't know where to look at... By "screen", do you mean the entire desktop? If so, you may be able to use the FXRootWindow class to get some of this information, e.g. rootWindow = getApp().root puts "root window width = #{rootWindow.width}, height = #{rootWindow.height}" > - I'd like to understand how does a ".connect" run when an event happens. This page: http://fxruby.sourceforge.net/doc/events.html from the FXRuby documentation describes how to use connect() to connect events generated by widgets to code blocks (or methods). For some more background you might also check out the documentation on FOX's target-message system: http://www.fox-toolkit.org/messages.html Hope this helps, Lyle