Forum: Ruby-Gnome 2 Ruby app using svg under win32

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Marco Milanesi (Guest)
on 2006-05-31 23:25
(Received via mailing list)
hi,

	I'm very new to ruby, so I'm writing this email to just ask the
doability of this project in ruby with ruby/gtk2 bindings.

I need to make this app that loads an svg (a planimetry of a building)
file and displays into a window. Then I have to trap mouse position and
popup a window with another svg (schematics of a tool) when the user
clicks on predefined zones of the building.

all this project has to work inside a cdrom, a friend of mine suggested
to me to prepare with one click ruby installer a setup.exe and install
it on the cdrom.

ok, that's enough!

could you suggest to me if this thing is doable and if there are little
tutorials regarding svg handling or already ruby apps that are doing
similar tasks?

thanks! :)

ciao,
Marco

--
 ,= ,-_-. =.
((_/)o o(\_)) 
jabber:removed_email_address@domain.invalid/msn:removed_email_address@domain.invalid
 `-'(. .)`-'		       #removed_email_address@domain.invalid
     \_/        There's no one inside that flat, everybody knows it


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications
in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521...
Detlef R. (Guest)
on 2006-06-01 00:02
(Received via mailing list)
On Mi, 2006-05-31 at 21:23 +0200, Marco Milanesi wrote:
> all this project has to work inside a cdrom, a friend of mine suggested
> to me to prepare with one click ruby installer a setup.exe and install
> it on the cdrom.
>

hi,

if you only want to do the described (a kind of "svg-kiosk-thing"), the
easiest way is completely without ruby. just use a svg-capable
webbrowser like mozilla and a little bit of javascript for the mouse
tracking.

if you need additional components i would suggest to use gtk-moz-embed
for the display of the svg. to implement a svg render engine on your own
is a _very big_ task. just take a look at the svg-specs at
http://www.w3.org/TR/SVG11/ .

cheers
detlef

>
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications
in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521...
Marco Milanesi (Guest)
on 2006-06-01 00:05
(Received via mailing list)
hi detlef,

> if you only want to do the described (a kind of "svg-kiosk-thing"), the
> easiest way is completely without ruby. just use a svg-capable
> webbrowser like mozilla and a little bit of javascript for the mouse
> tracking.

yeah, that could be a solution. I haven't thought about that. The
problem is that it has to work also in IE :/

> if you need additional components i would suggest to use gtk-moz-embed
> for the display of the svg. to implement a svg render engine on your own
> is a _very big_ task. just take a look at the svg-specs at
> http://www.w3.org/TR/SVG11/ .

yeah, I was hoping in something like this! so the ruby binding of
Gtk::MozEmbed could make the task? or is better to go c in your opinion?

thanks a lot for the tips, I appreciate :)

ciao,
Marco

--
 ,= ,-_-. =.
((_/)o o(\_)) 
jabber:removed_email_address@domain.invalid/msn:removed_email_address@domain.invalid
 `-'(. .)`-'		       #removed_email_address@domain.invalid
     \_/        There's no one inside that flat, everybody knows it


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications
in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521...
Detlef R. (Guest)
on 2006-06-01 00:36
(Received via mailing list)
On Mi, 2006-05-31 at 22:04 +0200, Marco Milanesi wrote:
> hi detlef,
>
> > if you only want to do the described (a kind of "svg-kiosk-thing"), the
> > easiest way is completely without ruby. just use a svg-capable
> > webbrowser like mozilla and a little bit of javascript for the mouse
> > tracking.
>
> yeah, that could be a solution. I haven't thought about that. The
> problem is that it has to work also in IE :/
>
you wrote, that you have to start it from cd. afaik you also can start
programs direkt from cd (sorry, don't know windoze). so just put the
browser on the cd and start it via autostart.

> > if you need additional components i would suggest to use gtk-moz-embed
> > for the display of the svg. to implement a svg render engine on your own
> > is a _very big_ task. just take a look at the svg-specs at
> > http://www.w3.org/TR/SVG11/ .
>
> yeah, I was hoping in something like this! so the ruby binding of
> Gtk::MozEmbed could make the task? or is better to go c in your opinion?
>
i never used gtk-moz-embed on my own, but mozilla can display svg and
the use of ruby-gnome is very easy. after all, it is much easier as to
write it all in c. from the performance point, its also no problem (as
long as you don't want to generate the svg's on the fly in ruby) cause
the main task of rendering the svg is done by mozilla and therefor
implemented in c(++?).



> thanks a lot for the tips, I appreciate :)
>
> ciao,
> Marco
>



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications
in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521...
Marco Milanesi (Guest)
on 2006-06-01 00:49
(Received via mailing list)
> > yeah, that could be a solution. I haven't thought about that. The
> > problem is that it has to work also in IE :/
> you wrote, that you have to start it from cd. afaik you also can start
> programs direkt from cd (sorry, don't know windoze). so just put the
> browser on the cd and start it via autostart.

me too (for the windows part). that's an idea, maybe I will have much
more fun with ruby though. I'll evaluate.

> > yeah, I was hoping in something like this! so the ruby binding of
> > Gtk::MozEmbed could make the task? or is better to go c in your opinion?
> i never used gtk-moz-embed on my own, but mozilla can display svg and
> the use of ruby-gnome is very easy. after all, it is much easier as to
> write it all in c. from the performance point, its also no problem (as
> long as you don't want to generate the svg's on the fly in ruby) cause
> the main task of rendering the svg is done by mozilla and therefor
> implemented in c(++?).

nono, only render the svg. ok, thanks a lot. now I have more useful
informations about this work.

ciao,
Marco

PS: thanks detlef. you have the same name of a character of the
movie/book Christiane F. - Wir Kinder vom Bahnhof Zoo, nice :)

--
 ,= ,-_-. =.
((_/)o o(\_)) 
jabber:removed_email_address@domain.invalid/msn:removed_email_address@domain.invalid
 `-'(. .)`-'		       #removed_email_address@domain.invalid
     \_/        There's no one inside that flat, everybody knows it


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications
in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521...
Marco Milanesi (Guest)
on 2006-06-01 04:36
(Received via mailing list)
for the record I succeded by looking at the examples to load an svg and
display it, here is the source:

require 'rsvg2'
require 'gtk2'

Gtk.init

gdk_pixbuf = RSVG.pixbuf_from_file("./mysvg.svg")

Gtk::Window.new.add(Gtk::Image.new(gdk_pixbuf)).show_all

Gtk.main

hope will be a start for a beautiful program :)
nite all

ciao,
Marco

--
 ,= ,-_-. =.
((_/)o o(\_)) 
jabber:removed_email_address@domain.invalid/msn:removed_email_address@domain.invalid
 `-'(. .)`-'		       #removed_email_address@domain.invalid
     \_/        There's no one inside that flat, everybody knows it


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications
in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521...
Gergely K. (Guest)
on 2006-06-01 21:54
(Received via mailing list)
Marco Milanesi azt írta, hogy:
> require 'rsvg2'
> require 'gtk2'
>
> Gtk.init
>
> gdk_pixbuf = RSVG.pixbuf_from_file("./mysvg.svg")
>
> Gtk::Window.new.add(Gtk::Image.new(gdk_pixbuf)).show_all
>
> Gtk.main

And is it easy to put on a CD? (there is a not so easy explanation on
the site to make a ruby executable...)

Gergo
Marco Milanesi (Guest)
on 2006-06-02 01:35
(Received via mailing list)
> And is it easy to put on a CD? (there is a not so easy explanation on
> the site to make a ruby executable...)

I don't know yet, when I succeed to run it under windows I'll post (If I
remember!) how I have done. Basically I predict that I'll have to cross
compile or compile under win (emulated yes) the required bindings/

ciao,
Marco

--
 ,= ,-_-. =.
((_/)o o(\_)) 
jabber:removed_email_address@domain.invalid/msn:removed_email_address@domain.invalid
 `-'(. .)`-'		       #removed_email_address@domain.invalid
     \_/        There's no one inside that flat, everybody knows it


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications
in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521...
This topic is locked and can not be replied to.