[Gtk-sharp-list] Vte# and OnButtonPress
P.-A.
chez.pa at gmail.com
Fri Jan 13 18:50:02 EST 2006
Hi everyone,
I'm trying to get mouse events working on vte# but I can't. I must be
wrong somewhere.
I've tried with and without Gtk.EventBox and both didn't work. So I
took a look at Tilda source code - http://tilda.sf.net - and even if I
don't know C, it seems that Tilda just use the ButtonPressEvent event.
/* Connect to the "button-press" event. */
g_signal_connect (G_OBJECT(tt->vte_term), "button-press-event",
G_CALLBACK(button_pressed), t_collect);
In the following source code, I thought the line
terminal.ButtonPressEvent += new ButtonPressEventHandler (exitbutton_event);
does the same.
Am I wrong somewhere?
Thanks you.
Here my test class
public class test {
static void delete_event (object obj, DeleteEventArgs args)
{
Application.Quit();
}
static void exitbutton_event (object obj, ButtonPressEventArgs args)
{
Application.Quit();
}
public static void Main (string[] args)
{
Gtk.Window window;
EventBox eventbox;
Vte.Terminal terminal;
Application.Init();
window = new Gtk.Window ("Eventbox");
window.DeleteEvent += new DeleteEventHandler (delete_event);
window.BorderWidth = 10;
eventbox = new EventBox ();
// window.Add (eventbox);
// eventbox.Show();
terminal = new Vte.Terminal();
window.Add (terminal);
//eventbox.Add(terminal);
terminal.Show();
terminal.SetSizeRequest(110, 20);
terminal.ButtonPressEvent += new ButtonPressEventHandler (exitbutton_event);
//eventbox.ButtonPressEvent += new ButtonPressEventHandler
(exitbutton_event);
//eventbox.Realize();
window.Show();
Application.Run();
}
}
More information about the Gtk-sharp-list
mailing list