[Gambas-user] gb.gtk 050731

Benoit Minisini gambas at ...1...
Tue Aug 2 22:56:48 CEST 2005


On Sunday 31 July 2005 15:16, Daniel Campos wrote:
> Hi:
>
> New version of gb.gtk: 050731
>
> http://gambas.gnulinex.org/gtk
>
> This version adds the new stuff implemented by Benoît in the gb.qt
> component, and yes,
> it has some bugs, but it would help Benoit to test the "UserControl" and
> Gambas control
> creation with gb.gtk, so they not depend on gb.qt.
>
> Benoît: Apart from this, you should adapt the color chooser to be
> compatible with
> gb.gtk: When using GTK+, all h,s,v values have different ranges than in QT:
>
> H: 0 - 360
> S: 0 - 100
> V: 0 - 100
>
> All GTK+ applications work in this way, and the gb.gtk component must be
> compatible
> with the rest of GTK+ applications. I suppose you could check the active
> component
> using the "Components" class, and then use values from 0 to 255 when
> using gb.qt and
> the values I told you when using gb.gtk.

Of course not, we must choose the same values for everything. Think that the 
gb.qt and gb.gtk components must be swapped as much as possible.

Then, I think there GTK+ is wrong, because if you have to lost the less 
precision possible between HSV <-> RGB conversion, then the values of HSV 
must have at least the same range as the values of RGB. So the values of 
0->255 for S & V, and not less.

In the GTK+ component, if you already have HSV <-> RGB conversion functions 
that takes values between 0 and 100, you just have to apply a factor of 
100/255 before the conversion, and a factor of 255/100 after. Or better 
rewrite the HSV <-> RGB conversion routine (by taking the QT ones for 
example) to have the minimal precision needed. Another solution would be 
having floating point values for HSV, I don't know.

As for the 0->360 and 0->359 thing, I must check, because on QT the value of H 
is modulo 360, i.e. 360 == 0. I don't know on GTK, but I think so.

In a few words, gb.qt and gb.gtk must have the same methods & properties 
behaviour. But the dialogs can be different: this is not a problem.

As for the color (and other) dialog I made in Gambas, they will be the same 
between QT, GTK+. This is the goal :-)

There is another problem with the stock icons you added in gb.gtk. They are 
too much GTK+ specific. So here is what I propose to you :-)

- I will copy in the gambas part of the gb.qt component all equivalent KDE 
icons, and I think the Picture class will be able to get them automatically. 
I hope it works..

- We should find an organization and a naming convention for stock icons that 
is not too much GTK+ specific. The names must be the same between gb.qt and 
gb.gtk - This way the IDE will able to present them to the user.

>
> I also added an experimental method called "Reparent" for al widgets
> except top-level
> windows, so any control can change its parent.

I know that in some cases this leads to problems in QT. This needs a lot of 
tests, but I will add it to try.

Regards,

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




More information about the User mailing list