Re: [pygtk] TreeView - Making whole row colored

2008-01-30 Thread Stephen George


Neil Dugan wrote:

Stephen George wrote:

Hi,

I am trying to get a treeview (with liststore model) to display rows 
in different colors based on content in the list.


"The most suitable approach for most cases is that you add two 
columns to your model, one for
the property itself (e.g. a column COL_ROW_COLOR of type 
G_TYPE_STRING), and one for the boolean flag of
the property (e.g. a column COL_ROW_COLOR_SET of type 
G_TYPE_BOOLEAN). You would then connect these
columns with the "foreground" and "foreground-set" properties of each 
renderer. Now, whenever you set
a row’s COL_ROW_COLOR field to a colour, and set that row’s 
COL_ROW_COLOR_SET field to TRUE, then

this column will be rendered in the colour of your choice.




Hi Steve,

I can't see the pattern in why the colors are how they are.  I think 
some of the trouble has to be with some 'foreground-color' set as None.


It would probably be better to not use the 'Modified' column to affect 
the color, and just put the color you want the row in the 
'foreground-color' column (i.e. red,black or blue) and change the 
set-up to.


column.add_attribute(mycell, 'foreground', COLUMN_FOREGROUND)
mycell.set_property('foreground-set', True)




Regards Neil.

Hi Neil,

Thanks for the reply.

I'm not sure whats happening, but it's not to do with 'foreground-color' 
set as None. ... I did a lot of testing before I started to introduce 
None for the color.

(According to pygtk reference None is the default value of that property)

I do have a system thats working for me now, .. but I suspect it only 
working because of some bug somewhere.


I totally ignore the foreground-set property, I never set it now, .. it 
seems to do nothing - set or not set


If I want to change the cells color, I put it in 'foreground-color' 
property, else I leave 'foreground-color' at None.


Thats it, .. it all works nicely like that. Ya, .. I know relying on 
undocumented behavior is bad, .. but I needed something that works now.


Cheers
Steve

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] using pango style on edited text

2008-01-30 Thread Stephen George

Hi,

I have a text buffer, that I wanted to display in bold, slightly larger 
font and with some margins, for entire buffer, no need to change styles. 
(like setting a default font)
All I want is to set the entire buffer/view to a predefined font/margin 
style, user will not have options to change it


It seems the only way was to use pango, .. am I missing something?

I implemented that in my text buffer, .. however if use the textview to 
enter new text at the end of the text buffer, .. it's not in pango 
style, ... no margins, no bold.

If I enter new text in middle of my buffer, it takes on existing style.

I don't know how to make that new text at end of buffer insert in pango 
style.


My application, . looks up a message for a selected item in a list box, 
and displays that in the textview.
When a new item is selected, I clear the textview, and use the function 
addToBuffer() to add the new text. A user could then edit the text to 
add additional info, .. but as can be seen in picture, that text is not 
in 'style'.


addToBuffer() is only used for the initial insertion, ..If then someone 
enters into the textView and adds text (as editable), .. I don't know 
how it knows what style to insert in. Am I meant to be adding some 
support code to get it to add in 'style'


   def createBufTags(self, textbuf):
   import pango
   table = textbuf.get_tag_table()
   tag = gtk.TextTag('marketspeak')
   tag.set_property( 'weight', pango.WEIGHT_BOLD)
   tag.set_property( 'foreground', "black")
   tag.set_property( 'left_margin', 10)
   tag.set_property( 'right_margin', 10)
   table.add(tag)


   def addToBuffer(self, buf, speak ):
   iter = buf.get_end_iter()
   buf.insert_with_tags_by_name(iter, speak , "marketspeak")


Thanks
Steve
<>___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] glade failing on Wiin32

2008-01-30 Thread Mathew Yeates

Hi

I installed pygtk and a small program is failing.
The line
gtk.glade.XML ('pyglade.glade', "window1")
gives the error
(python.exe:3440): libglade-CRITICAL **: glade_xml_build_interface: 
assertion `wid != NULL' failed


I'm trying to figure out whats wrong. I'm wondering if there is a 
problem with my pygtk installation. I get a dialog box that says
"register for the following environments" but my only choice is Cygwin. 
I think this might be a problem since python uses the msvc libs.


Why doesn't the installer see that I have MSVC?

Mathew


___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] How to set background on a textview

2008-01-30 Thread Stephen George

Rafael Villar Burke wrote:

Stephen George wrote:
  

Hi,

I'm confused  about setting the background color on a textview. 


Did you try modifying the base color instead of the background one? Text
uses 'base' instead of background.

Have fun,

Rafael Villar Burke
  

Thankyou Rafael, ... that was exactly what I am looking for

Cheers
Steve
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] pygtk 2.12 win32 binaries?

2008-01-30 Thread Maximilian Wilson
On Jan 30, 2008 3:22 AM, Rafael Villar Burke <[EMAIL PROTECTED]> wrote:

> It looks like, though, there's not enough people interested in helping
> with this to make it go forward or the potentially interested ones don't
> have the information on how to join the effort or that it even exists.
>

I posted a message to this very list a month ago, asking for help to build
the latest GTK+ on MinGW with an eye toward posting the binaries somewhere.
Having not gotten any reply, I fought with it for a while and then said,
"Ah, skip it."

-Max

-- 
"The presentation or 'gift' of the Holy Ghost simply confers upon a man the
right to receive at any time, when he is worthy of it and desires it, the
power and light of truth of the Holy Ghost, although he may often be left to
his own spirit and judgment." --Joseph F. Smith (manual, p. 69)

Be pretty if you are,
Be witty if you can,
But be cheerful if it kills you.
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] pygtk 2.12 win32 binaries?

2008-01-30 Thread Rafael Villar Burke
Wildemar Wildenburger wrote:
> Rafael Villar Burke wrote:
>> Anyone willing to scratch this itch?  
> Willing maybe, but sure enough, I'm not proficient enough with C to be
> of substancial help. But tell you what: As soon as this note taking
> app of mine is in decent shape, I'll look into it (because I want the
> bugger to work on windows eventually; although "as soon as" does by no
> means imply "very soon").
>
> OTOH: Isn't the main impetus behind the win32 build The Gimp?
> Shouldn't those people be right on the ball, at least on the (C-)GTK-side?
Well, the C side should be ok. The main problem is packaging, not
building the binaries (they're published on the gtk.org website), and
for that what's needed, besides some win32 development experience, is
time, to play with the existing packaging solutions, see what needs to
be done and, ideally, see if a cross-platform solution can be used, so
the installer could be generated by the pygtk people and published in
the official website.

Today I've just discovered a sourceforge project that has updated gtk+
runtime installers and is using an tailored NSIS script (maybe based on
Alberto Ruiz's one?): http://gtk-win.sourceforge.net

The only problem with this projects is that they need some
standardization and that they usually depend on a single man's work, so
they're not as sustainable as a well documented and easy to reproduce
procedure.

Regards,

Rafael Villar Burke



___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] pygtk 2.12 win32 binaries?

2008-01-30 Thread Wildemar Wildenburger

Rafael Villar Burke wrote:

AFAIK, it's mainly a manpower problem and having one or two commited
people willing to properly document and give some more care to the
building and packaging process on windows can really make a huge 
difference.


[snip lots of info :)]
Anyone willing to scratch this itch?

  
Willing maybe, but sure enough, I'm not proficient enough with C to be 
of substancial help. But tell you what: As soon as this note taking app 
of mine is in decent shape, I'll look into it (because I want the bugger 
to work on windows eventually; although "as soon as" does by no means 
imply "very soon").


OTOH: Isn't the main impetus behind the win32 build The Gimp? Shouldn't 
those people be right on the ball, at least on the (C-)GTK-side?


/W
(sorry for the off-list reply, I should really get Thunderbird fixed)
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] pygtk 2.12 win32 binaries?

2008-01-30 Thread Rafael Villar Burke
Alec Hussey wrote:
> On the other hand GTK seems to be a real pain in the ass to setup on
> any system other than BSD/Linux. Its really disappointing. So I can
> only hope that these people (GTK and PyGTK respectively) start taking
> notice of the need for better cross-platform support and start making
> some changes.
AFAIK, it's mainly a manpower problem and having one or two commited
people willing to properly document and give some more care to the
building and packaging process on windows can really make a huge difference.

GTK+ binaries for windows are being built and offered on the www.gtk.org
website (http://gtk.org/download-windows.html), but we lack convenient
packaging and the build process is indeed in need of better documentation.

It looks like, though, there's not enough people interested in helping
with this to make it go forward or the potentially interested ones don't
have the information on how to join the effort or that it even exists.

These are some resources that I hope can get some more people in it:

- There's a mailing list to coordinate the efforts to improve the win32
gtk+ packaging:
http://mail.gnome.org/mailman/listinfo/gtk-win32-list

- some more information about the current status can be found in Alberto
Ruiz's blog:
http://aruiz.typepad.com/siliconisland/2007/05/call_for_gtk_wi.html
http://aruiz.typepad.com/siliconisland/2007/05/gtkwin32_amateu.html
http://aruiz.typepad.com/siliconisland/2006/12/allinone_win32_.html

- John Stowers has blogged about how to build the gtk+ stack using
jhbuild on windows using msys and mingw:
http://www.johnstowers.co.nz/blog/index.php/2007/12/16/jhbuild-anything-on-windows-in-12-steps/
and has also explained his experience trying to get it to work:
http://www.johnstowers.co.nz/blog/index.php/2007/12/11/jhbuild-adventures-on-windows/
http://www.johnstowers.co.nz/blog/index.php/2007/12/13/jhbuild-and-windows-we-meet-again/
He, Alberto Ruiz and Fréderic Peters have made some changes to jhbuild
to make it work more easily on win32.
(http://www.0d.be/2008/01/07/new-adventures-in-jhbuild/ )

- There's some information on the gnome wiki on how to cross compile
gtk+ for win32 using jhbuild:
http://live.gnome.org/Cross_compiling_GTK%2B_for_Win32?highlight=%28win32%29

I've added this information to a blog post here:
http://blog.rvburke.com/2008/01/30/gtk-and-pygtk-on-win32/

Anyone willing to scratch this itch?

Have fun,

Rafael Villar Burke


___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] How to set background on a textview

2008-01-30 Thread Rafael Villar Burke
Stephen George wrote:
>
> Hi,
>
> I'm confused  about setting the background color on a textview. 
Did you try modifying the base color instead of the background one? Text
uses 'base' instead of background.

Have fun,

Rafael Villar Burke
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/