Re: [PHP-GTK] How to disconnect an event?
[email protected] (Bob Majdak Jr)
| Newsgroups | php.gtk.general |
|---|---|
| Organization | KateOS |
| Message-ID | <[email protected]> |
Was pointed out to me that maybe I should recreate the actual circumstances.
Here is a code snip applying disconnect to the eventbox and it works fine here,
using PHP-GTK2 from CVS (latest) though. code: http://p.opsat.net/v/16j/33
- Bob.
Bob Majdak Jr wrote:
> the following code gives an example and works fine for me. without the
> disconnect there would be spam in the console every time a keyboard is
> pushed while the window has focus.
>
> <?php
>
> function quick_test($w,$e) {
> print_r($e);
> return;
> }
>
> $w = new GtkWindow;
> $w->connect_simple('delete-event',array('Gtk','main_quit'));
>
> $signal = $w->connect('key-press-event','quick_test');
> $w->disconnect($signal);
>
> $w->show_all();
>
> Gtk::main();
>
> ?>
>
> ManarKh wrote:
>> Hello, :)
>>
>> I have an application in which i connect a gtkeventbox to a function.
>> $handler_id = EventBox->connect('button-press-event', array($this,
>> 'function'));
>> Then at later stage i need to disconnect it using
>> disconnect($handler_id);
>> but it's not working. Anyone knows a way to disconnect an event from
>> gtkeventbox?
>>
>> Regards,
>> Manar
>
--
Bob Majdak Jr
KateOS Rofflecopter Pilot
http://www.kateos.org