Re: Re: Gtk3::MessageDialog - missing methods



Hi;

On Sat, 9 Jan 2021 at 01:13, Thomas Funk via gtk-perl-list <gtk-perl-list gnome org> wrote:
Hi,
> Gesendet: Freitag, 08. Januar 2021 um 19:08 Uhr
> Von: "Torsten Schoenfeld via gtk-perl-list" <gtk-perl-list gnome org>
> An: gtk-perl-list gnome org
> Betreff: Re: Gtk3::MessageDialog - missing methods
>
> On 08.01.21 02:15, Thomas Funk via gtk-perl-list wrote:
> > ---|--------------|--------------------------------------------
> > OK | GtkWidget *  | gtk_message_dialog_new ()
> > FF | GtkWidget *  | gtk_message_dialog_new_with_markup ()
> > OK | void     | gtk_message_dialog_set_markup ()
> > OK | void     | gtk_message_dialog_set_image ()
> > ?? | GtkWidget *  | gtk_message_dialog_get_image ()
> > FF | void     | gtk_message_dialog_format_secondary_text ()
> > FF | void     | gtk_message_dialog_format_secondary_markup ()
> > ?? | GtkWidget *  | gtk_message_dialog_get_message_area ()
>
 
But for the methods ... I've tried several things but got every time:

*** unhandled exception in callback:
***   Can't find information for method MessageDialog::format_secondary_text at /home/tf/workspace/Perl/Testem/messagedialog.pl line 52.
***  ignoring at /usr/share/perl5/Gtk3.pm line 572.

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);
}
```

Ciao,
 Emmanuele.

--


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