Thread: [Java-gnome-developer] TreeView doesn't show with Glade
Brought to you by:
afcowie
From: Luis M. V. <lui...@gm...> - 2011-02-17 18:36:06
|
Hi! I have a problem with the TreeView and Glade I'm using: libjava-gnome 4.0.14 Glade 3.6.7 Eclipse 3.6.1 Ubuntu 10.04 For example, in the next code, where I don't use glade, the TreeView show the information of TreeModel ---------------8<--------------------- public class ExampleWithoutGlade { public ExampleWithoutGlade() { Window win = new Window(); DataColumnString placeName = new DataColumnString(); ListStore model = new ListStore(new DataColumn[] { placeName }); TreeIter row = model.appendRow(); model.setValue(row, placeName, "Line 1"); row = model.appendRow(); model.setValue(row, placeName, "Line 2"); row = model.appendRow(); model.setValue(row, placeName, "Line 3"); TreeView treeview = new TreeView(model); win.add(treeview); TreeViewColumn vertical = treeview.appendColumn(); vertical.setTitle("Lines"); CellRendererText renderer = new CellRendererText(vertical); renderer.setMarkup(placeName); win.showAll(); win.connect(new Window.DeleteEvent() { public boolean onDeleteEvent(Widget source, Event event) { Gtk.mainQuit(); return false; } }); } public static void main(String[] args) { Gtk.init(args); new ExampleWithoutGlade(); Gtk.main(); } } ---------------------------------------- However, when I use the Glade interface, the TreeView doesn't show with the information of TreeModel ---------------8<--------------------- public class ExampleWithGlade { public ExampleWithGlade() throws FileNotFoundException { XML xmlWin = Glade.parse("rsc/example.glade", "win"); XML xmlTreeView = Glade.parse("rsc/example.glade", "treeview"); Window win = (Window) xmlWin.getWidget("win"); TreeView treeview = (TreeView) xmlTreeView.getWidget("treeview"); DataColumnString placeName = new DataColumnString(); ListStore model = new ListStore(new DataColumn[] { placeName }); TreeIter row = model.appendRow(); model.setValue(row, placeName, "Line 1"); row = model.appendRow(); model.setValue(row, placeName, "Line 2"); row = model.appendRow(); model.setValue(row, placeName, "Line 3"); treeview.setModel(model); TreeViewColumn vertical = treeview.appendColumn(); vertical.setTitle("Lines"); CellRendererText renderer = new CellRendererText(vertical); renderer.setMarkup(placeName); win.showAll(); win.connect(new Window.DeleteEvent() { public boolean onDeleteEvent(Widget source, Event event) { Gtk.mainQuit(); return false; } }); } public static void main(String[] args) throws FileNotFoundException { Gtk.init(args); new ExampleWithGlade(); Gtk.main(); } } ---------------------------------------- The glade file: Preferences: libglade + gtk+ 2.12 ---------------8<--------------------- <?xml version="1.0"?> <glade-interface> <!-- interface-requires gtk+ 2.12 --> <!-- interface-naming-policy project-wide --> <widget class="GtkWindow" id="win"> <property name="title" translatable="yes">.</property> <child> <widget class="GtkTreeView" id="treeview"> <property name="visible">True</property> <property name="can_focus">True</property> </widget> </child> </widget> </glade-interface> ---------------------------------------- I don't undestand the reason of this issue. Could you help me? Best regards |
From: Andrew C. <an...@op...> - 2011-02-18 02:25:31
|
On Thu, 2011-02-17 at 19:34 +0100, Luis Muñoz Villarreal wrote: > > I'm using: > libjava-gnome 4.0.14 Just FYI, there's a java-gnome PPA with up-to-date packages for Ubuntu at ppa:java-gnome/ppa See if that helps your issue? https://launchpad.net/~java-gnome/+archive/ppa AfC Sydney -- Andrew Frederick Cowie Operational Dynamics is an operations and engineering consultancy focusing on IT strategy, organizational architecture, systems review, and effective procedures for change management: enabling successful deployment of mission critical information technology in enterprises, worldwide. http://www.operationaldynamics.com/ Sydney New York Toronto London |
From: Luis M. V. <lui...@gm...> - 2011-02-18 11:23:14
|
2011/2/18 Andrew Cowie <an...@op...> > On Thu, 2011-02-17 at 19:34 +0100, Luis Muñoz Villarreal wrote: > > > > > I'm using: > > libjava-gnome 4.0.14 > > Just FYI, there's a java-gnome PPA with up-to-date packages for Ubuntu > at ppa:java-gnome/ppa See if that helps your issue? > https://launchpad.net/~java-gnome/+archive/ppa Now, I'm using libjava-gnome-java 4.0.17, but with the same problem. > > > AfC > Sydney > > -- > Andrew Frederick Cowie > > Operational Dynamics is an operations and engineering consultancy > focusing on IT strategy, organizational architecture, systems > review, and effective procedures for change management: enabling > successful deployment of mission critical information technology in > enterprises, worldwide. > > http://www.operationaldynamics.com/ > > Sydney New York Toronto London > > > > > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > java-gnome-developer mailing list > jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-gnome-developer > |
From: Kenneth P. <ken...@gm...> - 2011-02-19 05:05:19
Attachments:
signature.asc
example.patch
|
On Thu, 17 Feb 2011 19:34:40 +0100 Luis Muñoz Villarreal <lui...@gm...> wrote: > Hi! > [snip] > I don't undestand the reason of this issue. > Could you help me? > > Best regards Hey, I figured out what was wrong. It seems you only need to call parse() on the top level widget and just use that xml tree for all its children. |
From: Luis M. V. <lui...@gm...> - 2011-02-25 18:00:38
|
Hi! Sorry for the delay in my answer. I'm have resolve my issue. I'm grate full to your help. Thank you. Best regards 2011/2/19 Kenneth Prugh <ken...@gm...> > On Thu, 17 Feb 2011 19:34:40 +0100 > Luis Muñoz Villarreal <lui...@gm...> wrote: > > > Hi! > > [snip] > > I don't undestand the reason of this issue. > > Could you help me? > > > > Best regards > > Hey, > > I figured out what was wrong. It seems you only need to call parse() on > the top level widget and just use that xml tree for all its children. > > > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > java-gnome-developer mailing list > jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-gnome-developer > > |