PHP Classes

File: treev6b.php-gtk

Recommend this page to a friend!
  Classes of Luis Martinez Ulloa   mygrid   treev6b.php-gtk   Download  
File: treev6b.php-gtk
Role: Example script
Content type: text/plain
Description: tested with changes for php-gtk2 v.2.0
Class: mygrid
Display MySQL query results in a PHP-GTK window
Author: By
Last change:
Date: 15 years ago
Size: 842 bytes
 

Contents

Class file image Download
<?php
//glade block
   
include "mygrid6.inc";

   
$glade= new GladeXML('treeview.glade');
   
$treevLista = $glade->get_widget('treevLista');//el widget treeview
   
$window = $glade->get_widget('windowtreev');
   
$window->connect_simple('destroy', array('Gtk','main_quit'));
   
//connection **********************************************************
   
$conexion = mysql_connect("localhost","gestion","");
   
mysql_select_db("gestion", $conexion);
//data link and widget with an instance of class*****
   
$lista = new mylista(GObject::TYPE_STRING, GObject::TYPE_STRING);
   
$lista->enlaza($treevLista);
   
$lista->columnas(array('Mes', 'Subtotal'));
   
$lista->carga($conexion,"select mes, subtotal from gastos_meses");
//******************************************************************************
   
$window->show_all();
   
Gtk::main();
?>