gnope php gtk gui gnope.org  

New to PHP-GTK

 
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners
View previous topic :: View next topic  
Author Message
aaron



Joined: 14 May 2006
Posts: 1
Location: Malaysia

PostPosted: Sun May 14, 2006 5:19 am    Post subject: New to PHP-GTK Reply with quote

Hi,

I'm a beginner PHP developer and came across PHP-GTK as an extension of PHP.
I would like to know is there anyway I can use PHP-GTK to interface with PC's parallel port or USB port?
How about using MySQL with PHP-GTK?
How well is PHP-GTK in big development such as Accounting System?
As I already have some knowledge in PHP, I would prefer PHP-GTK then others if PHP-GTK is abled to develop big scale application.
Thanks.

Aaron
Back to top
cweiske



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

PostPosted: Sun May 14, 2006 8:17 am    Post subject: Reply with quote

Aaron,

All the modules you can use with PHP can be used with PHP-Gtk. PHP-Gtk itself is just a module for PHP, so PHP sets the limits.

Personally I have no idea how to communicate with an USB or parallel port, especially if you're on Windows. Perhaps other people.

I personally have developed some larger scale projects with both PHP-Gtk and PHP-Gtk2. You just have to remember that PHP-Gtk2 has not even released an Alpha version (but should be due to soon) but looks much better than PHP-Gtk1.
PHp-Gtk1 is stable, but looks ugly and you can't destruct object which means that your memory will fill up after some days or weeks.
Back to top
omis28ca



Joined: 26 Dec 2005
Posts: 11
Location: Fresno, CA

PostPosted: Mon May 15, 2006 1:48 am    Post subject: Parallel Port Programming Reply with quote

As far as i know there are are few windows DLLs that allow you to read and write directly to a pc's parallel port, one is called Inpout32.dll whitch can be found at http://www.logix4u.net/ their website provides lots of usefull information on parallel port programming but in order to use that dll i believe inpout32.dll will have to be converted to a PHP extension so it can be used directly from php.

If someone is willing to take the time to program that extension it can open up a many new applications for PHP-GTK such as data acquisition, motion control for robotics , home control and many other electronics related applications.
Back to top
clange



Joined: 24 Jan 2006
Posts: 11

PostPosted: Mon May 15, 2006 8:10 am    Post subject: Reply with quote

There is a module for win32 api:

http://de.php.net/manual/de/ref.w32api.php

With this module you can call every function on a dll.

mfg clange
Back to top
rajuvk



Joined: 02 May 2006
Posts: 10
Location: Kerala, India

PostPosted: Mon May 15, 2006 10:31 am    Post subject: Reply with quote

Regrding using MySql it is the same as using in the web sites. Only that in PHP-Gtk you have to use the Gtk generated windows and window components like entry boxes, labels, trees to present the data. So you have to learn how to use them. unless you know how to call the Gtk classes it will be very difficult as the manuals are under creation and is sketchy.

I am also exploring the utility of PHP-gtk for development of a project which include financial accunting among other things. I choosed PHP-gtk , due to my past experiance in PHP. But the lack of documentation on how to use the gtk classes is creating difficulties. I am also find that creating printable reports also will be difficult with PHP-Gtk. Another difficulty is creating executables for distributing the application.

Therefore I am looking into others like Python-gtk, which has better documentation, and seems to be more capable than PHP-Gtk. However I have not yet abandoned PHP-Gtk.

Regards,
Raju
Back to top
Osiris



Joined: 17 Dec 2005
Posts: 65

PostPosted: Mon May 15, 2006 11:25 am    Post subject: Reply with quote

When using the php-gtk docs (under www.php-gtk2.de) you should also use the original gtk-api docs from gtk.org, when the method is undocumented in php-gtk docs.

In most cases, the gtk-api docs show you the right params and there order.
Back to top
kksou



Joined: 06 Sep 2006
Posts: 25

PostPosted: Wed Sep 06, 2006 9:21 am    Post subject: Reply with quote

Was researching materials on php-gtk2 and happen to see your post.

Yes, we have developed applications using php-gtk2 that outputs to a thermal printer through parallel port.

Let me know if you're still interested.
Back to top
rgljr



Joined: 10 Apr 2006
Posts: 15
Location: Minnesota, USA

PostPosted: Fri Sep 08, 2006 3:00 am    Post subject: PHP GTK Printing Reply with quote

Haven't tried it yet but I was looking at printing a while back and ran across some possiblities in the way creating a file to print and calling a batch file or executing a command to actually do a print. Such as:

NOTEPAD /P whatever.prn -- will print the text file whatever.prn

Since PHP originally generated HTML another option may be of more interest

RUNDLL32.EXE MSHTML.DLL,PrintHTML whatever.html -- print the file whatever.html

Example Batch file can be found at:

http://www.robvanderwoude.com/

He has several example of printing from a batch file in a page titled

Print Files from Batch Files

I have had great success executing command and batch files from PHP-GTK2 to fill in those places where it doesn't have quite the functionality I need. The Batch or script file concept also works well for multiple platform programs allowing operating system unique areas to be dealt with either in PHP or scripts/batch files.
Back to top
leon_pegg



Joined: 12 Jun 2006
Posts: 113
Location: hemel / UK

PostPosted: Fri Sep 08, 2006 12:00 pm    Post subject: Reply with quote

you could create pdfs witch the user could open this would stop it being system dependant eg your examples would only work on wndows not linux this defets the object of php-gtk.
Back to top
ron_t



Joined: 11 Dec 2005
Posts: 78
Location: Gatineau, Quebec

PostPosted: Fri Sep 08, 2006 1:43 pm    Post subject: Reply with quote

kksou wrote:
Was researching materials on php-gtk2 and happen to see your post.

Yes, we have developed applications using php-gtk2 that outputs to a thermal printer through parallel port.

Let me know if you're still interested.


I'm curious to hear about this, too. Please let us all know how you go about it.

-Ron T.
Back to top
kksou



Joined: 06 Sep 2006
Posts: 25

PostPosted: Fri Sep 08, 2006 7:02 pm    Post subject: Reply with quote

We simply write straight into parallel port with fopen and fwrite. Once the handle is created, you can write to it like a standard file.

Code:
$printer_handle = fopen("PRN", "w");
fwrite($printer_handle, "this is a test string");
fclose($printer_handle);


As noted earlier, our application prints to a thermal printer, not inkjet printer. So the above works pretty well. We are able to print receipts and barcode labels - straight from within php-gtk without the need of external programs.

Our application runs on windows platform. I guess it should run on linux with standard parallel port too.
Back to top
cohort



Joined: 07 Feb 2006
Posts: 47

PostPosted: Sat Sep 09, 2006 2:22 am    Post subject: Reply with quote

kksou wrote:
I guess it should run on linux with standard parallel port too.

On linux, you should print standard text via the "lpr" command, which will handle the printer for you.
Back to top
ron_t



Joined: 11 Dec 2005
Posts: 78
Location: Gatineau, Quebec

PostPosted: Sat Sep 09, 2006 6:47 am    Post subject: Reply with quote

kksou wrote:
We simply write straight into parallel port with fopen and fwrite. Once the handle is created, you can write to it like a standard file.

Code:
$printer_handle = fopen("PRN", "w");
fwrite($printer_handle, "this is a test string");
fclose($printer_handle);


As noted earlier, our application prints to a thermal printer, not inkjet printer. So the above works pretty well. We are able to print receipts and barcode labels - straight from within php-gtk without the need of external programs.

Our application runs on windows platform. I guess it should run on linux with standard parallel port too.


Thanks!

-Ron T.
Back to top
Guest






PostPosted: Wed Nov 29, 2006 5:26 pm    Post subject: Reply with quote

Hi,

I'm a beginner PHP developer and came across PHP-GTK as an extension of PHP.
I would like to know is there anyway I can use PHP-GTK to interface with PC's parallel port or USB port?
How about using MySQL with PHP-GTK?
How well is PHP-GTK in big development such as Accounting System?
As I already have some knowledge in PHP, I would prefer PHP-GTK then others if PHP-GTK is abled to develop big scale application.
Thanks. Rolling Eyes Rolling Eyes Rolling Eyes Razz Razz Razz Cool Cool Cool Cool Rolling Eyes Rolling Eyes Rolling Eyes
Back to top
Display posts from previous:   
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners 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.