473,386 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

[PyGTK] forbid focus of TreeView columns

Hi all,

I'm building a PyGTK interface in which I would like that no widget
would be able to get the focus (and so to be activated by pressing the
Return key). For this purpose, for each widget, I do:

widget.set_property("can-focus", gtk.FALSE)

My problem is a TreeView which has a clickable column, it get the
default focus and I did not find how to forbid that.

I tried:

def focus (widget, *args) :
try :
widget.set_property("can-focus", gtk.FALSE)
except :
pass
try :
widget.set_property("can-default", gtk.FALSE)
except :
pass
win.forall(focus)

where win is my application window (I also tried on the TreeView) but it
doesn't work. :-(
I also tried with widget.unset_flags, same result. :-((

If I choose another widget and give it the default focus
(widget.grab_default and widget.grab_focus) it's OK until I click on the
column which then keeps the focus. :-(((

I'm sure I could capture the Return key but I don't want to have this
dashed line around the focused widget...

I think that this column has somewhere an associated widget but I could
not find it anywhere (and neither could win.forall).

I'm using PyGTK-2.0.0 and cannot use another version.

Thanks in advance for any idea!
Franck
Jul 18 '05 #1
0 2094

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andre Lerche | last post by:
Hi list, I am quite new to Python and try to learn Python with a small pygtk program. I am facing a problem which I am unable to solve for myself. I think I have read the documentation and some...
2
by: Samuele Giovanni Tonon | last post by:
hi, i'm trying to develop a trivial application which random copy files from a directory to another one. i made it using pygtk for the graphical interface, however i find some problem with...
0
by: manatlan | last post by:
Hello, I'm new to pygtk (but i know wxpython very well) I'm trying to play with this example : http://www.pygtk.org/pygtk2tutorial/sec-CellRenderers.html#filelistingfig (the code is here :...
1
by: Rasmus | last post by:
I need to grab focus to a specific node i my treeview when I click on my listbox. Here's the code that differs between the different event i the listBox: private void...
2
by: Tim N. van der Leeuw | last post by:
I tried to create a windows executable of a pygtk program. My first attempt worked, kinda, except that no themes were applied and no readable fonts were found by pango; so all letters where just...
0
by: Chris Johnson | last post by:
Good morning. I have recently begun a project using PyGTK, and part of my planned interface has a gtk.TreeView showing a portion of the filesystem. Now, rather than load the entire FS structure...
0
by: Peter TB Brett | last post by:
Hi folks, I'm currently trying to work out how to detect when a PyGTK window receives the focus from the window manager -- I assume that it must receive some kind of X event, but I can't work...
0
by: Fabian Braennstroem | last post by:
Hi, I am just testing pygtk/glade out and wonder, if I am able to change the keybindings. E.g. the treeview searches by default for the entries beginning with the typed keystroke; moving to the...
1
micmast
by: micmast | last post by:
Ey all, I'm currently working on an application that uses the pygtk libraries to create windows and widgets. I have a HBOX (2 boxes) in the middle and in the left one I have a treeview, in the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.