Re: Whats the problem with this ?
| From: | Michael Dransfield | Date: | Tue, 30 Apr 2002 17:55:41 +0000 |
| Subject: | Re: Whats the problem with this ? | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-1871@lists.php.net to get a copy of this message | ||
i am running on linux
1: there was a problem loading the gtk module i replaced your code with
dl( 'php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so'));
and the window displayed,
2: you have a bug userword should be password
Oh and try not to post offensive messages in your code
On Tue, 2002-04-30 at 18:42, Mahendra Kalkura wrote:
> guys tell me whats the problem in this code ok
>
> i just dont seem to find it
>
> after i enter username and password it just goes
> off
>
> window closes
>
> i dunno why ?
>
> help me
>
> the code is :
>
> -------------------------------------------------
> <?php
>
> // Load the PHP-GTK extension
> $extension = "php_gtk" . (strpos(PHP_OS, "WIN")
> >= 0 ? ".dll" : ".so");
> dl($extension);
>
> // Create a new window
> $window = &new GtkWindow();
> $window->set_title("CMR Cultura 2002");
> $window->set_usize(500, 500);
> $window->set_position(GTK_WIN_POS_CENTER);
> $window->set_policy(true,true, true);
>
> // Set a callback function for the destroy signal
> $window->connect("destroy", "killwin");
> function killwin()
> {
> gtk::main_quit();
> }
>
> $box = &new GtkVBox();
> $window->add($box);
>
> $label1 = &new GtkLabel("User Name : ");
> $box->pack_start($label1);
>
> $username = &new GtkEntry();
> $box->pack_start($username);
>
> $label2 = &new GtkLabel("Password : ");
> $box->pack_start($label2);
>
> $password = &new GtkEntry();
> $box->pack_start($password);
>
> $button = &new GtkButton("Login");
> $button->connect("clicked", "login");
> $box->pack_start($button);
>
> function login($theButton)
> {
>
> // Get all widgets
> global $window;
> global $label1;
> global $label2;
> global $box;
> global $username;
> global $password;
> global $button;
>
> // Hide all controls
> $label1->hide();
> $label2->hide();
> $username->hide();
> $password->hide();
> $button->hide();
>
> $dUser = $userword->get_text();
> $dPass = $password->get_text();
> if($dPass=="mahendra")
> {
> $pList1 = " is of ";
> }
> else
> {
> $pList2 = "fuck off";
> }
>
> // Create a GtkCList and show it
> $p1 = &new GtkLabel("$pList1");
> $box->add($p1);
> $p1->show();
> $p2 = &new GtkLabel("$pList2");
> $box->add($p2);
> $p2->show();
> }
>
> // Show the window
> $window->show_all();
>
> // Start the main PHP-GTK listener loop
> gtk::main();
>
> ?>
> -------------------------------------------------
>
> =====
> ======================================
> >From : Mahendra Kalkura
> ICQ UIN : 55974752
> Yahoo ID : mahendra_kalkura
> URL : http://mahendra.sehost.net/
> ======================================
>
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php