Shifted area of button sensibilty

The following code reproduces the problem.
All design is stripped-off for brevity.

This are normally two files, DHead my
replacement of message boxes. DHead.vOutest
is there for adding other widgets thereby
creating more dialogs with all have
a click into the top area as "Cancel".

The problem disappears, when the
set_opacity line is commented out.

This is on WindowsXP, the stable
runtime bundle from
with gtk.2.16.6 and pygtk 2.12.

I have the same problem under
depikt (my own python gate to gtk) -
there are more problems in an __init__
for subclasses of gtk.Window().

Thus we have a basic problem with
python here or a problem with gtk,
what is much more probable. Of course
this is a very deeply hidden bug -
that is why i asked only for a
page in some text anywhere.

# -*- coding: utf-8 -*-
import sys
import pygtk
import gtk
from gtk.gdk import color_parse as colop
from os.path import dirname

def loeschen(widget, event): return False
def destruct(widget = None): gtk.main_quit()

class DHead(gtk.Window):
    """ To be used in a subprocess. This simplifies waiting for user-Input. """
    def escape(q, unused_widget, unused_event = None): q.destroy(); destruct()
    def __init__(q, s):
        gtk.Window.__init__(q, gtk.WINDOW_TOPLEVEL)
        q.set_title('Note') # for the taskbar
        q.set_property('opacity', 1.0) # avoids a gtk-warning about SetWindowLong
        q.set_property('decorated', False)
        q.modify_bg(0, colop('#520'))
        q.connect('delete_event', loeschen)
        q.connect('destroy', destruct)

        q.vOutest = gtk.VBox();

        ev = gtk.EventBox(); ev.modify_bg(0,colop("#fa9")); ev.set_above_child(True) = gtk.Label(s);, 21)'Verdana bold 12'));
        ev.connect('button_press_event', q.escape)
        ev.connect('key_release_event', q.escape)

        q.vOutest.pack_start(ev, fill=True,expand=True)

class Dia(DHead):
    """ To be used in a subprocess. This simplifies waiting for user-Input. """
    def act(q, widget, event):
        if event.hardware_keycode in (27, 13):
            print widget.get_text() # writes on a pipe to the parent
    def escape(q, unused_w, unused_e):
        print ''

    def __init__(q, s, default = ''):
        DHead.__init__(q, s)
        q.e = gtk.Entry(); q.e.set_alignment(0.5);; q.e.set_text(default)
        q.e.modify_base(0, colop('#f0e0c0'))
        q.e.modify_font(pango.FontDescription('Verdana 14'))
        q.e.connect('key_release_event', q.act)
        q.vOutest.pack_start(q.e, fill=False,expand=False)

    s = sys.argv[2]
    D = Dia(sys.argv[1], s)
    try: D = Dia(sys.argv[1])
    except: D = Dia('Bug in OKamba - Question missing')


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