Hi,

Am Dienstag, den 06.12.2005, 01:22 +0100 schrieb Fabian Sturm:
> Hi!
> 
> I finally finished my dateedit widget, it is not yet thoroughly tested
> but all I tested worked fine.

nice :)

> 
> It is not an exact port of the libgnomeui widget, since I think some
> changes make more sense for a python widget (e.g. datetime as return
> type instead of epoch).
> 
> I also hope to make this a bug free and documented widget, since I
> couldn't find any simple but still feature complete custom gobject in
> python. So I hope many people will comment on this so that it can be
> used as reference for other developers.
> 
> 
> Things which still bug me:
> 
> - constructor
> The original gnome-dateedit has two constructors, unfortunately with
> overlapping but different parameters, so they can't just be merged into
> one python constructor with named parameters.

don't use constructors with parameters at all in that case. I don't see
what one would want to use them for here. Use module "locale" to get the
settings and pass them to the C stuff. Except for the date, there are no
programmer-should-set-them settings that I can see, and the date is
better done as a property. Remaining 0 constructor parameters :)

add more spacing between the entry and the button and the optionmenu...

Don't use set_size_request (use set_max_length in characters).
Note that the number of characters may be locale-dependent and to leave
some extra space (at least 1-2 chars) so the user can edit around
without having to delete first. 

Hmm, I like the option menu thingie for the Time :) 

Please split the dateedit_flags property into the actual properties... I
don't know what the gnomeui guys smoked on this but I don't like it :)

i.e.

"show_time": (gobject.TYPE_BOOLEAN, ...

and I don't think the 24hr and weekstartsonmonday stuff should be
setable at all. just query the locale. It just feels weird to have them
there at all. :)

> So far I only got one response on this problem.
> 
> - destruction
> The original version has these additional functions:
> free_resources, mnemonic_activate, destroy, finalize
> I don't know what of this is needed for python, so some comments would
> be great.

"mnemonic_activate" is usually when some keyboard bound key got pressed.
Not sure what they do in there (didn't look yet though)... try if the
keyboard shortcuts work fine now...

"finalize" is pretty sure just C legacy, "free_resources" probably too.
destroy is partly. But if destruction works right now, no need for that
either.

> 
> - show_all
> if you add this widget to a window and then do a window.show_all() the

Don't use show_all(). Instead, use show() on the widgets you want to
see. I don't think it is worth the hassle. Did I mention already that I
hate "show_all" and "no_show_all" ? ;)

> dateedit widget will show the time entry, even though it should be
> hidden by the show_time = False flag.
> I can't see the difference to the c widget so I need help here too!
> 
> - todos
> I have several todos at various places in the source, most are just
> spots which should be verified by other developers
> 
> Thanks a lot, Fabian
> 
> P.s. I will set up a webpage for the widget and announce it once more at
> the list when the above stuff is resolved.

Good work :)

cheers,
   Danny


_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to