[pygtk] Stupid focus question

1999-11-17 Thread Hassan Aurag

 Hi,

Ok here goes: I have a GnomeApp, which contains with set_content a term done with zvt 
and has a GtkTree inside a VBOX added to it using add_docked.

Now, I haven't been able (duh!) to make this thing understand that when I click or 
move in term space, I want it to get focus. 

Each time, I have to use arrows to get back to term!

Needless to say, it IS annoying!

How do I tell GnomeApp or term that whenever someone clicks on it or enters it with 
the mouse to grab focus. 

I haven't found a "clicked" signal for term or its container.

So my stupid question is simple. 

How in heavens can I make this work? What is the signal? And how to use it?

Also, in the term I launch a onecmd() type app by forking the term.

All goes well, except that the first line of input eats itself whenever the line goes 
to second line, but everything is ok with 3rd 

You can check the behavior and look at code by getting
http://www.crm.umontreal.ca/~aurag/mine/gmath-0.0.5.tar.gz

Any help is appreciated!


H. Aurag

To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] Stupid focus question

1999-11-17 Thread James Henstridge

There is a GtkWidget.grab_focus() method to grab the focus for a widget.
You may want to connect to the enter_notify_event to make the terminal
grab focus when the cursor enters the terminal window.  The other option
is to remove focusability of some other widgets with
GtkWidget.unset_flags(CAN_FOCUS) (this would mean you can't use tab to
change focus to those widgets -- you have to use the mouse).  The ZvtTerm
widget is a bit weird with respect to focus.

James.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


On Wed, 17 Nov 1999, Hassan Aurag wrote:

  Hi,
 
 Ok here goes: I have a GnomeApp, which contains with set_content a term done with 
zvt and has a GtkTree inside a VBOX added to it using add_docked.
 
 Now, I haven't been able (duh!) to make this thing understand that when I click or 
move in term space, I want it to get focus. 
 
 Each time, I have to use arrows to get back to term!
 
 Needless to say, it IS annoying!
 
 How do I tell GnomeApp or term that whenever someone clicks on it or enters it with 
the mouse to grab focus. 
 
 I haven't found a "clicked" signal for term or its container.
 
 So my stupid question is simple. 
 
 How in heavens can I make this work? What is the signal? And how to use it?
 
 Also, in the term I launch a onecmd() type app by forking the term.
 
 All goes well, except that the first line of input eats itself whenever the line 
goes to second line, but everything is ok with 3rd 
 
 You can check the behavior and look at code by getting
 http://www.crm.umontreal.ca/~aurag/mine/gmath-0.0.5.tar.gz
 
 Any help is appreciated!
 
 
 H. Aurag
 
 To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
 

To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] Stupid focus question

1999-11-17 Thread Hassan Aurag


 Thanks,

It works, actually by unset_flags(CAN_FOCUS) in all other boxes and 
sub-boxes since zvt is added to GnomeApp by a set_contents, It seems 
to give it default focus.

 Now it works, thanx again!

 Btw, zvt.match_add seems to miss a third argument. It is defined as 
_zvt.zvt_match_add(regex, highlight, None).

 What would happen if I changed that to support callbacks or whatever 
they are so that people can right click and do something with them!

 More importantly, how to change them? An example of callback, signal 
whatever would be nice. Example like: click on it will open netscape 
with that url?!?!?!?!?!?

 I am working with pygnome-1.0.50-1, and pygtk-0.6.3-1 from 
october-gnome.


 Original Message 

On 11/17/99, 8:17:29 PM, James Henstridge [EMAIL PROTECTED] wrote 
regarding Re: [pygtk] Stupid focus question:


 There is a GtkWidget.grab_focus() method to grab the focus for a 
widget.
 You may want to connect to the enter_notify_event to make the terminal
 grab focus when the cursor enters the terminal window.  The other 
option
 is to remove focusability of some other widgets with
 GtkWidget.unset_flags(CAN_FOCUS) (this would mean you can't use tab to
 change focus to those widgets -- you have to use the mouse).  The 
ZvtTerm
 widget is a bit weird with respect to focus.

 James.

 --
 Email: [EMAIL PROTECTED]
 WWW:   http://www.daa.com.au/~james/   http://www.daa.com.au/~james/


 On Wed, 17 Nov 1999, Hassan Aurag wrote:

   Hi,
 
  Ok here goes: I have a GnomeApp, which contains with set_content a 
term done with zvt and has a GtkTree inside a VBOX added to it using 
add_docked.
 
  Now, I haven't been able (duh!) to make this thing understand that 
when I click or move in term space, I want it to get focus.
 
  Each time, I have to use arrows to get back to term!
 
  Needless to say, it IS annoying!
 
  How do I tell GnomeApp or term that whenever someone clicks on it or 
enters it with the mouse to grab focus.
 
  I haven't found a "clicked" signal for term or its container.
 
  So my stupid question is simple.
 
  How in heavens can I make this work? What is the signal? And how to 
use it?
 
  Also, in the term I launch a onecmd() type app by forking the term.
 
  All goes well, except that the first line of input eats itself 
whenever the line goes to second line, but everything is ok with 3rd 
 
  You can check the behavior and look at code by getting
  http://www.crm.umontreal.ca/~aurag/mine/gmath-0.0.5.tar.gz
 
  Any help is appreciated!
 
 
  H. Aurag
 
  To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
 

 To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]