Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9144431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:16:05+00:00 2026-06-17T10:16:05+00:00

I have an window defined in a gtk-builder file made with Glade. It contains

  • 0

I have an window defined in a gtk-builder file made with Glade. It contains a gtk.Window, with a child gtk.TreeView with 2 gtk.TreeViewColumns:

<?xml version="1.0" encoding="UTF-8"?>
<interface>
    <requires lib="gtk+" version="2.20"/>
    <!-- interface-naming-policy project-wide -->
    <object class="GtkWindow" id="bookmarks_window">
        <property name="can_focus">False</property>
        <property name="events">GDK_KEY_PRESS_MASK | GDK_STRUCTURE_MASK</property>
        <property name="title" translatable="yes">Bookmarks</property>
        <property name="modal">True</property>
        <property name="default_width">350</property>
        <property name="default_height">200</property>
        <property name="destroy_with_parent">True</property>
        <property name="type_hint">menu</property>
        <property name="skip_taskbar_hint">True</property>
        <child>
          <object class="GtkScrolledWindow" id="bookmarks_scroll">
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="hscrollbar_policy">never</property>
            <property name="vscrollbar_policy">automatic</property>
            <child>
              <object class="GtkTreeView" id="bookmarks_tree">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="events">GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_STRUCTURE_MASK</property>
                <property name="headers_visible">False</property>
                <property name="headers_clickable">False</property>
                <property name="rules_hint">True</property>
                <property name="fixed_height_mode">True</property>
                <property name="show_expanders">False</property>
                <property name="enable_grid_lines">vertical</property>
                <child>
                  <object class="GtkTreeViewColumn" id="line_column">
                    <property name="sizing">fixed</property>
                    <property name="title" translatable="yes">Line</property>
                  </object>
                </child>
                <child>
                  <object class="GtkTreeViewColumn" id="text_column">
                    <property name="sizing">fixed</property>
                    <property name="title" translatable="yes">Text</property>
                  </object>
                </child>
              </object>
            </child>
          </object>
        </child>
    </object>
</interface>

I’m creating the window doing:

def show_window(parent_window):
    builder = gtk.Builder()
    builder.add_from_file("mywindow.ui")

    window = builder.get_object('bookmarks_window')
    window.set_transient_for(parent_window)

    tree = builder.get_object('bookmarks_tree')
    tree.set_search_column(1)

    store = gtk.TreeStore(int, str)
    for i in xrange(1, 6):
        store.append((i, "Line {}".format(i)))
    tree.set_model(store)

    line_renderer = gtk.CellRendererText()
    line_column = builder.get_object('line_column')
    line_column.pack_start(line_renderer)
    line_column.set_attributes(line_renderer, text=0)

    text_renderer = gtk.CellRendererText()
    text_column = builder.get_object('text_column')
    text_column.pack_start(text_renderer)
    text_column.set_attributes(text_renderer, text=1)

    window.show_all()

This will only show the “Text” column:

+---------------+
| Line 1        |
| Line 2        |
| Line 3        |
| Line 4        |
| Line 5        |
+---------------+

If I change the order of the gtk.TreeViewColumns in the interface file from:

<child>
  <object class="GtkTreeViewColumn" id="line_column">...</object>
</child>
<child>
  <object class="GtkTreeViewColumn" id="text_column">...</object>
</child>

to:

<child>
  <object class="GtkTreeViewColumn" id="text_column">...</object>
</child>
<child>
  <object class="GtkTreeViewColumn" id="line_column">...</object>
</child>

Only the “Line” column will display:

+---------------+
| 1             |
| 2             |
| 3             |
| 4             |
| 5             |
+---------------+

But I want it to look like:

+---+-----------+
| 1 | Line 1    |
| 2 | Line 2    |
| 3 | Line 3    |
| 4 | Line 4    |
| 5 | Line 5    |
+---+-----------+

Changing the order of the gtk.TreeViewColumns in the interface file is changing what column is displayed, which doesn’t make sense to me. It’s always hiding the first column. Does anyone know what I am missing or overlooking? Any help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T10:16:06+00:00Added an answer on June 17, 2026 at 10:16 am

    You set column sizing mode to “fixed” (I assume you need this for performance reasons), yet do not set fixed-width property. Set it to any value on both columns and they will appear.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my xaml code, inside the Window.Resources section, I have defined a Data Template
I have the following Window defined: <Window x:Class=ShortCutInTabControlproblem.MainWindow xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title=MainWindow Height=350 Width=525> <DockPanel>
I have a window containing multiple QRowWidget s, which are custom widgets defined by
I have an unload and beforeunload event defined as: window.onunload = (function () {
I have a WPF window that contains a DataGrid at the bottom half of
Hey guys! Here is the deal... I have a ComboBox defined in my window.
Suppose I have a Window displaying a UserControl. The UserControl contains a TextBox which
So, I have this Window with some controls. In the resources section I've defined
How is IXRTextBlockPtr used? I have a XAML file that is made by Expression
I have a window defined with a style: <Window x:Class=winBorderless x:Name=winBorderless xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:Local=clr-namespace:WindowStyle

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.