diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2023-03-19 17:05:26 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2023-03-19 17:05:26 +0100 |
commit | e385eec1d6116b8c87889fc1d829aa1c5192156f (patch) | |
tree | 748e7342f9e38c52439365656d094e334292e5fb /doc/fr | |
parent | 3ebfe3e11720d8a43d82235004de5e94c58d6240 (diff) | |
download | weechat-e385eec1d6116b8c87889fc1d829aa1c5192156f.zip |
core: fix default value of options for bars added by plugins
When the bar name already exists, the function `bar_new` returns the pointer to
the bar (instead of NULL) and sets the default value for all options with the
values received.
Diffstat (limited to 'doc/fr')
-rw-r--r-- | doc/fr/weechat_plugin_api.fr.adoc | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/doc/fr/weechat_plugin_api.fr.adoc b/doc/fr/weechat_plugin_api.fr.adoc index 7ee11fac0..e55ad3907 100644 --- a/doc/fr/weechat_plugin_api.fr.adoc +++ b/doc/fr/weechat_plugin_api.fr.adoc @@ -15952,7 +15952,7 @@ bar = weechat.bar_search("mybar") ==== bar_new -_Mis à jour dans la 2.9._ +_Mis à jour dans la 2.9, 4.0.0._ Créer une nouvelle barre. @@ -16032,26 +16032,19 @@ Valeur de retour : * pointeur vers la nouvelle barre, NULL en cas d'erreur +[NOTE] +Depuis la version 4.0.0, si la barre existe déjà, WeeChat définit les valeurs +reçues comme valeurs par défaut des options de la barre et retourne le pointeur +vers la barre au lieu de NULL. + Exemple en C : [source,c] ---- -struct t_gui_bar *my_bar = weechat_bar_new ("mybar", - "off", - "100", - "window", - "", - "top", - "horizontal", - "vertical", - "0", - "5", - "default", - "cyan", - "blue", - "darkgray", - "off", - "time,buffer_number+buffer_name"); +struct t_gui_bar *my_bar = weechat_bar_new ( + "mybar", "off", "100", "window", "", "top", "horizontal", "vertical", + "0", "5", "default", "cyan", "blue", "darkgray", "off", + "time,buffer_number+buffer_name"); ---- Script (Python) : |