3 class Action(gobject
.GObject
):
8 'sensitive' : (gobject
.TYPE_BOOLEAN
, # type
9 'sensitive', # nick name
10 'sensitive', # description
12 gobject
.PARAM_READWRITE
) # flags
16 'activate' : (gobject
.SIGNAL_RUN_LAST
, gobject
.TYPE_NONE
, ())
19 def __init__(self
, name
, label
, tooltip
, stock_id
):
20 gobject
.GObject
.__init
__(self
)
22 def do_get_property(self
, property):
23 return getattr(self
, property.name
)
25 def do_set_property(self
, property, value
):
26 return setattr(self
, property.name
, value
)
28 def connect_proxy(self
, widget
):
29 assert self
.__proxy
is None
31 self
.sensitive
= self
.__sensitive
32 widget
.connect('clicked', lambda w
: self
.emit('activate'))
34 def set_sensitive(self
, value
):
36 self
.__proxy
.set_sensitive(value
)
37 self
.__sensitive
= value
39 sensitive
= property(lambda self
: self
.__sensitive
, set_sensitive
)
41 gobject
.type_register(Action
)
43 class ComboText(gtk
.OptionMenu
):
45 gtk
.OptionMenu
.__init
__(self
)
46 self
.__menu
= gtk
.Menu()
48 self
.set_menu(self
.__menu
)
50 def append_text(self
, text
):
51 item
= gtk
.MenuItem(text
)
52 self
.__model
.append([text
])
53 self
.__menu
.append(item
)
55 def set_active(self
, i
):
59 return self
.get_history()
64 def combo_box_new_text():
67 gtk
.combo_box_new_text
= combo_box_new_text