GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Oct 31, 2014 11:22 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Gtk3.0 Gtkbuttons and junctions sides
PostPosted: Wed Nov 27, 2013 12:40 am 
Offline
Familiar Face

Joined: Wed Jan 30, 2013 8:28 pm
Posts: 20
I'm trying to align many GtkButton with junction sides but the result is not what I want...some help please

my code: it is a python code for Gtk3.0 (3.6) I'm on ubuntu 13.04

Code:
import gi.repository
from gi.repository import Gtk

def dest(widget):
    widget.destroy()
    Gtk.main_quit()


win = Gtk.Window(Gtk.WindowType.TOPLEVEL)
hbox = Gtk.Box()
bt0 = Gtk.Button.new_with_label("Zero")
bt1 = Gtk.Button.new_with_label("One")
bt2 = Gtk.Button.new_with_label("Two")
bt0.get_style_context().set_junction_sides(Gtk.JunctionSides.RIGHT)
bt1.get_style_context().set_junction_sides(Gtk.JunctionSides.LEFT|Gtk.JunctionSides.RIGHT)
bt2.get_style_context().set_junction_sides(Gtk.JunctionSides.LEFT)
win.connect("destroy", dest)
hbox.pack_start(bt0, False, False, 0)
hbox.pack_start(bt1, False, False, 0)
hbox.pack_start(bt2, False, False, 0)
win.add(hbox)
win.show_all()
Gtk.main()


Top
 Profile  
 
 Post subject: Re: Gtk3.0 Gtkbuttons and junctions sides
PostPosted: Wed Nov 27, 2013 8:16 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 768
Location: UK
Hello,

gtk_style_context_set_junction_sides() is a hint :- from the documentation
Quote:
Sets the sides where rendered elements (mostly through gtk_render_frame()) will visually connect with other visual elements.

This is merely a hint that may or may not be honored by theming engines.

Container widgets are expected to set junction hints as appropriate for their children, so it should not normally be necessary to call this function manually.


You would normally use the container to provide alignment for buttons. Since you have NOT stated what you your code to do it is hard to say what is needed.

_________________
E.


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: Yahoo [Bot] 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group