[Gambas-devel] gb.gtk 05806 / qt bug

Benoit Minisini gambas at ...1...
Mon Aug 8 16:35:06 CEST 2005


On Monday 08 August 2005 15:11, Daniel Campos wrote:
> Hi:
>
> In fact I'm using GtkTreeView for ListBox, ListView and ColumnView. One of
> the things I was thinking is to write only the more complex control in
> C++, and
> then use the gambas-control feature to implement ListBox, ListView,
> TreeView GridView and ColumnView, may be in the gb.gtk.gambas part, or even
> in the gb.form component
> if you did the same.

The problem is that you cannot make virtual classes directly in Gambas, and 
*View controls use that to represent items. I prefer not to create one Gambas 
object for each *View item, it would be too slow...

>
>
> I agree with you: this model is very complex for Basic programmers, but
> may be there could be
> only a Widget written in C++, exposing all the complex of a TreeView
> model, for those who
> want to use it (primarily us to implement the rest of widgets :-), and
> then cover it with
> Gambas code so we had a simple ListBox, ListView... and may be the
> TableView control that, I don't
> know why, is placed in the gb.qt.ext component. 

It is there because:
- I didn't know if it can be done in GTK+
- It is a hack of the QTable QT widget, where I replaced real items by calls 
to the Data event handler.

> All these controls would 
> take the look & feel from
> QT or GTK+ depending on what component is in use, and we (specially me
>
> :-) could save a lot
>
> of time and code.
>
> I'd want to start that work as soon as possible, as I know there are
> some bugs in the current
> ListBox and ListView implementations, and I would like to rewrite that
> code...

Even if these widgets are frightening in GTK+ :-), I'm not sure it is a good 
idea for TreeView, ListView, ColumnView, IconView, and TableView. I mean, by 
exposing all the complexity of the internals to Gambas and making a simple 
interface in Gambas, I don't think you will save a lot of time and code. What 
is more complicated in GTK+ than in QT3 is that you just have to create 
models, iterators, ..., before creating the final view widget, but once this 
is done, I think the rest is as simple/complicated as in QT. Creating a 
complex interface for Gambas in C/C++ is sometimes longer that doing 
everything in C/C++ and only making a simple Gambas interface.

But I can't really tell you while I didn't see some code... :-)

Another remark: in QT, TreeView, ListView and ColumnView are the same widget, 
but not IconView nor TableView. I don't know in GTK+. Anyway, as I think of 
the future where another toolkit could be used, I prefer keeping all these 
controls separated in Gambas.

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the Devel mailing list