Re: [pygtk] Should PyGtk be proposed for the Python 2.4 release?

2003-03-25 Thread Dan Christian
On Monday 24 March 2003 06:43, Michael McLay wrote:
 Do you think it would be harmful to put the PyGtk package into the
 standard distribution prior to it being documented?

YES!  

The problems with Tkinter that you mentioned were always a black eye for 
Python acceptance.  Proposing another (semi) official GUI that isn't 
any better (on this front) simply won't help.

One of the ongoing problems is this idea of, just check the Tk/Gtk docs 
and then convert.  This has made it much harder for me to get started 
with PyGtk (and before that, with Tkinter).  The mapping from C to 
Python is not always obvious and finding which module contains a 
feature can be difficult.  By the way, this is a major problem with the 
wxPython documentation, too.

You really want to have a complete set of docs that stands independently 
from the  underlying library.  Maybe you maintain this automatically 
using the Gtk documentation, but the reader shouldn't have to know 
that.  There should at least be an authoritative reference manual and a 
mature programmers guide/tutorial.

Sorry if this is a bit flamish, but I'm a new PyGtk user (as are most 
people), and I've wasted a lot of time trying to extract the right 
information from the PyGtk and Gtk documentation.  It has gotten 
better, but there are still a lot of undocumented widgets and a lot of 
dark corners.

-Dan
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] Setting pushed color for a toggle

2003-03-05 Thread Dan Christian
I'd like to change the color of a ToggleButton when it is pushed in: 
preferably the background color, but the text color would work too.

I would guess that you can do this by setting the right color for the 
right state.  However, I can't find any documention about what state 
applies when.  This is probably obvious to the experts, but it needs a 
lot more discussion for a beginner like me.  For example, how is 
active different from selected?  What state is a toggle in when it 
is pressed?

Even worse, I don't know when to change with the button itself and when 
to change the label that displays the text (it's child).

I've tried everything that seemed obvious with no success.

Desperately seeking documentation.
-Dan
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Setting pushed color for a toggle

2003-03-05 Thread Dan Christian
On Wednesday 05 March 2003 16:31, Johan Dahlin wrote:
 Use widget.modify_bg(state, color), eg:

 button.modify_bg(gtk.STATE_ACTIVE, gtk.gdk.color_parse(#00ff00))

Actually, I had tried that, but there is yet another tricky bit.  The 
toggle gets re-drawn with the new color, but then get immediately drawn 
again in prelight mode.

Is there anything that defines the color conventions for the drawing 
modes?  For example, prelight is normally lighter than normal, but 
how do active and selected relate?

-Dan
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] color of draw_lines changes

2003-02-24 Thread Dan Christian
I'm running pygtk2-1.99.13 with RedHat 7.3.

When I do drawingArea.draw_lines() with a GC set to a specific 
foreground color, the first part of the line sequence will draw in the 
right color, but then the rest reverts to black.

The number of segments before the color change occurs is consistent 
across refreshes, but seems to change as the code changes (ranging from 
all the right color, to only the first segment being right).  

If I draw multiple lines, then they all change colors after the same 
number of segments.

Am I doing something wrong? 

Has this been fixed already?

-Dan
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] color of draw_lines changes

2003-02-24 Thread Dan Christian
On Monday 24 February 2003 09:29, Dan Christian wrote:
 When I do drawingArea.draw_lines() with a GC set to a specific
 foreground color, the first part of the line sequence will draw in
 the right color, but then the rest reverts to black.

Never mind, my bug.  

The color changes happens after you try to draw outside the drawing 
areas (off by 1 issue).  Still, sort of a odd symptom.

-Dan
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] position in scrolled window

2003-02-21 Thread Dan Christian
 I want it to display always the 
 lowest part of the widget inside it (a gtk.textview)

I found this to be more difficult that it looked.

The way that I did it for a scrolling text window is to set a Mark at 
the end of the buffer like this:

self.endMark = self.msgBuffer.create_mark (
end, self.msgBuffer.get_end_iter(), gtk.FALSE)

Then (after every text addition), I tell it to scroll to the end, like 
this:

self.msgPanel.scroll_to_mark (self.endMark, 0.05,
  gtk.TRUE, 0.0, 1.0)

The Mark will do the right thing about where it is in the buffer and 
how the idle task works.

How not to do it: scroll_to_iter looks like it will do the right 
thing, but there is a odd timing issue.  The new size of the text 
window won't be computed until all the drawing is done (it's an idle 
task).  However, get_end_iter and scroll_to_iter, happen 
immediately.  So you would tend to scroll near the end, but not quite 
to it (very frustrating).

Hope this helps,
-Dan
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/