before I say anything else, I’d like to take this oppertunity to say hi
to everyone (at least all who’ll read this) since I’m new here.
now on to business!
here’s the thing:
I’m quite new to ruby and newer still to gtk (not a promising combo, but
hey… we all have to start somewhere, right? … right??) so my
knowledge of the gtk api isn’t all that good.
what I’m trying to do is basically this:
I’d like to make an application that would (among other things) take an
image file (let’s say the image is some sort of a map) and display it,
and allow the user to add markings to it (kind of like wikimapia does,
for instance)
so basically you click on the image, and a dialog prompts you for
certain information that you wish to associate with that locations, and
once that’s done, that location gets that little rectangle thingy that
signifies that it’s marked. and somewhere on the side there’s a list of
all those markings.
now the problem is that, like I said, I’m not that familiar with gtk api
so I don’t know how to do that and which widgets and objects to use.
(for that map and mark thing)
any kind of help and/or suggestion would be greatly appriciated
now the problem is that, like I said, I’m not that familiar with gtk api
so I don’t know how to do that and which widgets and objects to use.
(for that map and mark thing)
any kind of help and/or suggestion would be greatly appriciated
There are two answers:
tell you what widgets and objects to use. Quite fast for you but not
necessarily for me, and doesn’t teach you much about gtk overall big
picture, way of doing things, etc.
suggest you to read a gtk tutorial. Quite fast for me but not for
you, but will teach you a lot on gtk, so pretty good in the mid/long
term.
For something like this, you’d be better off looking at the goocanvas
API and examples. I’ve done something similar in the past, and
goocanvas is going to take care of a lot of the gruntwork for you vs.
doing it by hand as you have below.
Check out the API (unfortunately not published on the Hiki as it’s
experimental at the momoment), but it’s similar in spirit to the
GnomeCanvas library (which is there). If you pull the full source
package, you can see the examples which will help get you going (but you
might have to build it yourself–not sure as I haven’t worked with it
since it’s been included in the full distribution.
HTH,
ast
On Thu, 2009-01-29 at 10:43 +0200, Dobai-Pataky Bálint wrote:
hey… we all have to start somewhere, right? … right??) so my
signifies that it’s marked. and somewhere on the side there’s a list of
w.signal_connect(“destroy”){Gtk.main_quit}
pc=c
that goocanvas just hit the spot. I checked it out and tried it out a
bit and it seems like it just might be perfect for what I need.
as for that tutorial, I will check it out (eventually :P)
the thing is that I did work with gtk before a little,
so I’m not completely clueless about it, as I might have made myself
look.
it would seem that I declued myself a bit too much haha
(oh look, I just made up a new word… silly me)
anyways,
once again, thank you all, your help is much appreciated!
I will be sure to ask something when I get stuck again!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.