Пример #1
0
 def test_importwinform(self):
     import clr
     clr.AddReferenceByPartialName("System.Windows.Forms")
     import System.Windows.Forms as TestWinForms
     form = TestWinForms.Form()
     form.Text = "Hello"
     self.assertTrue(form.Text == "Hello")
Пример #2
0
    def __init__(self,
                 url: str,
                 title: str = "pycefsharp",
                 icon: str = None,
                 geometry: list = [-1, -1, -1, -1]):
        self.__cef_form = WinForms.Form()
        self.__cef_form.StartPosition = WinForms.FormStartPosition.CenterScreen

        self.__cef_browser = None

        self.url = url
        self.title = title
        self.icon = os.path.join(__path__[0],
                                 "cef.ico") if icon == None else icon
        self.geometry = geometry

        self.__cef_form.Load += self.__on_load
        self.__cef_form.Shown += self.__on_show
        self.__cef_form.FormClosed += self.__on_close

        self.__cef_form.Visible = False
Пример #3
0
 def __init__(self, cnf={}, **kw):
     global _defmaster
     _defmaster = self
     self.form = _for.Form()
     self.control = self.form
     self._new(cnf, **kw)