27 lines
5 KiB
Text
27 lines
5 KiB
Text
version=pmwiki-1.0.5
|
|
newline=²
|
|
text=!!!!primitive widget²* you need to extends GtkWidget. ²* you need to write many methods,²* your constructor '''MUST NOT''' call parent::__construct, or you will have an error (''Fatal error: Cannot instantiate abstract class'') for primitive widgets (abstract ?) (GtkWidget),²[[include:Main/CodeTable]]²# simple code fragment (need to be completed²class PrimitiveWidget extends GtkWidget{²² function __construct(){² # Fatal error: Cannot instantiate abstract class PrimitiveWidget in line ... (__construct() line call)² # parent::__construct(); ² }²}²²$w = new PrimitiveWidget();²[[include:Main/CodeTableEnd]]²²²!!!!composite widget²* you can extends from GtkVbox for example²* constructor will have to create all needed object,²* no need to write many methods,²* here is a working sample code :²[[include:Main/CodeTable]]<?php²²class CompositeWidget extends GtkVbox{²² function __construct(){² parent::__construct();² $this->label = new GtkLabel('test composite widget');² $this->add($this->label);² $this->add(new GtkLabel('an other label'));² $this->add(new GtkButton('Test me'));²² $this->set_border_width(10);² }²}²²²$win = new GtkWindow();²$win->set_title('Composite Widget exention example');²$win->connect_simple('destroy', array('gtk', 'main_quit'));²²$composite_widget = new CompositeWidget();²²$vbox = new GtkVBox();²$win->add($vbox);²²$vbox->pack_start($composite_widget, true);²²$win->show_all();²Gtk::main();²²?>[[include:Main/CodeTableEnd]]²²²!!! links²* CodeSnippets/PhpGtkClock²* [[http://www.gtk.org/tutorial/x2312.html gtk]] extension tutorial,²* [[http://www.learningpython.com/2006/07/25/writing-a-custom-widget-using-pygtk/ python-gtk]] extension tutorial,²
|
|
time=1157450895
|
|
diff:1157444688:1157444688:=1,63c1²< ²< !!!!primitive widget²< * you need to extends GtkWidget. ²< * you need to write many methods,²< * your constructor MUST NOT call parent::__construct, or you will have an error (Fatal error: Cannot instantiate abstract class),²< ²< [[include:Main/CodeTable]]²< ²< # simple code fragment (need to be completed²< class PrimitiveWidget extends GtkWidget{²< ²< function __construct(){²< # Fatal error: Cannot instantiate abstract class PrimitiveWidget in line ... (__construct() line call)²< # parent::__construct(); ²< }²< }²< ²< $w = new PrimitiveWidget();²< ²< [[include:Main/CodeTableEnd]]²< ²< ²< !!!!composite widget²< * you can extends from GtkVbox for example²< * constructor will have to create all needed object,²< * no need to write many methods,²< * here is a working sample code :²< [[include:Main/CodeTable]]²< ²< <?php²< ²< class CompositeWidget extends GtkVbox{²< ²< function __construct(){²< parent::__construct();²< $this->label = new GtkLabel('test composite widget');²< $this->add($this->label);²< $this->add(new GtkLabel('an other label'));²< $this->add(new GtkButton('Test me'));²< ²< $this->set_border_width(10);²< }²< }²< ²< ²< $win = new GtkWindow();²< $win->set_title('Composite Widget exention example');²< $win->connect_simple('destroy', array('gtk', 'main_quit'));²< ²< $composite_widget = new CompositeWidget();²< ²< $vbox = new GtkVBox();²< $win->add($vbox);²< ²< $vbox->pack_start($composite_widget, true);²< ²< $win->show_all();²< Gtk::main();²< ²< [[include:Main/CodeTableEnd]]²< ²< ?>²< ²---²> Describe ExtendingWidgetsWithPhp here.²\ No newline at end of file²
|
|
author=Marc Quinton
|
|
author:1157444688=Marc Quinton
|
|
host:1157444688=143.196.162.107
|
|
name=CodeHints.ExtendingWidgetsWithPhp
|
|
host=143.196.162.107
|
|
agent=Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041217
|
|
rev=6
|
|
diff:1157445225:1157444688:=0a1²> ²6a8²> ²16a19²> ²25c28,30²< [[include:Main/CodeTable]]<?php²---²> [[include:Main/CodeTable]]²> ²> <?php²55c60²< ?>[[include:Main/CodeTableEnd]]²---²> [[include:Main/CodeTableEnd]]²56a62²> ?>²
|
|
author:1157445225=Marc Quinton
|
|
host:1157445225=143.196.162.107
|
|
diff:1157445252:1157445225:=4a5²> ²
|
|
author:1157445252=Marc Quinton
|
|
host:1157445252=143.196.162.107
|
|
diff:1157447791:1157445252:=57,59d56²< !!! links²< * CodeSnippets/PhpGtkClock²< ²
|
|
author:1157447791=Marc Quinton
|
|
host:1157447791=143.196.162.107
|
|
diff:1157450817:1157447791:=4c4²< * your constructor '''MUST NOT''' call parent::__construct, or you will have an error (''Fatal error: Cannot instantiate abstract class''),²---²> * your constructor MUST NOT call parent::__construct, or you will have an error (Fatal error: Cannot instantiate abstract class),²59,60c59²< * [[http://www.gtk.org/tutorial/x2312.html gtk]] extension tutorial,²< * [[http://www.learningpython.com/2006/07/25/writing-a-custom-widget-using-pygtk/ python-gtk]] extension tutorial,²---²> ²
|
|
author:1157450817=Marc Quinton
|
|
host:1157450817=143.196.162.107
|
|
diff:1157450895:1157450817:=4c4²< * your constructor '''MUST NOT''' call parent::__construct, or you will have an error (''Fatal error: Cannot instantiate abstract class'') for primitive widgets (abstract ?) (GtkWidget),²---²> * your constructor '''MUST NOT''' call parent::__construct, or you will have an error (''Fatal error: Cannot instantiate abstract class''),²
|
|
author:1157450895=Marc Quinton
|
|
host:1157450895=143.196.162.107
|