TableCreator

From AbiWiki

(Difference between revisions)
Jump to: navigation, search
(formatting details)
Line 1: Line 1:
-
==TableCreator==
+
>==TableCreator==
This wraps the useful little widget TableCreator, which can be used to interactively insert a table into a document by dragging the mouse. This widget is normally embedded in a Toolbar.
This wraps the useful little widget TableCreator, which can be used to interactively insert a table into a document by dragging the mouse. This widget is normally embedded in a Toolbar.
Line 9: Line 9:
-
<pre>
+
&lt;pre&gt;
self._tableCreate = abiword.TableCreator()
self._tableCreate = abiword.TableCreator()
-
self._tableCreate.set_labels("Table","Cancel")
+
self._tableCreate.set_labels(&quot;Table&quot;,&quot;Cancel&quot;)
self._tableCreate.show()
self._tableCreate.show()
self._tableItem = gtk.ToolItem()
self._tableItem = gtk.ToolItem()
Line 18: Line 18:
self._tableItem.show_all()
self._tableItem.show_all()
-
self._tableCreate.connect("selected",self._tableCB)
+
self._tableCreate.connect(&quot;selected&quot;,self._tableCB)
self._tableCreate.label().hide()
self._tableCreate.label().hide()
-
</pre>
+
&lt;/pre&gt;
Then add the callback
Then add the callback
-
<pre>
+
&lt;pre&gt;
def _tableCB(self,abi,rows,cols):
def _tableCB(self,abi,rows,cols):
self._abiword_canvas.insert_table(rows,cols)
self._abiword_canvas.insert_table(rows,cols)
-
</pre>
+
&lt;/pre&gt;
[[Category:Developer]]
[[Category:Developer]]
[[Category:Python]]
[[Category:Python]]
 +
 +
----
 +
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 +
----
 +
=[http://ubiqyzynene.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
 +
----
 +
=[http://ubiqyzynene.co.cc CLICK HERE]=
 +
----
 +
</div>

Revision as of 01:01, 18 November 2010

>==TableCreator==

This wraps the useful little widget TableCreator, which can be used to interactively insert a table into a document by dragging the mouse. This widget is normally embedded in a Toolbar.

Example Code

Some simple example code to show to use the widget in python. In the _init method used to create a toolbar add the following code..


<pre> self._tableCreate = abiword.TableCreator() self._tableCreate.set_labels("Table","Cancel") self._tableCreate.show() self._tableItem = gtk.ToolItem() self._tableItem.add(self._tableCreate) self.insert(self._tableItem, -1)

self._tableItem.show_all() self._tableCreate.connect("selected",self._tableCB) self._tableCreate.label().hide() </pre>

Then add the callback

<pre> def _tableCB(self,abi,rows,cols): self._abiword_canvas.insert_table(rows,cols) </pre>



Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page


CLICK HERE


Personal tools