[Glade-users] is there an example or tutorial about the use of 'GtkTreeStore' in the Glade?
- From: tvb at gnome.org (Tristan Van Berkom)
- Subject: [Glade-users] is there an example or tutorial about the use of 'GtkTreeStore' in the Glade?
- Date: Sat, 2 Apr 2011 03:53:57 +0900
On Sat, Apr 2, 2011 at 3:49 AM, Tristan Van Berkom <tvb at gnome.org> wrote:
On Sat, Apr 2, 2011 at 2:36 AM, Cleber N. Borges <klebyn at yahoo.com.br> wrote:
Em 1/4/2011 13:20, John Delaney escreveu:
On Fri, Apr 1, 2011 at 5:11 PM, Cleber N. Borges<klebyn at yahoo.com.br> ?wrote:
in first place, I create an GtkTreeStore object in glade, and after, I
create
an GtkTreeView...
in menu edit of GtkTreeView, I make the option to use the GtkTreeStore
model...
but, in runtime testing I don't obtain the Tree model in the window
display...
Have you defined cell renderers for the tree view columns? Select the
tree view and click on Edit to access the Tree View Editor, go to the
"Hierarchy" tab to add/remove tree view columns, then right click a
column to add the appropriate child cell renderer(s). Then you'd need
to edit the relevant properties of each cell renderer, e.g. tell it to
get the 'text' property from column 3 of the model for a text
cellrenderer.
sorry because I was concisely so much...
and I don't describe the part of de childrens models...
But,
I create the cellrenderes, ?3 GtkCellRendererText...
but it not appear in the Glade window in the development phase...
below, follows my glade file for example...
Thanks
A.) GtkBuilder does not allow adding <rows> (data) to GtkTreeStore
B.) A GtkTreeStore using a GtkTreeView with a GtkTreeStore no data
? ? will display all the rows in the empy GtkTreeStore properly
Err, big hurry this morning, that was supposed to read:
B.) A GtkTreeView with a GtkTreeStore with no data will display all the rows
in the empty GtkTreeStore properly.
i.e., it will properly display "nothing".
So you should not expect to see anything in Glade, you can test your
view by using a GtkListStore and adding some data to it, or you can
run your program that loads the builder file and add some data to the
treestore and see how it looks.
Cheers,
? ? ?-Tristan
Cleber Nogueira Borges
=====================================================
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkTreeStore" id="treestore1">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkWindow" id="window_main">
<property name="title" translatable="yes">ChemoMatrix - Easy Tools
Accessing for Chemometrics in R</property>
<property name="window_position">center</property>
<property name="default_width">600</property>
<property name="default_height">500</property>
<signal name="delete_event" handler="on_window_main_delete_event"/>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkMenuBar" id="menubar1">
<property name="visible">True</property>
<child>
<object class="GtkMenuItem" id="menu_file">
<property name="visible">True</property>
<property name="label" translatable="yes">File</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="menu1">
<property name="visible">True</property>
<child>
<object class="GtkImageMenuItem" id="imagemenuitem1">
<property name="label">gtk-new</property>
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="imagemenuitem2">
<property name="label">gtk-open</property>
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="imagemenuitem3">
<property name="label">gtk-save</property>
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="imagemenuitem4">
<property name="label">gtk-save-as</property>
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="separatormenuitem1">
<property name="visible">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="imagemenuitem5">
<property name="label">gtk-quit</property>
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menu_edit">
<property name="visible">True</property>
<property name="label" translatable="yes">Edit</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="menu2">
<property name="visible">True</property>
<child>
<object class="GtkImageMenuItem" id="imagemenuitem6">
<property name="label">gtk-cut</property>
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="imagemenuitem7">
<property name="label">gtk-copy</property>
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="imagemenuitem8">
<property name="label">gtk-paste</property>
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="imagemenuitem9">
<property name="label">gtk-delete</property>
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menu_dataanalysis">
<property name="visible">True</property>
<property name="label" translatable="yes">Data Analysis</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="menu4">
<property name="visible">True</property>
<child>
<object class="GtkImageMenuItem" id="menuitem_pca">
<property name="label" translatable="yes">PCA</property>
<property name="visible">True</property>
<property name="image">image1</property>
<property name="use_stock">False</property>
<signal name="activate" handler="on_menuitem_activate"/>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_hca">
<property name="label" translatable="yes">HCA</property>
<property name="visible">True</property>
<property name="image">image2</property>
<property name="use_stock">False</property>
<signal name="activate" handler="on_menuitem_activate"/>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_pls">
<property name="label" translatable="yes">PLS</property>
<property name="visible">True</property>
<property name="image">image3</property>
<property name="use_stock">False</property>
<signal name="activate" handler="on_menuitem_activate"/>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_knn">
<property name="label" translatable="yes">KNN</property>
<property name="visible">True</property>
<property name="image">image4</property>
<property name="use_stock">False</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_svm">
<property name="label" translatable="yes">SVM</property>
<property name="visible">True</property>
<property name="image">image5</property>
<property name="use_stock">False</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menu_help">
<property name="visible">True</property>
<property name="label" translatable="yes">Help</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="menu3">
<property name="visible">True</property>
<child>
<object class="GtkImageMenuItem" id="imagemenuitem10">
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menuitem1">
<property name="visible">True</property>
<property name="label" translatable="yes">menuitem1</property>
<property name="use_underline">True</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<child>
<object class="GtkTreeView" id="treeview_models">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">treestore1</property>
<property name="hover_selection">True</property>
<property name="hover_expand">True</property>
<property name="enable_grid_lines">horizontal</property>
<property name="enable_tree_lines">True</property>
<signal name="button_press_event" handler="teste_function"/>
<child>
<object class="GtkTreeViewColumn" id="chem_models">
<property name="title">Chemometrics Models</property>
<child>
<object class="GtkCellRendererText" id="pca_models">
<property name="text">PCA Models</property>
</object>
</child>
<child>
<object class="GtkCellRendererText" id="hca_models">
<property name="text">HCA Models</property>
</object>
</child>
<child>
<object class="GtkCellRendererText" id="pls_models">
<property name="text">PLS models</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkStatusbar" id="statusbar1">
<property name="visible">True</property>
<property name="spacing">2</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="stock">gtk-missing-image</property>
</object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="stock">gtk-missing-image</property>
</object>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="stock">gtk-missing-image</property>
</object>
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="stock">gtk-missing-image</property>
</object>
<object class="GtkWindow" id="window_pca">
<property name="title" translatable="yes">PCA - Principal Components
Analysis</property>
<property name="window_position">center</property>
<signal name="delete_event" handler="on_window_delete_event"/>
<child>
<object class="GtkFrame" id="Options">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
<object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkFrame" id="frame1">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="label" translatable="yes">Preprocessing</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxEntry" id="comboboxentry1">
<property name="visible">True</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label"
translatable="yes"><b>Pre-Processing</b></property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame2">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
<object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="label" translatable="yes">Validate Methods</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxEntry" id="comboboxentry2">
<property name="visible">True</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="label" translatable="yes"><b>Validations
Options</b></property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="Option">
<property name="visible">True</property>
<property name="label" translatable="yes"><b>PCA
Options</b></property>
<property name="use_markup">True</property>
</object>
</child>
</object>
</child>
</object>
<object class="GtkWindow" id="window_hca">
<property name="title" translatable="yes">HCA - Hierarchical Clusters
Analysis</property>
<property name="window_position">center</property>
<signal name="delete_event" handler="on_window_delete_event"/>
<child>
<object class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="n_rows">3</property>
<property name="n_columns">3</property>
<child>
<object class="GtkButton" id="button1">
<property name="label" translatable="yes">button</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="stock">gtk-missing-image</property>
</object>
<object class="GtkWindow" id="window_pls">
<property name="title" translatable="yes">PLS - Partial Least
Squares</property>
<property name="window_position">center</property>
<signal name="delete_event" handler="on_window_delete_event"/>
<child>
<object class="GtkTable" id="table2">
<property name="visible">True</property>
<property name="n_rows">5</property>
<property name="n_columns">5</property>
<child>
<object class="GtkButton" id="button2">
<property name="label" translatable="yes">button</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
</interface>
_______________________________________________
Glade-users maillist ?- ?Glade-users at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-users
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]