|
From: Gustavo J. A. M. C. <gu...@us...> - 2002-04-15 20:49:54
|
Update of /cvsroot/numexp/gnumexp/src/xygraph
In directory usw-pr-cvs1:/tmp/cvs-serv15365
Modified Files:
hello.py numexp-xygraph
Added Files:
Numexp_XYGraph-ui.xml
Log Message:
The xygraph component now provides its own UI items that are merged in the
container's main window.
--- NEW FILE ---
<Root>
<commands>
<cmd name="AddObject" stockid="gtk-new" label="Add object" />
</commands>
<menu>
<submenu name="XYGraph" label="_XYGraph">
<menuitem name="AddObject" verb=""/>
</submenu>
</menu>
<dockitem name="Toolbar">
<toolitem name="AddObject" verb=""/>
<placeholder/>
</dockitem>
</Root>
Index: hello.py
===================================================================
RCS file: /cvsroot/numexp/gnumexp/src/xygraph/hello.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -U4 -r1.1 -r1.2
--- hello.py 14 Apr 2002 17:36:33 -0000 1.1
+++ hello.py 15 Apr 2002 20:49:49 -0000 1.2
@@ -15,8 +15,9 @@
import sys
import bonobo
import bonobo.ui
+import Bonobo
import gtk
HELLO_UI_XML = "Bonobo_Sample_Hello.xml"
@@ -136,11 +137,11 @@
#frame.add (button)
frame.add(wid)
win.set_contents (frame)
-
+
win.connect ('delete_event', delete_event_cb)
-
+
app_list.append (win)
return win
Index: numexp-xygraph
===================================================================
RCS file: /cvsroot/numexp/gnumexp/src/xygraph/numexp-xygraph,v
retrieving revision 1.2
retrieving revision 1.3
diff -U4 -r1.2 -r1.3
--- numexp-xygraph 14 Apr 2002 17:34:03 -0000 1.2
+++ numexp-xygraph 15 Apr 2002 20:49:49 -0000 1.3
@@ -19,13 +19,27 @@
func2 = Function(lineattr, "Test function", "cos(x)+4", 'x')
xygraph.plot_area.add_plot_object(func)
xygraph.plot_area.add_plot_object(func2)
bonobo.ui.Control.__init__(self, xygraph.get_toplevel_widget())
- self.connect('activate', self.sample_merge_bonobo_items_cb)
-
+ self.connect('set-frame', self.sample_merge_bonobo_items_cb)
+ #self.sample_merge_bonobo_items_cb(self, None)
- def sample_merge_bonobo_items_cb(self, control, state):
- print sample_merge_bonobo_items_cb
+ def sample_merge_bonobo_items_cb(self, foo):
+
+ self.set_automerge(1)
+ ui_component = bonobo.ui.Component('xygraph')
+ ui_component.set_container(self.get_remote_ui_container())
+ bonobo.ui.util_set_ui(ui_component, '',
+ './Numexp_XYGraph-ui.xml',
+ 'numexp-xygraph')
+ self.set_ui_component(ui_component)
+ verbs = [ ('AddObject', self.add_object_callback) ]
+ ui_component.add_verb_list(verbs)
+
+
+ def add_object_callback(*args):
+ print "bonobo_sample_callback"
+
def create_function(generic_factory, iid):
print "create_function: iid=" + iid
|