PHP-GTK
Friday, October 31, 2014 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousGtkToggleButton
GtkToggleButton::get_activenext

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

GtkToggleButton Constructor

GtkToggleButton ([string label [, boolean use_underline = true]]);

Creates a new GtkToggleButton, optionally with a text label. If you pass false as second parameter, the mnemonics (_) will not be parsed.

Example 123. Creating a new GtkToggleButton

<?php
//Create a new toggle button with label and mnemonic
$togglebtn = new GtkToggleButton('Toggle _me');
//connect the toggled signal to the function "toggled"
$togglebtn->connect('toggled', 'toggled');
 
function toggled($togglebtn) {
    if ($togglebtn->get_active()) {
        echo "ToggleButton is ACTIVE\r\n";
    } else {
        echo "ToggleButton is NOT active\r\n";
    }
}
 
$wnd = new GtkWindow();
$wnd->set_border_width(10);
$wnd->add($togglebtn);
$wnd->connect_simple('destroy', array('gtk', 'main_quit'));
$wnd->show_all();
Gtk::main();
?>

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


previousGtkToggleButton
GtkToggleButton::get_activenext

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:51:00 2013 CEST