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 :
 
GtkCombo

GtkCombo

Text entry field with a dropdown list.

Object Hierarchy

GtkObject
`-- GtkWidget
       `-- GtkContainer
              `-- GtkBox
                     `-- GtkHBox
                            `-- GtkCombo

Direct subclasses

None.

Description

A GtkCombo appears to be the equivalent of the select element in HTML. This can be misleading if you're coming directly from a web development background; a GUI widget is largely about appearance, and carrying hidden values is not something this one will do without a little programming. Luckily, there are a trio of invaluable GtkObject methods that will do just that, with any object and with any form of data. These are get_data() , set_data() and remove_data() . See the sample under GtkCombo's constructor to get an idea of their usage.

There are a few key bindings in the combo widget. Most of them have some bearing on searches.

Table 1. Key bindings in GtkCombo

Key combinationFunction
Return (from the entry box) Opens up the list. If the entry contains text that fully matches a list item's content, that list item will be selected on opening.
Tab + MOD_1 mask (from the entry box) The MOD_1 modifier is usually Alt. This key combination auto-completes a partial entry.
Arrow up (from the entry box) If use_arrows has been set to true, scrolls up through the list without opening the list window. Can also be achieved with keypad arrow or Alt + p.
Arrow down (from the entry box) If use_arrows has been set to true, scrolls down through the list without opening the list window. Can also be achieved with keypad arrow or Alt + n.
Return (from the list box) Toggles the list item that has current focus.
Spacebar (from the list box) Selects the list item that has current focus.
Up arrow (from the list box) Scrolls up through the list items.
Down arrow (from the list box) Scrolls down through the list items.
Esc (from the list box) Removes grab from the list box, which closes it.

The normal but annoying behaviour is that the first entry is selected when you open the dropdown. This can be stopped by doing the following:
$objList = $objCombobox->list;
$objList->set_selection_mode( GTK_SELECTION_SINGLE);

See also: GtkEditable, GtkEntry, GtkItem, GtkList, GtkListItem, GtkOptionMenu.

Constructor

GtkCombo (void);
-- Creates an entry box with a dropdown list.

Methods

set_value_in_list()
  Toggles whether entry value must be matched in list.
set_use_arrows()
  Toggles whether list can be scrolled within entry box.
set_use_arrows_always()
  Toggles whether entry box list-scrolling should loop.
set_case_sensitive()
  Toggles whether matching should be case-sensitive.
set_item_string()
  Sets string associated with list item.
set_popdown_strings()
  Simple list construction.
disable_activate()
  Prevents return key from opening dropdown list.

Properties

entry:
  Text entry field.
list:
  Dropdown list.

 
   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 Free Templates

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