This displays the form I included last time, and prints the username
when the form is submitted:
#------------------
require ‘gtk2’
require ‘gtkmozembed’
(window = Gtk::Window.new).signal_connect(“destroy”) {Gtk.main_quit}
gecko = Gtk::MozEmbed.new
window.add(gecko).show_all
form=<<END
Username: ENDgecko.open_stream “file:///”, “text/html”
gecko.append_data form
gecko.close_stream
gecko.signal_connect “open_uri” do |_, uri|
because form method was ‘get’ parameters are encoded into url:
uri =~ /file:///html_form_action.html?user=(.*)/
username = $1
puts “username from gecko: ‘#{username}’”
true # ← tells gecko not to open this url.
end
Gtk.main
#----------------
best
Dan
----- Original Message ----
From: Diego B. [email protected]
To: [email protected]
Sent: Wednesday, May 7, 2008 5:00:34 AM
Subject: Re: [ruby-gnome2-devel-en] Get action back from Gtkmozembed
I have no idea how to do this, i tried some codes and none worked, i
dont know well how to work with http >.< need some help
this is the code im using to render the data, mab is a markup generated
from markaby
(window = Gtk::Window.new).signal_connect(“destroy”) {Gtk.main_quit}
gecko = Gtk::MozEmbed.new
window.add(gecko).show_all
gecko.open_stream “file:///”, “text/html”
gecko.append_data “#{mab}”
gecko.close_stream
Gtk.main
Posted via http://www.ruby-forum.com/.
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don’t miss this year’s exciting event. There’s still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
ruby-gnome2-devel-en mailing list
[email protected]