Re: Gtk spin button
Edgar Friendly <[email protected]>
| Newsgroups | gmane.comp.lang.ocaml.lib.gtk |
|---|---|
| Message-ID | <[email protected]> |
Julien Moutinho wrote: > Indeed, perhaps a [method entry = new GEdit.entry obj] > would be welcome inside [GEdit.spin_button]. > > Since http://library.gnome.org/devel/gtk/stable/GtkSpinButton.html > says that: "[entry] is the GtkEntry part of the GtkSpinButton widget, > and can be used accordingly." > entry = new GEdit.entry obj? Good thing I didn't try to make guesses as to how to do this, I wouldn't have come up with this. I might have guessed changing the object inheritance or using a #coerce cast to create the entry... > Still, as a workaround, a manual cast is possible with [GtkEdit.Entry.cast]: > > let sb = GEdit.spin_button () ~packing: w#vbox#add > ~digits: 0 ~numeric: true in > > let entry = new GEdit.entry (GtkEdit.Entry.cast sb#as_widget) in > > entry#set_activates_default true; /me is pleasantly surprised this doesn't segfault in some nasty way. Thanks for the workaround. E.