#49907 [Opn->Fbk]: PHP Gtk2 Widget can_default is undefined
| From: | auroraeosrose@php.net | Date: | Sun, 18 Oct 2009 14:08:13 +0000 |
| Subject: | #49907 [Opn->Fbk]: PHP Gtk2 Widget can_default is undefined | ||
| References: | 1 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-4362@lists.php.net to get a copy of this message | ||
ID: 49907
Updated by: auroraeosrose@php.net
Reported By: chezmmd at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: PHP-GTK related
Operating System: WinXP
PHP Version: 5.2.11
New Comment:
Is this with 2.0.1 or an SVN version of PHP-GTK?
Also what version of gtk is on your system? If you're using gtk 2.16
or 2.18 I HIGHLY recommend you upgrade to an svn version of php-gtk -
all the can-default stuff has now been wrapped properly (so you set
can-default to true and then grab)
Thanks!
Previous Comments:
------------------------------------------------------------------------
[2009-10-17 08:05:57] chezmmd at gmail dot com
Description:
------------
Unable to get GtkEntry to have focus after user selects a row in
GtkTreeView on same screen w/o a grab_default. Widget->grab_default
causes GtkCritical error w/o can_default (php.exe:2020 Gtk-CRITICAL
gtk_widget_grab_default: assertion 'GTK_WIDGET_CAN_DEFAULT'(widget)
failed. Widget->can_default causes PHP fatal error and crash.
Reproduce code:
---------------
<?php
$button1 = new GtkButton('Default Test');
$button2 = new GtkButton('Extra Button');
$button2->can_default(TRUE);
$vbox = new GtkVBox;
$vbox->pack_start($button1, FALSE, FALSE);
$vbox->pack_start($button2, FALSE, FALSE);
$window = new GtkWindow;
$window->connect_simple('destroy', array('gtk', 'main_quit'));
$window->set_default_size(120,120);
$window->add($vbox);
$window->show_all();
$button2->grab_focus();
$button2->grab_default();
Gtk::main();
?>
Expected result:
----------------
Button has keyboard focus and no critical error for can_default
property.
Actual result:
--------------
application crash.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49907&edit=1