Re: [pygtk] gtk.Action.connect_proxy

2008-03-14 Thread John Finlay

Geoff Bache wrote:
The tooltip is only set on a ToolItem but the stock icon will be used 
if you set the "use-stock" property of the button to True:


button.set_use_stock(True)

John

Thanks John,

Unfortunately this seems to have the effect that the label text is 
derived from the stock icon's name rather than the title of the 
action! So then I have to transfer the label by hand instead...


Do you know if there is any reason why the tooltip isn't transferred 
(and why you can transfer the stock icon or the label, but not both!)? 
It's easy to transfer both by hand of course, but when the docs 
promise to do it for you it seems a bit weird...


The tooltip isn't set because there's no code to set it probably because 
of the way the older (<2.12) tooltips were done. You could file a 
feature bug report against GTK to add syncing tooltips for buttons.


For buttons specifying a label seems mutually exclusive with specifying 
a stock id.


The docs state that various properties are synced but not that all or 
conflicting or unused properties are synced though it would be useful if 
there was more detail about how these were applied for the various proxy 
objects.


John
___
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] gtk.Action.connect_proxy

2008-03-14 Thread Geoff Bache
The tooltip is only set on a ToolItem but the stock icon will be used 
if you set the "use-stock" property of the button to True:


button.set_use_stock(True)

John

Thanks John,

Unfortunately this seems to have the effect that the label text is 
derived from the stock icon's name rather than the title of the action! 
So then I have to transfer the label by hand instead...


Do you know if there is any reason why the tooltip isn't transferred 
(and why you can transfer the stock icon or the label, but not both!)? 
It's easy to transfer both by hand of course, but when the docs promise 
to do it for you it seems a bit weird...


Regards,
Geoff

___
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] Dynamically resize text to fit a fixed sized label

2008-03-14 Thread Vláďa
Maybe this would help: 
http://faq.pygtk.org/index.py?req=show&file=faq04.015.htp


Vlada

F Wolff napsal(a):

Op Dinsdag 2008-03-11 skryf Darwin Bautista:
  

Hi all,

I'm planning to dynamically resize the text to fit a fixed sized label
when it overflows.
How do I determine if a certain text (variable length) will overflow a
fixed sized label?
Also, is there a way of estimating the required font size for the text
to fit inside the label?

Thanks in advance.




Hi Darwin

I think you need to look at something like pango.Layout which
has .get_pixel_size(). I don't think there will be an easy way of
estimating the font size.

If you have non-ascii users in mind, realise that you might need to keep
height in mind as well, and that translations of text might be a lot
longer than you planned for. If you make the font a lot smaller to fit
into a button, things might end up not being readable. But I'm guessing
a few things between the lines of your message.

Groete
Friedel

___
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 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/