Re: Re: Re: Gtk3::MessageDialog - missing methods



Great! 

Thank you very much :-) 

Best, 
Thomas 

Am 9. Januar 2021 23:16:37 schrieb Emmanuele Bassi <ebassi gmail com>:

On Sat, 9 Jan 2021 at 17:16, Thomas Funk via gtk-perl-list <gtk-perl-list gnome org> wrote:
Hi,

On Sat, 9 Jan 2021 at 02:35, Emmanuele Bassi via gtk-perl-list <gtk-perl-list gnome org> wrote:
> As Torsten wrote, those methods are not introspectable because of their use of variadic arguments in C; this means you cannot call them from Perl.
>
> You will need to re-implement them; luckily, they are easier to deal in Perl than the printf-style format of C:
>
> ```
> sub Gtk3::MessageDialog::format_secondary_text {
>   my ($dialog, $format, @args) = @_;
>
>   my $text = sprintf $format, @args;
>   $dialog->set('secondary-text', $text, 'secondary-use-markup' => 0);
> }
>
> sub Gtk3::MessageDialog::format_secondary_markup {
>   my ($dialog, $format, @args) = @_;
>
>   my $text = sprintf $format, @args;
>   $dialog->set('secondary-text' => $text, 'secondary-use-markup' => 1);
> }
> ```
>

Works like a charme ^^
Thank you very much!
 
What is the next step? Will you or Torsten push the code into gtk3-perl?


Ciao,
 Emmanuele.

--



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]