GtkSwitch + Toolbar



So, I'm trying to fit a Gtk.Switch widget into a Toolbar and it works
perfectly, except that when I add the class "primary-toolbar" to
Toolbar's StyleContext, the Switch widgets starts behaving oddly.

The Toolbar essentially steals the drag event from the Switch widget.
When I click on the switch widget, it does not activate but the
toolbar's drag event activates. Middle or Right Clicking the switch
widget works fine as toolbar does not catch that for drag.

To reproduce,

   from gi.repository import Gtk, GObject

   window = Gtk.Window()
   toolbar = Gtk.Toolbar()
   toolitem = Gtk.ToolItem()
   switch = Gtk.Switch()

   toolitem.add(switch)
   toolbar.add(toolitem)
   window.add(toolbar)

   window.show_all()

   GObject.MainLoop().run()


If this is a bug and will have to wait for it to be fixed, is there a
way I can prioritize switch's drag event more than toolbars, so it
works for now?

-- 
Owais Lone
hello owaislone org
http://www.owaislone.org



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]