GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Dec 20, 2014 9:43 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Widgets in pygobject larger than normal
PostPosted: Thu Jan 19, 2012 1:16 pm 
Offline
Familiar Face

Joined: Mon Jan 16, 2012 5:10 pm
Posts: 11
In pygobject there is a border around the images that makes the button more than expected.
I want to create a panel with 24 pixels high, I put a ToggleButton with an icon of 22 pixels.
I got pygtk to leave things as they wanted, but now will not.
Other widgets also have this problem.
wnck the tasklist and pager for example.
If there are many buttons in tasklist they do not shrink!


What alternatives do I have?

#!/usr/bin/python
from gi.repository import Gtk

w = Gtk.Window()
w.set_size_request(24,24)
w.connect("destroy",Gtk.main_quit)

b = Gtk.ToggleButton()
i = Gtk.Image()
i.set_from_icon_name("start-here",Gtk.IconSize.LARGE_TOOLBAR)
b.set_image(i) # or b.add(i)

w.add(b)
w.show_all()
Gtk.main()


Top
 Profile  
 
 Post subject: Re: Widgets in pygobject larger than normal
PostPosted: Thu Jan 26, 2012 1:28 pm 
Offline
Never Seen the Sunlight

Joined: Wed Jul 23, 2008 10:31 am
Posts: 2406
Location: Slovenia
Hi.

Spacing inside widgets is defined by a GTK+ theme (IIRC, horizontal and vertical spacing is usually set to 2 px). If you want to make button as small as possible, you'll probably need to adjust your current button theme using some theme trickery. I haven't got up-to-speed with GTK+-3.0 theming yet, so I cannot help you with that. For GTK+-2.0, all you need to to is write down a simple string in you application and pass it to gtk_rc_parse_string() (not sure what would PyGTK equivalent be).

Cheers,
Tadej


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group