Re: [Fxruby-users] Newbie question about making own drawables
Status: Inactive
Brought to you by:
lyle
From: Lyle J. <jl...@cf...> - 2003-11-24 15:38:43
|
Fredrik Jagenheim wrote: > I want to make something that's pretty simple. I want to have a couple > of objects drawn on a canvas. These objects should be event-aware, so > I get notified if they're clicked, dragged or otherwise manipulated. Good, I think you will get a lot of people interested in the final product (including me ;) > But I can't even figure out which FX object to inherit from. Neither > 'FXDrawable' or 'FXImage' implements the 'connect' method. Right, the only objects that implement connect() are those that have a message target, namely, subclasses of FXWindow and FXDataTarget. I suspect that in your case you'll want to start out with the FXCanvas object (which is showcased in the scribble.rb example program) and work from that. > And since I can't even get to know when SEL_PAINT is requested, I > don't know how I can get to know if a key has been pressed from > SEL_KEYPRESSED. If the question is "when are SEL_PAINT messages sent", it's whenever part (or all) of a window is exposed and needs to be repainted. > I guess my lack of knowledge of how to program GUI is the major > culprit here, but could someone please point me to some documents > which could help me out? The stuff I find on FXRuby seems to assume > that I already know Fox and the document on Fox assumes that I'm using > C++, although I'd suppose it's pretty easy to translate into Ruby? The three primary sources for FOX documentation are the two sites you mentioned (the FOX home page at http://www.fox-toolkit.org and the FXRuby home page at http://www.fxruby.org) as well as the FOX Community Wiki site, found here: http://fifthplanet.net Hope this helps, Lyle |