Re: PHP-GTK 2 update

From: Date: Mon, 07 Mar 2005 19:11:51 +0000
Subject: Re: PHP-GTK 2 update
References: 1 2 3 4  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-5598@lists.php.net to get a copy of this message
<?php dl('php_gtk2.so'); $window = new GtkWindow; $window->connect_object('destroy', array('gtk', 'main_quit')); $window->set_size_request(500, 500): $window->show_all(); gtk::main(); ?> When you emit the destroy signal error violation ocurred El lun, 07-03-2005 a las 19:11, Andrei Zmievski escribió: > Please send me a short piece of code that reproduces this issue. > > -Andrei > > On Mar 7, 2005, at 5:45 AM, Ivan Rodriguez wrote: > > > Hi > > > > I have been testing some with php-gtk2 and is fantastic, the new > > widgets: GtkFileChooserWidget, GtkTextView, GtkTreeView, ... the new > > method of GtkLabel set_markup and other things, there is a problem, > > when I do connect_object gives back a "Violación de segmento" > > Violation of segment, by the other whole works perfectly. > > > > Regards > > > > P.D.: I will continue testing to see that so the rest works > > > > > > On Mon, 7 Mar 2005 08:17:42 +0100, Ivan Rodriguez > > <epplestun@gmail.com> wrote: > >> Andrei!!! This is incredible, an excellent work, as soon as it leaves > >> the stable version Php-gtk will be the boom of the technology of > >> development of desktop applications. > >> > >> Congratulations :-) > >> > >> > >> On Sat, 5 Mar 2005 14:29:58 -0800, Andrei Zmievski > >> <andrei@gravitonic.com> wrote: > >>> For those of you wondering, the current CVS version of PHP-GTK can > >>> run > >>> fairly complex scripts, such as this one. > >>> > >>> <?php > >>> > >>> error_reporting(E_ALL); > >>> > >>> if ($argc < 2) > >>> die("\nUsage: php -q gdk_pixbuf.php <imagefile>\n\n"); > >>> > >>> $image_file = $argv[1]; > >>> > >>> $window = new GtkWindow(); > >>> $window->set_border_width(5); > >>> $window->set_title('GdkPixbuf example'); > >>> $window->set_resizable(false); > >>> $window->connect_object('destroy', array('gtk', > >>> 'main_quit')); > >>> > >>> try { > >>> $pixbuf = GdkPixbuf::new_from_file($image_file); > >>> } catch (PhpGtkGErrorException $e) { > >>> die($e->message . "\n"); > >>> } > >>> > >>> $font = new GdkFont("-*-helvetica-bold-r-*-*-*-120-*-*-*-*-*-*"); > >>> $extents = $font->extents($image_file); > >>> > >>> $area = new GtkDrawingArea(); > >>> $area->set_size_request($pixbuf->get_width(), $pixbuf->get_height()); > >>> $frame = new GtkFrame(); > >>> $frame->add($area); > >>> $frame->set_shadow_type(Gtk::SHADOW_IN); > >>> $window->add($frame); > >>> > >>> $layout = $window->create_pango_layout(basename($image_file) . > >>> > >>> "\n\xd0\x90\xd0\xbd\xd0\xb4\xd1\x80\xd0\xb5\xd0\xb9"); > >>> $fontdesc = new PangoFontDescription('Arial,Helvetica 14'); > >>> $layout->set_font_description($fontdesc); > >>> list(, $extents) = $layout->get_pixel_extents(); > >>> > >>> $area->connect('expose_event', 'expose_event', $pixbuf, > >>> $layout, > >>> $extents); > >>> > >>> $window->show_all(); > >>> > >>> gtk::main(); > >>> > >>> function expose_event($area, $event, $pixbuf, $layout, $extents) > >>> { > >>> > >>> $area->window->draw_pixbuf($area->style->fg_gc[Gtk::STATE_NORMAL], > >>> $pixbuf, > >>> > >>> $event->area->x, $event->area->y, > >>> > >>> $event->area->x, $event->area->y); > >>> > >>> if ($event->area->x < $extents[0] + 3 && > >>> $event->area->y < $extents[1] + 3) { > >>> $area->window->draw_layout($area->style->white_gc, > >>> 3, 3, $layout); > >>> $area->window->draw_layout($area->style->black_gc, > >>> 2, 2, $layout); > >>> } > >>> } > >>> > >>> ?> > >>> > >>> -Andrei > >>> > >>> -- > >>> PHP-GTK General Mailing List (http://gtk.php.net/) > >>> To unsubscribe, visit: http://www.php.net/unsub.php > >>> > >>> > >>> > >> -- Ivan Rodriguez <epplestun@gmail.com>

« previous php.gtk.general (#5598) next »