[ MarkoBalkan @ 08.04.2008. 00:46 ] @
sredio VS.instalirao IronPython! stavim na formu neke kontrole, poslije točke samo naredbe iz pythona! a od kontroli ništa! znači svaki bi trebao znati napamet sve od C# da bi sa ovime mogao raditi! pošto je to mješanac C# i pythona, ne liči na ništa. kao i J# implementacija jave na .net. nema šta. ovaj code ispod je generirani code za formu, a onaj mali dio je moj code. uglavnom za početak katastrofa. ja ću se držati i dalje svojeg WXPythona! šta će mi onda IronPython na .net-u, ako tako mogu koristiti C#! htio sam isprobati, ali katastrofa do zla Boga! da se piše ručno, u wx-u bi ovo ispalo neki 15-20 linija. a ovdje sa generiranim oko 50-60. Citat: import System from System.Windows.Forms import * from System.ComponentModel import * from System.Drawing import * from clr import * class WindowsApplication2: # namespace class Form1(System.Windows.Forms.Form): """type(_textBox1) == System.Windows.Forms.TextBox, type(_textBox2) == System.Windows.Forms.TextBox, type(_label1) == System.Windows.Forms.Label, type(_button1) == System.Windows.Forms.Button""" __slots__ = ['_textBox1', '_textBox2', '_label1', '_button1'] def __init__(self): self.InitializeComponent() @accepts(Self(), bool) @returns(None) def Dispose(self, disposing): super(type(self), self).Dispose(disposing) @returns(None) def InitializeComponent(self): self._button1 = System.Windows.Forms.Button() self._textBox1 = System.Windows.Forms.TextBox() self._textBox2 = System.Windows.Forms.TextBox() self._label1 = System.Windows.Forms.Label() self.SuspendLayout() # # button1 # self._button1.Location = System.Drawing.Point(30, 134) self._button1.Name = 'button1' self._button1.Size = System.Drawing.Size(75, 23) self._button1.TabIndex = 0 self._button1.Text = 'button1' self._button1.UseVisualStyleBackColor = True self._button1.Click += self._button1_Click # # textBox1 # self._textBox1.Location = System.Drawing.Point(30, 13) self._textBox1.Name = 'textBox1' self._textBox1.Size = System.Drawing.Size(100, 20) self._textBox1.TabIndex = 1 # # textBox2 # self._textBox2.Location = System.Drawing.Point(30, 39) self._textBox2.Name = 'textBox2' self._textBox2.Size = System.Drawing.Size(100, 20) self._textBox2.TabIndex = 2 # # label1 # self._label1.AutoSize = True self._label1.Location = System.Drawing.Point(27, 62) self._label1.Name = 'label1' self._label1.Size = System.Drawing.Size(35, 13) self._label1.TabIndex = 3 self._label1.Text = 'label1' # # Form1 # self.ClientSize = System.Drawing.Size(292, 266) self.Controls.Add(self._label1) self.Controls.Add(self._textBox2) self.Controls.Add(self._textBox1) self.Controls.Add(self._button1) self.Name = 'Form1' self.Text = 'Form1' self.ResumeLayout(False) self.PerformLayout() @accepts(Self(), System.Object, System.EventArgs) @returns(None) def _button1_Click(self, sender, e): "ovo je moj code" a = int(self._textBox1.Text) b = int(self._textBox2.Text) c = a + b self._label1.Text = str(c) pass |