diff --git a/doc/en/weechat_plugin_api.en.txt b/doc/en/weechat_plugin_api.en.txt index 5642eaa04..758f31f19 100644 --- a/doc/en/weechat_plugin_api.en.txt +++ b/doc/en/weechat_plugin_api.en.txt @@ -11743,11 +11743,11 @@ struct t_gui_bar_item *my_item = weechat_bar_item_new ("myitem", Script (Python): -[NOTE] +[IMPORTANT] For compatibility with versions ≤ 0.4.1, the default callback has only 3 arguments: 'data', 'item' and 'window' (no 'buffer' and 'extra_info'). + To use a callback with all arguments, you must add "(extra)" before the name, -see example below. +see example below (supported only in WeeChat ≥ 0.4.2). [source,python] ---------------------------------------- @@ -11760,11 +11760,11 @@ def my_build_callback(data, item, window): bar_item = weechat.bar_item_new("myitem", "my_build_callback", "") -# example (callback with all arguments) +# example (callback with all arguments, for WeeChat ≥ 0.4.2) def my_build_callback2(data, item, window, buffer, extra_info): return "my content" -bar_item2 = weechat.bar_item_new("(extra)myitem2", "my_build_callback2", "") +bar_item2 = weechat.bar_item_new("(extra)myitem2", "my_build_callback2", "") # WeeChat ≥ 0.4.2 ---------------------------------------- weechat_bar_item_update diff --git a/doc/fr/weechat_plugin_api.fr.txt b/doc/fr/weechat_plugin_api.fr.txt index be8dd11c4..04cd1e2fb 100644 --- a/doc/fr/weechat_plugin_api.fr.txt +++ b/doc/fr/weechat_plugin_api.fr.txt @@ -11939,12 +11939,13 @@ struct t_gui_bar_item *my_item = weechat_bar_item_new ("myitem", Script (Python) : -[NOTE] +[IMPORTANT] Pour la compatibilité avec les versions ≤ 0.4.1, le "callback" par défaut a seulement 3 paramètres : 'data', 'item' et 'window' (pas de 'buffer' et 'extra_info'). + Pour utiliser le callback avec tous les paramètres, vous devez ajouter "(extra)" -avant le nom, voir l'exemple ci-dessous. +avant le nom, voir l'exemple ci-dessous (supporté seulement dans +WeeChat ≥ 0.4.2). [source,python] ---------------------------------------- @@ -11957,11 +11958,11 @@ def my_build_callback(data, item, window): bar_item = weechat.bar_item_new("myitem", "my_build_callback", "") -# example (callback avec tous les paramètres) +# example (callback avec tous les paramètres, pour WeeChat ≥ 0.4.2) def my_build_callback2(data, item, window, buffer, extra_info): return "mon contenu" -bar_item2 = weechat.bar_item_new("(extra)myitem2", "my_build_callback2", "") +bar_item2 = weechat.bar_item_new("(extra)myitem2", "my_build_callback2", "") # WeeChat ≥ 0.4.2 ---------------------------------------- weechat_bar_item_update diff --git a/doc/it/weechat_plugin_api.it.txt b/doc/it/weechat_plugin_api.it.txt index f395622a0..74b48868d 100644 --- a/doc/it/weechat_plugin_api.it.txt +++ b/doc/it/weechat_plugin_api.it.txt @@ -11920,11 +11920,11 @@ struct t_gui_bar_item *my_item = weechat_bar_item_new ("myitem", Script (Python): // TRANSLATION MISSING -[NOTE] +[IMPORTANT] For compatibility with versions ≤ 0.4.1, the default callback has only 3 arguments: 'data', 'item' and 'window' (no 'buffer' and 'extra_info'). + To use a callback with all arguments, you must add "(extra)" before the name, -see example below. +see example below (supported only in WeeChat ≥ 0.4.2). // TRANSLATION MISSING [source,python] @@ -11938,11 +11938,11 @@ def my_build_callback(data, item, window): bar_item = weechat.bar_item_new("myitem", "my_build_callback", "") -# example (callback with all arguments) +# example (callback with all arguments, for WeeChat ≥ 0.4.2) def my_build_callback2(data, item, window, buffer, extra_info): return "my content" -bar_item2 = weechat.bar_item_new("(extra)myitem2", "my_build_callback2", "") +bar_item2 = weechat.bar_item_new("(extra)myitem2", "my_build_callback2", "") # WeeChat ≥ 0.4.2 ---------------------------------------- weechat_bar_item_update