OxyScripts.com
Menu spacer Home Tutorials Articles Code Forums irc.freenode.net #oxyscripts
Main (PHP)
Home Forums PHP News PHP Tutorials Articles PHP Code Snippets Contact Us Sysadmin Resources Books Template Shop
3rd Party Streams
SlashDot PHPDeveloper.org PHP.Net
Resources
PHP Manual MySQL Manual Smarty Manual PEAR Manual PHP-GTK Manual Symfony Manual
Code Snippets
Authentication Database Graphics HTTP Miscellaneous Time/Date
Affiliates
Scripts TutorialMan TutorialGuide CodingForums.com PHP Scripts Cheap Web Hosting Affordable Web Hosting Dreamweaver Templates

Search This Site :     PHP Function Reference :
 
GtkEntry Constructor

GtkEntry Constructor

GtkEntry (void);

Creates a widget that will hold a single line of text, either set programmatically through set_text() or entered by the user.

Example 15. Retrieving text from a GtkEntry widget

<?php

dl('php_gtk.'.(strstr(PHP_OS, 'WIN') ? 'dll' : 'so'));

/* set up a function to collect the input from the entry and print it */
function get_input($entry) {
  $input=$entry->get_text();
  echo "$input\n";
  $entry->grab_focus();
  $entry->set_text("");
}

/* set up the window */
$window = &new GtkWindow();
$window->set_position(GTK_WIN_POS_MOUSE);
$window->connect_object('destroy', array('gtk', 'main_quit'));

/* add a box container to the window to allow more than one child widget */
$box = &new GtkVBox();
$window->add($box);

/* add a GtkEntry to the box and connect it to the callback function */
$entry = &new GtkEntry();
$entry->connect('activate', 'get_input');
$box->add($entry);

/* add a GtkButton to the box and use connect_object() so that it
   will pass the GtkEntry to the callback when it is clicked */
$button = &new GtkButton('Return or click me to echo input');
$button->connect_object('clicked', 'get_input', $entry);
$box->add($button);

/* display everything and set the main loop running */
$box->show_all();
$window->show_all();
gtk::main();

?>

 
   Print this page

Top Sponsor
Symantec\'s Norton SystemWorks 2006
Sponsors
CA
Sponsors
AdWords Dominator 125*125
Advertisting

Affiliates
VertexTemplates PHPFreaks CodeWalkers StarGeek DevScripts CGI & PHP Scripts PHP CMS

Shopping Rebates   Sell It 4 You   Flash Page Counters   Get Insured
GPS Tracking Service   Charity Donate Info   Web Site Hosting   VOIP Service

Privacy Policy | Links | Site Map | Advertising

All content on OxyScripts.com is (©)2002-2007

 
Powered by Adrastea - Version 1.0.0. Copyright © Rune Solutions, 2004-2005