From: Maurizio Colucci To: Olivier Andrieu Subject: Re: Lablgtk2 Tutorial Date: Sat, 10 Jul 2004 15:03:14 -0700 Cc: lablgtk at kaba.or.jp References: <003501c45fe2$da05b030$1501a8c0 at hama> <200407071041.42660.seguso.forever at tin.it> <20040709.154617.39641749.andrieu at ijm.jussieu.fr> In-Reply-To: <20040709.154617.39641749.andrieu at ijm.jussieu.fr> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200407101503.14354.seguso.forever at tin.it> On Friday 09 July 2004 06:46, Olivier Andrieu wrote: > Maurizio Colucci [Wed, 7 Jul 2004]: > > Personally I really need some examples how to create my own widget > > (e.g., how do I inherit GtkWidget and override some methods, and > > provide my own paint function? How can I know my current width?) > > Do you really need to create your own widgets ? I mean, GTK+ already > has a lot of general-purpose widgets. The usual way of building an > application using GTK+ is to compose widgets rather than deriving new > ones. > > That's a bit difficult to do with LablGTK anyway (in pure caml code I > mean). You cannot really create new types or classes, you cannot > override default signal handlers[1], and the lower-level GTK+ > functions for painting are not all binded. . Also some widgets require > you to provide C functions (eg custom CellRenderers), which makes them > very difficult to extend in Lablgtk. > > > [1] but that's possible, we just have to bind > g_signal_override_class_closure Thanks for the reply. Unfortunately, my application (http://logicaldesktop.sourceforge.net) must create its own a custom widget , because I need a listbox widget that word-wraps its items on resize (see screenshots). Thanks anyway :-) Maurizio