hi, everyone
is there anybody who knows how to send a key to the gtkmozembed widget ?
what I am intending to do is programmablly scroll up/down window by line or
page.
my programme is based entirely on
mozilla/embedding/browser/gtk/tests/TestGtkEmbed.cpp.
until now gtk_widget_event() has been used, but it does not  work except for
some cases that focus
is right on the  gtkmozembed widget.

the following is exactly the code fragment copied from my programme

send_key(GtkMozEmbed *embed, gint keyval )
{
 GtkWidget   *wid = embed->bin.child;
 GdkEventKey key;
  if( !wid )return;
  memset( &key, 0, sizeof( key ) );
  //key.send_event = TRUE;
  key.type = GDK_KEY_PRESS;
 // key.time = time( 0 );
   key.window = wid->window;
  //key.state = GDK_KEY_PRESS_MASK;
  key.keyval = keyval;
   gtk_widget_event( wid, ( GdkEvent * )&key );
}

any helpwill be greatly appriciated.
thanks in advance

yangxl



Reply via email to