[Sugar-devel] Screen Reposition?

Art Hunkins abhunkin at uncg.edu
Tue Aug 4 19:16:21 EDT 2009


With gtk.Label and gtk.Frame, I've been able to use the set_use_markup() 
property to get larger fonts, bold, italics, etc - by including XML markup 
in my text strings.

However, this property does not exist for gtk.Button.

Here is the relevent portion of a callback button that works fine (but no 
markup capability):

   def cbbutton(self,box,callback,title=""):
       butt = gtk.Button(" %s " % title)

I tried unsuccessfully to add markup capability to the title by modifying 
like this:

   def cbbutton(self,box,callback,title=""):
       label = gtk.Label(title)
       label.set_use_markup(True)
       butt = gtk.Button(" %s " % label)

Can this be made to work? (Sorry my PyGTK chops are so rudimentary.)

Art Hunkins


----- Original Message ----- 
From: "Art Hunkins" <abhunkin at uncg.edu>
To: "Gary C Martin" <gary at garycmartin.com>
Cc: <sugar-devel at lists.sugarlabs.org>
Sent: Tuesday, August 04, 2009 6:31 PM
Subject: Re: [Sugar-devel] Screen Reposition?


> Thanks, Gary.
>
> The variable is where you said ~/.Xclients). Changing SUGAR_SCALING to 100 
> does make for nice, larger icons and graphics, but as you indicated, no 
> larger fonts!
>
> Strangely, the new experimental SoaS issue (v2) does not respond to a 
> change to 100 (no larger graphics at all).
>
> Just for fun, I specified a value of 150, and on reboot got faced with the 
> blue login screen - with a very large "Login" graphic, and a tiny login 
> box. I couldn't get past this screen and needed to reset my computer.
>
> Complete dead end. I'm continuing my work with set_use_markup() - which 
> works fine with gtk.Frame and gtk.Label, but I've yet to get to work with 
> gtk.Button.
>
> Art Hunkins
>
> ----- Original Message ----- 
> From: "Gary C Martin" <gary at garycmartin.com>
> To: "Art Hunkins" <abhunkin at uncg.edu>
> Cc: <bens at alum.mit.edu>; <sugar-devel at lists.sugarlabs.org>
> Sent: Monday, August 03, 2009 10:46 PM
> Subject: Re: [Sugar-devel] Screen Reposition?
>
>
>> Hi Art,
>>
>> On 4 Aug 2009, at 02:42, Art Hunkins wrote:
>>
>>> At:
>>> http://dev.sugarlabs.org/ticket/39
>>> I found the following observation:
>>>
>>> "I think that the right solution for such a tiny display is to
>>> globally
>>> scale the display, using the bin/sugar to set SUGAR_SCALING to 72. The
>>> question is, how to detect display resolution from this shell
>>> script? The
>>> only solution I can think of is an evil hack involving xrandr and
>>> sed, and
>>> there has to be a better way."
>>
>> Historically, all Activities were designed for the XO display at
>> 1200x900 with a scaling value of 100. Now that Sugar is running on a
>> whole range of screens this has complicated layout somewhat. Setting
>> scaling to 72 would be ideal for an 864x553, giving a widget layout
>> that is equivalent to an XO display. The scaling setting as I
>> understand it is something picked up from the GNOME world, 72 and 100
>> are the only two supported values. Scaling does not affect font sizes
>> (that's another whole hot potato).
>>
>>> I'd like to experiment with setting SUGAR_SCALING, but cannot locate
>>> bin/sugar on SoaS. Can anyone give me the appropriate file/location?
>>
>> It's an environment variable (open a terminal and type echo
>> $SUGAR_SCALING to see what value it inherited). Where it's set depends
>> somewhat on the distro, but I last saw it was in ~/.Xclients
>>
>>> My idea is that if this variable works to "resize the screen", maybe
>>> this
>>> value might be temporarily "reset" by a python script.
>>
>> I'm not convinced that would be a wise thing to try ;-)
>>
>> Sounds like the fun you've been having is in creating a flexible GTK +
>> layout, or with some widget that wasn't designed to scale. Sorry I
>> haven't been able to give direct feedback on your code posted so far
>> but I'm rather backlogged at the moment (and am no great expert
>> myself, I'd just have to go poke my way through the GTK+ API docs
>> again).
>>
>> Regards,
>> --Gary
>>
>> _______________________________________________
>> Sugar-devel mailing list
>> Sugar-devel at lists.sugarlabs.org
>> http://lists.sugarlabs.org/listinfo/sugar-devel
> 



More information about the Sugar-devel mailing list