Re: [pygtk] How do I get the row count from a CList/CTree?

1999-12-17 Thread Matt Wilson

You really shouldn't set private data manually like this.  The
jump signal is much better.

Matt

On Thu, Dec 16, 1999 at 06:18:34PM -0600, Daniel Kornhauser wrote:
> I think this C function does the trick but I haven't found a way to do it
> in python :-(.
> 
> void 
>gtk_clist_set_focus_row(GtkCList *list, guint row) 
>{ 
>g_return_if_fail(list != NULL); 
>g_return_if_fail(row >= 0); 
>g_return_if_fail(row < list->rows); 
> 
>list->focus_row = row; 
>} 
> 
> Hope this helps, I you find a good way to focus row in CList I would be
> happy to hear about it!!!
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] How do I get the row count from a CList/CTree?

1999-12-16 Thread Daniel Kornhauser

> Another question about CLists: is there a good way to set the focus
> row to a given position, even on C level? The only way I have found is
> to emit a scroll_vertical signal with SCROLL_JUMP, which expects a
> relative value (0..1) for the postion; you need the number rows to
> calculate this value.

I think this C function does the trick but I haven't found a way to do it
in python :-(.

void 
   gtk_clist_set_focus_row(GtkCList *list, guint row) 
   { 
   g_return_if_fail(list != NULL); 
   g_return_if_fail(row >= 0); 
   g_return_if_fail(row < list->rows); 

   list->focus_row = row; 
   } 

Hope this helps, I you find a good way to focus row in CList I would be
happy to hear about it!!!

Daniel Kornhauser

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



Re: [pygtk] How do I get the row count from a CList/CTree?

1999-12-15 Thread David M. Cook

On Mon, Dec 13, 1999 at 12:35:44PM -0500, John Ehresman wrote:

> Is there any method or attribute that will return the # of rows of data in
> a CList (and CTree by extension)?

For a clist I just keep track of the last row I appended:

for row in rows:
last = clist.append(row)


Also, if you don't know how may rows you have you can wrap row access in a
try/except block:

i = 0
while 1:
try:
text = clist.get_text(i, col)
# do something with text
i = i + 1
except:
break

I would like to have an accessor method for this, though.

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



Re: [pygtk] How do I get the row count from a CList/CTree?

1999-12-15 Thread James Henstridge

You would use the GtkCTree.node_moveto function.  You probably want
something like:
  ctree.node_moveto(node, 0, 0.5, 0.0)

The second argument is a column number, the third is the vertical row
alignment, and the last is the column alignment (I used 0.0 to put the 0th
column at the left of the display).

James.

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


On 15 Dec 1999, Andreas Degert wrote:

> John Ehresman <[EMAIL PROTECTED]> writes:
> 
> Another question about CLists: is there a good way to set the focus
> row to a given position, even on C level? The only way I have found is
> to emit a scroll_vertical signal with SCROLL_JUMP, which expects a
> relative value (0..1) for the postion; you need the number rows to
> calculate this value.
> To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
> 

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



Re: [pygtk] How do I get the row count from a CList/CTree?

1999-12-15 Thread Andreas Degert

John Ehresman <[EMAIL PROTECTED]> writes:

> Is there any method or attribute that will return the # of rows of data in
> a CList (and CTree by extension)?

I don't know about any way to get this info in pygtk. The CList has an 
instance variable rows which could be wrapped by pygtk.

Another question about CLists: is there a good way to set the focus
row to a given position, even on C level? The only way I have found is
to emit a scroll_vertical signal with SCROLL_JUMP, which expects a
relative value (0..1) for the postion; you need the number rows to
calculate this value.
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]