Re: [gtk-list] Re: Gtk--: Trouble with CList event _imp functions
- From: RNG <r gasch chello nl>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: Gtk--: Trouble with CList event _imp functions
- Date: Sun, 10 Oct 1999 23:51:20 +0200
Thanks a lot ... I'll give it a try ...
--> R
On Sun, 10 Oct 1999, Dermot Musgrove wrote:
> RNG wrote:
> >
> [...]
> > I want to bind a popup menu to my clist which is activated by the left
> > mouse button. So far so good. But the button_press_event_impl method
> > receives a GdkEventButton * as it's only parameter.
> >
> > Given the GdkEventButton argument, how can I determine which row and
> > column the user actually clicked on?
>
> Hi, in perl I use something like this.
> ----------------8<-------------
> my $sel = $ctree->selection;
> if ($e->{'button'} == 3) {
> my $menu = new menu1;
> $menu->TOPLEVEL->popup(undef, undef, 0, 0);
> } else {
> ($row, $col) = $ctree->get_selection_info($e->{'x'}, $e->{'y'});
> if ($sel) {
> print "We have a selection\n";
> }
> print "We have clicked on '".$ctree->get_text($row, $col)."'\n";
> print "Event was caused by button $e->{'button'}\n";
> }
> ----------------8<-------------
> menu1 is a perl class that constructs a popup menu and has method TOPLEVEL
> that returns the toplevel widget, surprisingly.
>
> HTH, Dermot
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]