gtk widget events (was: gtk_widget_set_name)
- From: "Riswick, J.G.A. van" <J G A v Riswick tue nl>
- To: "'Dermot Musgrove '" <dermot glade perl connectfree co uk>, "Riswick, J.G.A. van" <J G A v Riswick tue nl>
- Cc: "''gtk-perl-list gnome org' '" <gtk-perl-list gnome org>
- Subject: gtk widget events (was: gtk_widget_set_name)
- Date: Mon, 27 May 2002 00:09:40 +0200
HI!
Yes you are right, thanks. In the meantime, I managed
to locate the manpage (Gtk::reference) and also found it
there.
Some time ago, I wrote a gtk program and now I'm trying
to convert it to gtk-perl. I stumbeled upon something that
I can't get to work. In my gtk program I connected a signal
handler to a drawing area like this:
gtk_signal_connect
(GTK_OBJECT(drawingarea), "event",
(GtkSignalFunc)area_event, (gpointer)drawingarea);
Now I'm trying to do the same using gtk-perl (sample below). The
callback function seems to get called, but filtering out the
button_press event doesn't work. does anyone know what I'm doing
wrong?
jos
---------
#!/usr/bin/perl -w
use Gtk;
init Gtk;
$win = new Gtk::Window;
$win->set_usize(300,200);
$win->show_all;
$drawingarea = new Gtk::DrawingArea();
$drawingarea->show();
$win->add($drawingarea);
$drawingarea->signal_connect('event' , \&cb );
sub cb {
my ( $widget, $data, $event ) = @_;
if ( ( defined( $event->{'type'} ) ) and
( $event->{'type'} eq 'button_press' ) )
{
$win->set_title('right');
if ( $event->{'button'} == 3 )
{
$win->set_title('right');
}
else
{
$win->set_title('left');
}
}
return 0;
}
main Gtk;
-----Original Message-----
From: Dermot Musgrove
To: Riswick, J.G.A. van
Cc: 'gtk-perl-list gnome org'
Sent: 5/26/2002 6:38 PM
Subject: Re: gtk_widget_set_name
"Riswick, J.G.A. van" wrote:
HI
Is it possible to access the function gtk_widget_set_name()
using gtk-perl? This lets the user link styles in the gtkrc
file to a widget.
Hi, I reckon so - Gtk::Widget->set_name() so for instance:
$clist->set_name('New name');
regards, Dermot
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]