eiffel-gtk : design questions



Hi !

I've made a new release of my Eiffel bindings for gtk (now we are 3 to be interested in it !)

You can find the latest release here :

http://www.mygale.org/11/pennanea/gtk

I've corrected a few bugs, added a few classes, removed some unused files.

In directory essai/ you will find an example of how to use this stuff (a fileselector with a few callbacks).

I will frequently update my code.

Eiffel people, I'd like your comments about the following things :

----------------------------------------------------------------------------
gtk use some enumerated types. I have 3 possibilities : create classes for those enumerations (typing would be more secure), or use things like "INTEGER is unique" (less secure, but maybe easy to use), or use BIT.

I mean :
1/

class AN_ENUMERATION
feature
  foo, bar : INTEGER is unique
  set_foo
  set_bar

which is not very easy to use, because you have to make an enum, call one of the access methods, etc...
	!!enum.make
	enum.set_foo
	window.my_method(enum) -- my_method(enum : AN_ENUMERATION)

or:
2/just put all enumerations in a superclass :
class ENUMERATIONS
  feature
	foo, bar : INTEGER is unique

in this case, you just have to inherit from ENUMERATIONS, and methods signature use INTEGER instead of AN_ENUMERATION object.
	inherit
	   ENUMERATIONS
	...
	enum := foo
	window.my_enum(enum) -- my_method(enum : INTEGER)

Maybe I should use both ? Because with the second one, you have an INTEGER so you can use + to make foo and bar.

3/use the BIT type ?

----------------------------------------------------------------------------

Now, let's talk about lists.

I've created classes for GLIST and GSLIST. In the current release, they have nothing in common with the LINK_LIST[T] used by the SmallEiffel compiler. I thing it would be a good idea to see a GLIST like a specialization of LINK_LIST.

In the next release, I will improve GLIST and GSLIST design with constrained genericity. I mean :

class GLIST[E->GTK_OBJECT]
inherit
	LINK_LIST[E]
	-- redefinitions of features in link_list

I will do the same with GTK_LIST.

I see no problem in doing that. Am I right ?



Regards,

Francois



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]