eb0536 | 2005-11-05 | Henrik Grubbström (Grubba) | | /* -*- C -*- */
|
1a0554 | 2005-07-28 | Martin Nilsson | | class GTK2.ImageMenuItem;
inherit GTK2.MenuItem;
//! Properties:
//! GTK2.Widget image
|
3d7663 | 2005-11-03 | Lance Dillon | | void create(string|mapping(string:mixed)|void label)
|
1a0554 | 2005-07-28 | Martin Nilsson | | //! Create a new ImageMenuItem.
{
|
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 *s1;
|
3d7663 | 2005-11-03 | Lance Dillon | | GtkStockItem item;
GtkWidget *gi;
|
535ddd | 2005-12-18 | Marcus Comstedt | | int t=0;
|
3d7663 | 2005-11-03 | Lance Dillon | |
|
535ddd | 2005-12-18 | Marcus Comstedt | | get_all_args("create",args,"%t",&s1);
if(s1->size_shift==0)
|
eac9aa | 2005-12-18 | Martin Nilsson | | t=gtk_stock_lookup(CGSTR0(s1),&item);
|
3d7663 | 2005-11-03 | Lance Dillon | | if (t)
|
eac9aa | 2005-12-18 | Martin Nilsson | | gi=gtk_image_menu_item_new_from_stock(CGSTR0(s1),NULL);
|
535ddd | 2005-12-18 | Marcus Comstedt | | else {
ref_push_string(s1);
f_string_to_utf8(1);
|
eac9aa | 2005-12-18 | Martin Nilsson | | gi=gtk_image_menu_item_new_with_label(CGSTR0(Pike_sp[-1].u.string));
|
535ddd | 2005-12-18 | Marcus Comstedt | | pop_stack();
}
|
3d7663 | 2005-11-03 | Lance Dillon | | THIS->obj=G_OBJECT(gi);
} else {
INIT_WITH_PROPS(GTK_TYPE_IMAGE_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 *gi;
gi=gtk_image_menu_item_new();
THIS->obj=G_OBJECT(gi);
|
1a0554 | 2005-07-28 | Martin Nilsson | | }
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2__init_this_object();
|
1a0554 | 2005-07-28 | Martin Nilsson | | }
|
f28449 | 2006-08-03 | Lance Dillon | | +GTK2.Widget get_image();
|
1a0554 | 2005-07-28 | Martin Nilsson | | //! Gets the widget that is currently set as the image.
void set_image(GTK2.Widget image);
//! Sets the image of the image menu item.
|