gtk2 is a c-library -?
Here is an example in cpp pseudo code how I understood coding with tvision:
class button { // The tvision class
public:
virtual void buttonclick(){
//Overwrite me ...
}
...
}
class mybutton public Button { // This is my button
...
virtual void buttonclick(){
//do something
exit(0);
}
}
int main(){
//Initialize the app..
app->mainloop();
}
TVision is object oriented, and I don't know howto implement the example of the class mybutton in perl in a useful manner.
I thought already about a wrapper which implements event style hooks.
Would look something like this:
--- cpp layer
class perlwrapper_button public Button{
virtual void buttonclick(){
if ( !call perl->this_instance->buttonclick() ){
Button::buttonclick(); // Call tvision's buttononclick
}
}
}
--- perl module
package Button;
sub buttonclick{
return 0;
}
1;
--- The perl code of mybutton:
package MyButton;
push @ISA, 'Button';
sub buttonclick{
exit(0);
}
1;
I doubt, however, this concept is wise.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|