Delivered-To: lablgtk at yquem.inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:content-type:content-transfer-encoding; bh=m7jh799ws8focykhGQhvoGreteeXEEDMdL027XYEGdQ=; b=T6beZqn4kJllmsRMjTOxTtkDCHMHfZHpvDAfHWAvIUBK+Zi/qL6aTGgGPoMXIsySHo4ajYO74+m+ie0i6/2DEGtDHEKjIHGyRbWS0P4keXHXo6IQaYiMnwtjGFDql9GsRDbk+pgZYa90mXkAZArLJuMkUv9Uw6BmEUzAe9vkrxM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:content-type:content-transfer-encoding; b=D2rrCC/TYfVTnZ1a82WLZchQQre+rViWg4WO8Mbrs5yQ0yoEtDNgueFoUPYE/dCPjvfUuBfI2P7G2L0pUbO4ZsuyaNztxX5GarOCAz7uafwhlfvArA75mHsK/Ct34Itm6/Px42arHYVNVtjYj19T+uf/eUoiv8aqyZtbhu1g8hI= Message-ID: <47996A67.2070509 at gmail.com> Date: Thu, 24 Jan 2008 22:49:43 -0600 From: Edgar Friendly MIME-Version: 1.0 To: lablgtk at yquem.inria.fr Content-Transfer-Encoding: 7bit Subject: [Lablgtk] Gtk spin button Content-Type: text/plain; charset=ISO-8859-1 Content-Length: 1363 (sorry for missent 1st email) I'm making a simple dialog box [1], and I want w#run to return `OK (the default response) when the user presses in the spin-box. I find the function gtk_entry_set_activates_default () in the GTK documentation, but it seems that spin_button inherits from widget instead of entry in lablgtk2 (2.10.0). Did someone intend this mis-alignment of inheritance? I feel hesitant at hacking things, and worry that maybe there's an incompatibility somewhere reflected here. Thanks, E. let go_to_page_dialog () = let w = GWindow.dialog ~parent:window ~title:"Go to page" ~modal:true ~position:`CENTER () in ignore (GMisc.label ~text:"Page: " ~packing:w#vbox#add ()); let sb = GEdit.spin_button ~packing:w#vbox#add ~digits:0 ~numeric:true () in sb#adjustment#set_bounds ~lower:0. ~upper:(float (max_index ())) ~step_incr:1. (); sb#set_value (float (cur_page ())); sb#set_activates_default true; w#add_button_stock `OK `OK; w#add_button_stock `CANCEL `CANCEL; w#set_default_response `OK; let on_ok () = new_pos (group_pages ~seed:sb#value_as_int ~forward:true); w#destroy () in match w#run () with | `DELETE_EVENT | `CANCEL -> w#destroy () | `OK -> on_ok () _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk