eb0536 | 2005-11-05 | Henrik Grubbström (Grubba) | | /* -*- C -*- */
|
1a0554 | 2005-07-28 | Martin Nilsson | | class GTK2.CheckMenuItem;
inherit GTK2.MenuItem;
//! A check menu item is more or less identical to a check button, but it
//! should be used in menus.
//! IMG: GTK2.CheckMenuItem("Hi there")
//! IMG: GTK2.CheckMenuItem("Hi there")->set_active(1)
//! Properties:
//! int active
//! int draw-as-radio
//! int inconsistent
//! <p>
//! Style properties:
//! int indicator-size
signal toggled;
//! Called when the state of the menu item is changed
|
3d7663 | 2005-11-03 | Lance Dillon | | void create(string|mapping(string:mixed)|void label_or_props)
|
1a0554 | 2005-07-28 | Martin Nilsson | | //! The argument, if specified, is the label of the item.
//! If no label is specified, use object->add() to add some
//! other widget (such as an pixmap or image widget)
{
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2_verify_not_inited();
pgtk2_verify_setup();
|
1a0554 | 2005-07-28 | Martin Nilsson | | if (args) {
|
017b57 | 2011-10-28 | Henrik Grubbström (Grubba) | | if (TYPEOF(Pike_sp[-args]) == PIKE_T_STRING) {
|
535ddd | 2005-12-18 | Marcus Comstedt | | struct pike_string *label;
|
3d7663 | 2005-11-03 | Lance Dillon | | GtkWidget *gc;
|
535ddd | 2005-12-18 | Marcus Comstedt | | get_all_args("create",args,"%t",&label);
ref_push_string(label);
f_string_to_utf8(1);
|
eac9aa | 2005-12-18 | Martin Nilsson | | gc=gtk_check_menu_item_new_with_mnemonic(CGSTR0(Pike_sp[-1].u.string));
|
535ddd | 2005-12-18 | Marcus Comstedt | | pop_stack();
|
3d7663 | 2005-11-03 | Lance Dillon | | THIS->obj=G_OBJECT(gc);
} else {
INIT_WITH_PROPS(GTK_TYPE_CHECK_MENU_ITEM);
}
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2_pop_n_elems(args);
|
1a0554 | 2005-07-28 | Martin Nilsson | | } else {
|
3d7663 | 2005-11-03 | Lance Dillon | | GtkWidget *gc;
gc=gtk_check_menu_item_new();
THIS->obj=G_OBJECT(gc);
|
1a0554 | 2005-07-28 | Martin Nilsson | | }
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2__init_this_object();
|
1a0554 | 2005-07-28 | Martin Nilsson | | }
void set_active(int new_state);
//! State is either 1 or 0. If 1, the button will be 'pressed'.
int get_active();
//! Get whether item is active.
void toggled();
//! Emulate a toggled event
int get_inconsistent();
//! Retrieves the value set by set_inconsistent().
void set_inconsistent(int setting);
//! If the user has selected a range of elements (such as some text or
//! spreadsheet cells) that are affected by a boolean setting, and the current
//! values in that range are inconsistent, you may want to display the check
//! in an "in between" state. This function turns on "in between" display.
require gtk24;
void set_draw_as_radio(int draw_as_radio);
//! Set whether check menu item is drawn like a radio button.
int get_draw_as_radio();
//! Get whether check menu item is drawn like a radio button.
endrequire;
|