TableCreator

From AbiWiki

(Difference between revisions)
Jump to: navigation, search
(==)
m (Reverted edits by Unimaxug (Talk) to last revision by Hub)
 
(4 intermediate revisions not shown)
Line 1: Line 1:
-
<!--Modify this as appropriate, especially if it''s not an FAQ-->
+
==TableCreator==
-
<!--Aside: using H2 and H3 is a trick for old TWikis to keep headings out of the [[ToC|ToC]]-->
+
-
<!--Delete this line and those above, and anything else that is not needed when you create the page, leave the [[ToC|ToC]] commented out if you don''t use it-->
+
-
<H2>[[TableCreator|TableCreator]]</H2>
+
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|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===
-
 
+
-
<H3> Example Code </H3>
+
Some simple example code to show to use the widget in python.
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..
In the _init method used to create a toolbar add the following code..
 +
<pre>
<pre>
Line 28: Line 25:
<pre>
<pre>
-
 
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>
</pre>
-
==== Contributors
+
[[Category:Developer]]
-
 
+
[[Category:Python]]
-
====
+
-
* Main.[[MartinSevior|MartinSevior]] - 27 Jan 2007
+
-
[[Category:To Convert]]
+

Current revision as of 13:13, 27 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..


		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()

Then add the callback

	def _tableCB(self,abi,rows,cols):
		self._abiword_canvas.insert_table(rows,cols)
Personal tools