Ruby Forum Ruby-Gnome 2 > Re: Get action back from Gtkmozembed

Posted by Daniel Lucraft (Guest)
on 06.05.2008 20:15
(Received via mailing list)
I haven't tested this, but it should work.

Suppose that you put your textbox and button in an HTML form with a GET 
action:

<form name="input" action="html_form_action.html" method="get">
  Username: <input type="text" name="user">
  <input type="submit" value="Submit">
</form>When the user fills out the form and clicks submit, GtkMozembed 
will try to open the url "html_form_action.html?user=dan".

So in your code, set up a handler for the 'open_uri' signal and examine 
the url that the user is trying to open. If it looks like 
"html_form_action.html?user=XXX" then handle the signal yourself, 
extract the XXX and use the data however you want.

Dan

----- Original Message ----
From: Diego Bernardes <ruby-forum-incoming@andreas-s.net>
To: ruby-gnome2-devel-en@lists.sourceforge.net
Sent: Tuesday, May 6, 2008 5:01:10 PM
Subject: [ruby-gnome2-devel-en] Get action back from Gtkmozembed

Hi guys,

If i use Gtkmozembed without a webserver, using it with just ruby and a
template library, if i make a textinput or button or anything, how can i
read back the data? anyone have a suggestion?
--
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
ruby-gnome2-devel-en@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en
Posted by Diego Bernardes (di3go)
on 07.05.2008 06:00
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