PHP-GTK
Friday, December 19, 2014 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousGtkFileChooserButton
GtkFileChooserButton Constructornext

Last updated: Sun, 12 May 2013
view this page in English

GtkFileChooserButton Constructor

Use this constructor to create a new file-selecting button widget.

Example 63. Using a GtkFileChooser button.

<?php
//Creating and initialising a new window
// to add the FileChooser to
$window = new GtkWindow();
 
//Quit the main loop when window is destroyed
$window->connect_simple(
    'destroy',
    array('Gtk', 'main_quit')
);
 
//Setting parameters of the window
$window->set_title('GtkFileChooser Demo');
$window->set_default_size(250,60);
$window->set_border_width(10);
 
/*
* Creating a new file chooser button
* Note that the second parameter dictates what action
* will be performed when the open button of the
* GtkFileChooserDialog widget is clicked
*/
$thebutton = new GtkFileChooserButton(
    'Select the File',
    Gtk::FILE_CHOOSER_ACTION_OPEN
);
 
//Creating a label and a quit button
$thelabel = new GtkLabel('Click to select a file: ');
$toquit = new GtkButton('_Quit');
$toquit->connect_simple(
    'clicked',
    array($window, 'destroy')
);
 
//Creating a layout to add the elements
$thehbox = new GtkHBox();
$thevbox = new GtkVBox();
 
//Adding the elements to the layout
$thehbox->pack_start($thelabel);
$thehbox->pack_start($thebutton);
$thevbox->pack_start($thehbox);
$thevbox->pack_start($toquit);
 
//Displaying the window and starting the main loop
$window->add($thevbox);
$window->show_all();
Gtk::main();
?>

User Contributed Notes
gtk.gtkfilechooserbutton.constructor.php
add a note about notes
There are no user contributed notes for this page.


previousGtkFileChooserButton
GtkFileChooserButton Constructornext

Last updated: Sun, 12 May 2013
view this page in English


credits 

PHP  Copyright © 2001-2014 The PHP Group
 All rights reserved.
Last updated: Sun May 12 20:50:57 2013 CEST