Re: widget name (was Re: Remove spaces in dialog window)



muppet wrote:

On Aug 4, 2005, at 6:37 AM, Beast wrote:

muppet wrote:

   my $self = $class->SUPER::new(...);
   bless $self, $class;


Sorry, newbie question:

How do I set text $name from other subroutine?

Need more context, but i'll try to guess.

In the context of your reply:
---
This is very dangerous. A plain, unmagical, blessed perl hash cannot be used as a Gtk2::Widget, because there is no actual C GObject backing it.

Either use Glib::Object::Subclass to subclass Gtk2::Dialog (or any widget), or rebless the actual widget like this:

   my $self = $class->SUPER::new(...);
   bless $self, $class;
--

But I think I mistakenly your point (I though its dangerous to bless hash, so I change it to scalar variable).

I should use :

 my $self = {};
 $self->{win} = $class->SUPER::new($title, $parent, "modal");
 bless($self, $class);

Instead of:

 my $self = {};
 bless($self, $class);
 $self->{win} = $class->SUPER::new($title, $parent, "modal");

Is that correct?

--

--beast




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