gnope php gtk gui gnope.org  

Gnope PHP-Gtk2.dll with GtkSourceView

 
Post new topic   Reply to topic    gnope.org Forum Index -> Announcements
View previous topic :: View next topic  
Author Message
cweiske



Joined: 08 Dec 2005
Posts: 454
Location: Leipzig/Germany

PostPosted: Tue May 23, 2006 1:45 pm    Post subject: Gnope PHP-Gtk2.dll with GtkSourceView Reply with quote

This version is outdated. Please look at http://www.gnope.org/forum/viewtopic.php?p=821

Hello all,

After releasing a new php-gtk2.dll yesterday, I have a new version today. All it does is providing the GtkSourceView extension for Windows! (So if you don't need GtkSourceView, you don't need to upgrade from yesterday)

To install the package, type
Code:
pecl upgrade gnope/Gnope_PHPGtk2_dll

or download the package
and type
Code:
pecl upgrade Gnope_PHPGtk2_dll-1.2.1.tgz


Attention:
To enable the sourceview extension, you need to open the php.ini file (usually in C:\PHP-Gtk2\php.ini) and search for the line
Code:
php-gtk.extensions = php_gtk_libglade2.dll

and replace it with
Code:
php-gtk.extensions = php_gtk_libglade2.dll,php_gtk_sourceview2.dll


Last edited by cweiske on Fri May 26, 2006 11:30 am; edited 1 time in total
Back to top
N!cKY



Joined: 19 Apr 2006
Posts: 12
Location: Mosbach/Germany

PostPosted: Tue May 23, 2006 2:41 pm    Post subject: Reply with quote

there's an error:
http://eaglescripts.de/upload/36.jpg
i could fix that by copying the file "php_gtk_sourceview2.dll" into the c:\windows\system32\ directory and rename it as "gtksourceview.dll".
but then it occurs another error:
http://eaglescripts.de/upload/37.jpg
how to fix that?
Back to top
squirrel



Joined: 02 May 2006
Posts: 10
Location: Switzerland

PostPosted: Wed May 24, 2006 9:21 am    Post subject: Reply with quote

php_gtk_sourceview2.dll is a php-wrapper for gtksourceview. You need to install gtksourceview itsself. Now the problem is to find a windows binary, because the official website http://gtksourceview.sourceforge.net is not providing any prebuild binaries.

I found the following link with a windows binary http://www.haskell.org/hawiki/hIDE_2fWin32. Have a look at point 3 and 4 in the description. These are the files you need:

..\PHP-GTK2\ext\php_gtk_sourceview2.dll (from gnope)
..\PHP-GTK2\gtksourceview.dll (renamed file from original libgtksourceview-1.0-0.dll -> it's version 1.42, current version is 1.6)
..\PHP-GTK2\libgnomeprint-2-2-0.dll

Some code to run a test:
Code:

<?php

$SourceView = new GtkSourceView();

$window = new GtkWindow();
$window->add($SourceView);

$SourceView->set_show_line_numbers(true);

$window->set_default_size(800,600);
$window->show_all();

$window->connect_simple('destroy', array('Gtk', 'main_quit'));
gtk::main();

?>


For me it works right now. Hopefully someone else will provide a current binary.
Back to top
cweiske



Joined: 08 Dec 2005
Posts: 454
Location: Leipzig/Germany

PostPosted: Wed May 24, 2006 10:37 am    Post subject: Reply with quote

Sorry guys, I forgot the gtksourceview.dll file. Will fix that this evening
Back to top
squirrel



Joined: 02 May 2006
Posts: 10
Location: Switzerland

PostPosted: Fri May 26, 2006 10:30 am    Post subject: Reply with quote

Thanks for your update.

But, there is just another question: where do I have to place the folder "\language-specs" from gtksourceview to load a language?

The following code is not returning any languages
Code:
$lm = new GtkSourceLanguagesManager();
var_dump($lm->get_property('lang-files-dirs'));
var_dump($lm->get_available_languages());

and the following code is giving an error
Code:
$lm = new GtkSourceLanguagesManager();
$dirs = 'language_specs';
$lm->set_property('lang-files-dirs', $dirs);
Quote:
(sourceview.phpw2:492): GLib-GObject-WARNING **: g_object_set_property: construct property "lang-files-dirs" for object `GtkSourceLanguagesManager' can't be set after construction
Back to top
cweiske



Joined: 08 Dec 2005
Posts: 454
Location: Leipzig/Germany

PostPosted: Fri May 26, 2006 1:54 pm    Post subject: Reply with quote

On windows, the path to the sourceview language files is either
Code:
C:\Documents and Settings\username\.gnome2\gtksourceview-1.0\language-specs

or
Code:
C:\gtksourceview-1.0\language-specs\
.

The first one is better IMO, although it's really bad that it can't be in the PHP-Gtk2\ext directory..

Btw, I used Sysinternal's FileMon to find out which directories are accessed.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    gnope.org Forum Index -> Announcements All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Templates enhanced by DigiWiki. Hosting by Tradebit.