[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[Newbie] Use FXRuby to move an image on a canvas?

Einar Buffer

1/21/2005 8:51:00 AM

Hi,

As a learning exercise, I'm planning on writing a simple card game in Ruby,
using FXRuby for graphics. I'd like the user to be able to grab a card using
the mouse, and move it to a new location. Is that supported by FXRuby at the
moment? In the FXRuby User's Guide online, it seems that the functionality
I'm talking about is on the to-do list, but is that up to date? And finally,
if it's not supported - have any of you implemented such a widget e.g. in
C++ and used it in FXRuby? Is that hard to do?

Kind regards,
Einar

--
"If it was so, it might be; and if it were so, it would be; but as it isn't,
it ain't. That's logic" -- Lewis Carroll


4 Answers

Lyle Johnson

1/21/2005 3:33:00 PM

0

On Fri, 21 Jan 2005 17:50:58 +0900, Einar Buffer <ebuffer@hotmail.com> wrote:

> As a learning exercise, I'm planning on writing a simple card game in Ruby,
> using FXRuby for graphics. I'd like the user to be able to grab a card using
> the mouse, and move it to a new location. Is that supported by FXRuby at the
> moment? In the FXRuby User's Guide online, it seems that the functionality
> I'm talking about is on the to-do list, but is that up to date? And finally,
> if it's not supported - have any of you implemented such a widget e.g. in
> C++ and used it in FXRuby? Is that hard to do?

There is no such widget in FXRuby at this time, and I'm not aware that
anyone's written one. If you get any leads on this I'd like to hear
about it!


Shashank Date

1/21/2005 4:02:00 PM

0

Hi,

--- Lyle Johnson <lyle.johnson@gmail.com> wrote:

> On Fri, 21 Jan 2005 17:50:58 +0900, Einar Buffer
> <ebuffer@hotmail.com> wrote:
>
> > As a learning exercise, I'm planning on writing a
> > simple card game in Ruby, using FXRuby for
> > graphics.

<snip>

> There is no such widget in FXRuby at this time, and
> I'm not aware that anyone's written one.

May be I am over simplifying this, but can we not get
something like this to work using the bounce.rbw
sample that comes with the FXRuby samples and adding
the ability to track the mouse motion. I remember
having taking inspiration from the bounce.rbw and
scribble.rbw and writing a similar app in wxRuby. It
was not hard and I can dig out the code for you if
required.

Thanks,
-- shanko

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail...


Martin DeMello

1/22/2005 9:15:00 AM

0

Lyle Johnson <lyle.johnson@gmail.com> wrote:
> On Fri, 21 Jan 2005 17:50:58 +0900, Einar Buffer <ebuffer@hotmail.com> wrote:
>
> > As a learning exercise, I'm planning on writing a simple card game in Ruby,
> > using FXRuby for graphics. I'd like the user to be able to grab a card using
> > the mouse, and move it to a new location. Is that supported by FXRuby at the
> > moment? In the FXRuby User's Guide online, it seems that the functionality
> > I'm talking about is on the to-do list, but is that up to date? And finally,
> > if it's not supported - have any of you implemented such a widget e.g. in
> > C++ and used it in FXRuby? Is that hard to do?
>
> There is no such widget in FXRuby at this time, and I'm not aware that
> anyone's written one. If you get any leads on this I'd like to hear
> about it!

I don't know why frameworks after Tk haven't embraced the desperately
useful concept of a vecotr canvas :( I really miss it when using Fox -
sadly, the rest of Tk is fairly ugly, but if I'm doing a
canvas-intensive app, it's really the best option.

martin

Joel VanderWerf

1/22/2005 8:10:00 PM

0

Martin DeMello wrote:
> I don't know why frameworks after Tk haven't embraced the desperately
> useful concept of a vecotr canvas :( I really miss it when using Fox -
> sadly, the rest of Tk is fairly ugly, but if I'm doing a
> canvas-intensive app, it's really the best option.

Ditto. It's the one part of Tk I miss. I wonder how hard it would be to
port.