WPF Label
import clr
clr.AddReference("PresentationFramework")
clr.AddReference("PresentationCore");
clr.AddReference('System.Data')
clr.AddReference('System.Windows.Forms')
import System
from System import *
from System.Data import *
from System.Type import GetType
from System.Threading.Tasks import Task
from System.Windows import *
from System.Windows.Controls import *
from System.Windows.Controls.Primitives import *
from System.Windows.Media import *
from System.Windows.Media.Imaging import *
from System.Windows.Media.Effects import *
from System.Windows.Shapes import Rectangle
from System.Windows.Shapes import Rectangle
from System.Windows.Data import Binding
from System.Windows.Ink import Stroke
from System.Windows.Forms import ( FolderBrowserDialog, DialogResult )
from Microsoft.Win32 import ( OpenFileDialog, SaveFileDialog )
import ctrl
class WpfLabel(ctrl.WpfCtrl):
def __init__(self,text=None,background=None,**kwargs):
self.ctrl = Label()
self.init(**kwargs)
if text: self.ctrl.Content = text
if background: self.ctrl.Background = background
self.ctrl.HorizontalAlignment = HorizontalAlignment.Stretch
self.ctrl.VerticalAlignment = VerticalAlignment.Center
if __name__ == "__main__":
import win
app = win.Win("Button Demo",320,240)
b = WpfLabel("Hello World",Brushes.SkyBlue)
app.set_content(b.ctrl)
app.run()
댓글 없음:
댓글 쓰기