[maemo-developers] [maemo-developers] Usage of hildon_appview_add_with_scrollbar()

From: Luca Donaggio donaggio at gmail.com
Date: Mon Jan 16 13:54:30 EET 2006
2006/1/16, Kalle Vahlman <kalle.vahlman at gmail.com>:
>
> On 1/16/06, Luca Donaggio <donaggio at gmail.com> wrote:
> > [code]
> >
> >   main = HILDON_APPVIEW (hildon_appview_new ("Main view"));
> >   hildon_appview_set_fullscreen_key_allowed(main, TRUE );
> >   gtk_widget_show (GTK_WIDGET (main));
> >   main_icon_pixbuf = create_pixbuf ("grsync.png");
> >   if (main_icon_pixbuf)
> >     {
> >       gtk_window_set_icon (GTK_WINDOW (main), main_icon_pixbuf);
> >       gdk_pixbuf_unref (main_icon_pixbuf);
> >     }
> >
> >   viewport1 = gtk_viewport_new (NULL, NULL);
> >   gtk_widget_show (viewport1);
> >   hildon_appview_add_with_scrollbar(main, viewport1);
> >
> > [/end code]
> >
> > It produces no compiler error, but by running it (inside scratchbox and
> on
> > the real device) produces only a blank window with no widget drawn.
> > What am I doing wrong?
>
> My guess is that you don't do gtk_widget_show_all() on the HildonApp?
> The add_with_scrollbar creates a ScrolledWindow but does not show()
> it.
>
> Btw, you don't need to use the viewport with add_with_scrollbar(), it
> does basically the same thing that your first code snippet (it's not
> an error though).
>
> --
> Kalle Vahlman, zuh at iki.fi
> Powered by http://movial.fi
> Interesting stuff at http://syslog.movial.fi
>


Thanks Kalle,

you're right I just did a gtk_widget_sow() on the HildonApp!

Regarding the viewport, I think it acts like a container for all subsequent
widgets in this app - to avoid using it I've to set up another container for
those widgets and add_with_scrollbar() it to the appview. Or is there
another way?

Luca Donaggio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maemo.org/pipermail/maemo-developers/attachments/20060116/a4d4ce49/attachment.htm 
More information about the maemo-developers mailing list