Date: Mon, 12 Jul 2004 10:57:11 +0200 (CEST) Message-Id: <20040712.105711.22292686.andrieu at ijm.jussieu.fr> To: seguso.forever at tin.it Cc: lablgtk at kaba.or.jp Subject: Re: Lablgtk2 Tutorial From: Olivier Andrieu In-Reply-To: <200407101503.14354.seguso.forever at tin.it> References: <200407071041.42660.seguso.forever at tin.it> <20040709.154617.39641749.andrieu@ijm.jussieu.fr> <200407101503.14354.seguso.forever@tin.it> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Maurizio Colucci [Sat, 10 Jul 2004]: > 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). You mean a CellRendererText that does word-wrapping ? Then I'd say the simplest way is to write it in C and then wrap it for LablGTK. -- Olivier