Date: Mon, 13 Oct 2003 15:48:29 +0200 To: Olivier Andrieu Cc: Sven Luther , lablgtk at kaba.or.jp Subject: Re: ANNOUNCE: lablGL, LablGTK1, LablGTK2 combined release Message-ID: <20031013134829.GA22764 at iliana> References: <20031010185936H.garrigue at kurims.kyoto-u.ac.jp> <20031010134222.GA12891 at iliana> <20031010205947.GA31778 at cs.unibo.it> <16266.31074.688738.837862 at akasha.ijm.jussieu.fr> <20031013101349.GA19951 at iliana> <16266.35035.58486.116372 at akasha.ijm.jussieu.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <16266.35035.58486.116372 at akasha.ijm.jussieu.fr> From: Sven Luther On Mon, Oct 13, 2003 at 01:13:31PM +0200, Olivier Andrieu wrote: > Sven Luther [Monday 13 October 2003] : > > > > On Mon, Oct 13, 2003 at 12:07:30PM +0200, Olivier Andrieu wrote: > > > Claudio Sacerdoti Coen [Friday 10 October 2003] : > > > > > > > > Hi Sven, > > > > > > > > > Saddly, Olivier's patch which add support for set/get_label > > > > > on buttons was not included, this means people using this > > > > > feature cannot use the prebuilt windows libaries, and i was > > > > > wanting to do just that :(( > > > > > > > > I can not really understand your concerns. "label" is a > > > > property of a button and you can always use properties by > > > > means of set/get. Indeed the patch of Olivier boils down to: > > > > > > > > method set_label = set Button.P.label obj > > > > method label = get Button.P.label obj > > > > > > > > that means that, given a button b, you should always be able to > > > > set Button.P.label b#as_widget and > > > > get Button.P.label b#as_widget > > > > > > actually you have to do a downcast because #as_widget returns a > > > [`gtk|`widget] obj and the property setter/getter needs a [> `button] > > > obj. So that would be : > > > > > > Gobject.set > > > GtkButtonProps.Button.P.label > > > (GtkButtonProps.Button.cast b#as_widget) > > > > BTW, it should be easy to have a button2 object which would inherit > > from button and add these two methods. This could easily be done in > > my app, and i could then reuse the 2.2.0 windows pre-built library. > > sure : > > class button2 obj = object > inherit GButton.button obj > method label = Gobject.get GtkButtonProps.Button.P.label obj > method set_label = Gobject.get GtkButtonProps.Button.P.label obj > end > > but you would have to do the same thing with derived classes > (toggle_button, check_button, etc.) > > > Furthermore, i could have a button2 constructor, which would have > > the text argument as non-option, thus removing any chance that a > > button2 is created without adding a label. > > if you juste care about some arguments (for instance label and > packing) : > > let button2 ~label ?packing () = > let b = GButton.button ~label ?packing () in > new button2 (GtkButtonProps.Button.cast b#as_widget) > > if you want to keep all the optional parameters, it's a bit more > complicated : > > let button2 ~label = > GtkButton.Button.make_params [] ~label ~cont:( > fun pl ?packing ?show () -> > GObj.pack_return > (new button2 (GtkButton.Button.create pl)) > ~packing ~show) > > (it's basically the same thing as GButton.button, with a new button2 > instead of new button and ~label instead of ?label) BTW, Remi Vanicat told me that the *Props.cmi is not installed by default with lablgtk 2.2.0, so i suppose this would not work out of the box, no ? Friendly, Sven Luther