Exemplo n.º 1
0
 def __init__(self, text = "New Label", font = system_font, **kwds):
     width, height = font.text_size(text)
     gtk_label = gtk.Label(text)
     gtk_label.set_alignment(0.0, 0.5)
     gtk_label.set_size_request(width, height + self._vertical_padding)
     gtk_label.show()
     GLabel.__init__(self, _gtk_outer = gtk_label, font = font, **kwds)
Exemplo n.º 2
0
    def __init__(self, text = "New Label", font = system_font, **kwds):
        ns_textfield = self._create_ns_textfield(editable = False,
            text = text, font = font)
#		width, height = ns_textfield.frame().size
#		ns_view = NSView.alloc().initWithFrame_(((0, 0), (width, height + 5)))
#		ns_view.addSubview_(ns_textfield)
#		ns_textfield.setFrameOrigin_((0, 2))
#		ns_textfield.setAutoresizingMask_(ns_label_autoresizing_mask)
        ns_view = ns_textfield
        GLabel.__init__(self, _ns_view = ns_view, _ns_inner_view = ns_textfield, **kwds)
Exemplo n.º 3
0
	def __init__(self, text = "New Label", **kwds):
		self._set_lines(text)
		lines = self._lines
		font = self._win_predict_font(kwds)
		w = 0
		for line in lines:
			w = max(w, font.width(line))
		w = int(ceil(w))
		h = self._calc_height(font, len(lines))
		win = ui.CreateWnd()
		win.CreateWindow(None, None, win_style, (0, 0, w, h), win_none, 0)
		#win.ModifyStyleEx(0, wc.WS_EX_TRANSPARENT, 0)
		GLabel.__init__(self, _win = win, **kwds)
Exemplo n.º 4
0
 def __init__(self, text = "New Label", **kwds):
     self._set_lines(text)
     lines = self._lines
     font = self._win_predict_font(kwds)
     w = 0
     for line in lines:
         w = max(w, font.width(line))
     w = int(ceil(w))
     h = self._calc_height(font, len(lines))
     win = ui.CreateWnd()
     win.CreateWindow(None, None, win_style, (0, 0, w, h), win_none, 0)
     #win.ModifyStyleEx(0, wc.WS_EX_TRANSPARENT, 0)
     GLabel.__init__(self, _win = win, **kwds)