[maemo-developers] Proposal for new hildon-extras widget

From: Cornelius Hald hald at icandy.de
Date: Fri Apr 16 12:11:07 EEST 2010
Hi Gabriel,

that looks like a useful widget to me. If possible, I think it's better
to adjust the options to fit within the default Hildon menu constraints,
but I can see cases where this is not really feasible. In the end it's
up to each application developer to decide whether or not to use that

If it's up to me, I would say we should include it in hildon-extras.
What are the other contributors saying? Thomas? Faheem? Andrew?

I (and, I think, the rest of the team) am/are fine with releasing a
library. It's just a matter of someone doing it. Also I think we already
have some version stuff in the autotools project.


P.S. Can we see the code somewhere?

On Tue, 2010-04-13 at 10:43 +0300, Gabriel Schulhof wrote:
> Hey!
> I've been working on a HildonPannableArea/GtkTreeView-based multicolumn
> widget to replace GtkMenu widgets. I wanted to do this because, as you
> know, Pidgin has quite a complex menu structure.
> I have created a pair of before/after videos that illustrate the new widget:
> Before: http://www.youtube.com/watch?v=H1xmWLi1dJU
> After: http://www.youtube.com/watch?v=GlahbMSx8kA
> I would like to include this widget in hildon-extras. The architecture is
> as follows:
> GtkFixed -> HildonMenuView
> IOW, HildonMenuView is a GtkFixed containing a bunch of
> HildonMenuViewColumn widgets and a button.
> HildonPannableArea -> HildonMenuViewColumn
> IOW, HildonMenuViewColumn is a HildonPannableArea containing a GtkTreeView
> which displays the menu items. It doesn't care about its height, but it
> asks for as much width as the inside GtkTreeView needs.
> GObject -> HildonMenuStore (implements GtkTreeModel)
> IOW, this tree store takes a single level of a GtkMenu and turns it into a
> GtkTreeModel. It forwards property changes via "row-changed" signals.
> There's also a private file with some convenience functions.
> I'm thinking that this would make it easy for applications (like Mapper)
> that have complex menus to continue to make them available in a usable
> manner.
> I would also like to use this widget for Pidgin, however, I wouldn't want
> to include it in the source tree. Instead, I'd like to link Pidgin to
> hildon-extras. This would also give me a chance to move to hildon-extras'
> HeFullScreenButton.
> And, to answer some of thp's points from our t.m.o private message
> conversation (he's one of the maintainers of hildon-extras):
> This /can/ be used as a drop-in replacement for GtkMenu, however, you need
> to subclass HildonWindow, and override the toggle_menu function.
> Alternatively, you can do this:
> gboolean (*orig_toggle_menu) (HildonWindow *, guint, guint32) = NULL;
> gboolean
> my_toggle_menu(HildonWindow *self, guint button, guint32 time)
> {
>   GtkMenu *menu = hildon_window_get_main_menu(self);
>   if (menu) {
>     /* Make a dialog containing this: */
>     g_object_new(HILDON_TYPE_MENU_VIEW, "menu", menu, NULL);
>     return TRUE;
>   }
>   return orig_toggle_menu(self, button, time);
> }
> int
> main(int argc, char **argv)
> {
>   /* the usual stuff */
>   orig_toggle_menu =
> HILDON_WINDOW_CLASS(g_type_class_peek(HILDON_TYPE_WINDOW))->toggle_menu;
>   HILDON_WINDOW_CLASS(g_type_class_peek(HILDON_TYPE_WINDOW))->toggle_menu
> = my_toggle_menu;
> }
> This will cause all your HildonWindow menus to appear as HildonMenuView
> widgets inside dialogs. You still need to convert any popup menus you may
> have.
> I also don't understand why we can't make hildon-extras into a proper
> shared library. We can copy the versioning calculation magic gtk+ does in
> their configure.ac to go from major.minor.micro to whatever libtool needs.
> And also, we don't have to stick to gtk's commitment of no API breaks and
> no ABI breaks. Having a shared library is, I think, a great advantage, and
> I'm pretty sure that, at our scale, we can forego the strict API
> management.
> /me dons asbestos suit
> Please let me know what you think,
> Gabriel
> P.S.: Obviously, if this gets added to hildon-extras, I'll change the
> namespace from Hildon to He.
> _______________________________________________
> maemo-developers mailing list
> maemo-developers at maemo.org
> https://lists.maemo.org/mailman/listinfo/maemo-developers

More information about the maemo-developers mailing list