Re: How to find replacements for deprecated functions

2016-11-30 Thread Emmanuele Bassi
Hi;

for direct replacements, we use compiler warnings that will tell you what
to use - or point you in the general direction; e.g. something like "The
function X has been deprecated; use Y instead".

If you're using a high level language, it depends on the language; AFAIK
Python will emit a DeprecationWarning exception you can catch, but don't
know off hand if it'll point you to the replacement.

In some cases there is no annotation; you can file a bug for the
documentation component and we can discuss what's the best way forward.

If you're asking something more specific, you'll have to provide more
context.

Ciao,
Emmanuele.

On Wed, 30 Nov 2016 at 19:49, Erik de Castro Lopo 
wrote:

> Emmanuele Bassi wrote:
>
> > There is no direct replacement for GtkUIManager, in the sense that
> > there is no API that you can use to immediately replace GtkUIManager.
> >
> > GtkUIManager has been deprecated for a long time — it was deprecated
> > in GTK+ 2.x, so it's not really a GTK+ 3.x issue.
>
> Ok, so that sort of answered the specific question with regards to
> GtkUIManager, but what about the more general question:
>
> > How is someone like me supposed to figure out what to replace
> > function X that has has been deprecated?
>
> Erik
> --
> --
> Erik de Castro Lopo
> http://www.mega-nerd.com/
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: How to find replacements for deprecated functions

2016-11-30 Thread Erik de Castro Lopo
Emmanuele Bassi wrote:

> There is no direct replacement for GtkUIManager, in the sense that
> there is no API that you can use to immediately replace GtkUIManager.
> 
> GtkUIManager has been deprecated for a long time — it was deprecated
> in GTK+ 2.x, so it's not really a GTK+ 3.x issue.

Ok, so that sort of answered the specific question with regards to
GtkUIManager, but what about the more general question:

> How is someone like me supposed to figure out what to replace
> function X that has has been deprecated?

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: How to find replacements for deprecated functions

2016-11-30 Thread Emmanuele Bassi
Hi;

On 30 November 2016 at 09:07, Erik de Castro Lopo  wrote:
> HI all,
>
> I am an occassional GTK user, and often I work on resurrecting code
> bases for which I am not the original author. As such I often run
> into reprecation warnings. When I go to the documentation I find
> things like this:
>
> 
> https://developer.gnome.org/gtk3/stable/GtkUIManager.html#gtk-ui-manager-get-widget
>
> "gtk_ui_manager_get_widget has been deprecated since version
>  3.10 and should not be used in newly-written code."
>
> How is someone like me supposed to figure out what to replace that
> function with in the code I'm hacking on?

There is no direct replacement for GtkUIManager, in the sense that
there is no API that you can use to immediately replace GtkUIManager.

GtkUIManager has been deprecated for a long time — it was deprecated
in GTK+ 2.x, so it's not really a GTK+ 3.x issue.

Depending on what your application does, and how it's already built, you can:

 * define menus directly using GtkBuilder, but that won't give you
mapping between an "action path" and a GtkMenuItem;
 * define menus using GMenu/GMenuModel, which abstract menus in the
same way GtkUIManager did, but things like placeholders and
merging/unmerging of menu definitions are more complicated
 * write you own GtkMenu structures by hand

This is why it's hard to condense information inside GtkUIManager's
API reference; it depends on your context and expectations.

Ciao,
 Emmanuele.

-- 
https://www.bassi.io
[@] ebassi [@gmail.com]
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

How to find replacements for deprecated functions

2016-11-30 Thread Erik de Castro Lopo
HI all,

I am an occassional GTK user, and often I work on resurrecting code
bases for which I am not the original author. As such I often run
into reprecation warnings. When I go to the documentation I find
things like this:


https://developer.gnome.org/gtk3/stable/GtkUIManager.html#gtk-ui-manager-get-widget

"gtk_ui_manager_get_widget has been deprecated since version 
 3.10 and should not be used in newly-written code."

How is someone like me supposed to figure out what to replace that
function with in the code I'm hacking on?

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list