Wise Monks,
I am using wxPerl to write a GUI. The wxButton class is derived from the wxWindow class (one of the four classes it is derived from ). So to disable a button I want to use the Disable method of the wxWindow class. Here is the code how it is declared and set up.
sub new { my( $self, $parent, $id, $title, $pos, $size, $style, $name ) = @_ +; $parent = undef unless defined $parent; $id = -1 unless defined $id; $title = "" unless defined $title; $pos = wxDefaultPosition unless defined $pos; $size = wxDefaultSize unless defined $size; $name = "" unless defined $name; $style = wxDEFAULT_FRAME_STYLE unless defined $style; $self = $self->SUPER::new( $parent, $id, $title, $pos, $size, $sty +le, $name ); $self->{notebook_1} = Wx::Notebook->new($self, -1, wxDefaultPositi +on, wxDefaultSize, 0); $self->{inc_pane} = Wx::Panel->new($self->{notebook_1}, -1, wxDefa +ultPosition, wxDefaultSize, ); $self->{avail_but} = Wx::Button->new($self->{inc_pane}, $avail_but +, "Availability"); .... EVT_BUTTON ($self, $avail_but, sub { <b>$self->{avail_but}->SUPER::Disable(); </b> } } package main; unless(caller){ local *Wx::App::OnInit = sub{1}; my $app = Wx::App->new(); Wx::InitAllImageHandlers(); my $frame_1 = MyFrame->new(); $app->SetTopWindow($frame_1); $frame_1->Show(1); $app->MainLoop(); }


When I call parent's method using the SUPER::method() call , it still doesnt work and the parent is seen as wxFrame not wxWindow. Also wxButton does not have a Disable method of its own, so no problems of overriding here. I thought I should be able to call $object->parentMethod() directly since first parentMethod found will be the only parent method existing.

Thank you for your response to my previous node given below:
wxPerl Event Handling/GUI process control

Follow up question, when I fork, I have a problem with setting a variable in the main parent loop and making the child process check that variable even though I am passing a reference to the variable in the child process,. If I update variable in parent process when child is already set off, the next time child checks the variable it still sees the old value of the variable i.e the value when the child process was kicked off.

Sorry for the long tortuous sentences, I really appreciate all your help.
Thanks

In reply to (wx)?Perl - Calling methods of parent class, checking variables in child process after fork by sush

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.