How to add two buttons in wxpython

want to add two textctrl side by side. when i try to do that it gives me one above the other. I am trying this way
bs = wx.BoxSizer(wx.VERTICAL)

self.t1 = wx.TextCtrl(p,size = (120,30),style = wx.TE_MULTILINE |wx.TE_CENTER)

bs.Add(self.t1, 1, wx.EXPAND)

self.t2 = wx.TextCtrl(p,size = (120,30),style = wx.TE_MULTILINE |wx.TE_CENTER)

bs.Add(self.t2, 1, wx.EXPAND)

···

Himanshu pareek

Applied physics Department

Sardar Vallabhbhai National Institute of Technology, Surat.

Contact No.- 8437385593

p = prnt
         bs = wx.BoxSizer(wx.VERTICAL)
         self.t1 = wx.TextCtrl(p,size = (120,30),style = wx.TE_MULTILINE

wx.TE_CENTER)

         bs.Add(self.t1, 1, wx.EXPAND)
         self.t2 = wx.TextCtrl(p,size = (120,30),style = wx.TE_MULTILINE

wx.TE_CENTER)

         bs.Add(self.t2, 1, wx.EXPAND)

gives me

self.t1 = wx.TextCtrl(p,size = (120,30),style =
  wx.TE_MULTILINE |wx.TE_CENTER)

wx._core.wxAssertionError: C++ assertion "Assert failure" failed at /P/libs/wxPython-4.0.0a3/ext/wxWidgets/src/gtk/textctrl.cpp(686) in Create(): wxTextCtrl creation failed

in Boa Constructor... :frowning:

sorry, dude!

p = prnt
         bs = wx.BoxSizer(wx.VERTICAL)
         self.t1 = wx.TextCtrl() ## (p,size = (120,30)) ## ,style = wx.TE_MULTILINE |wx.TE_CENTER)
         bs.Add(self.t1, 1, wx.EXPAND)
         self.t1.SetAutoLayout(True)
         #self.t1.SetBackgroundColour(wx.Colour(155, 142, 103))
         #self.t1.SetBestFittingSize(100)
         self.t1.SetDefaultStyle

this does run but I don't see a dang thing! :frowning:

Hi,

        p = prnt
        bs = wx.BoxSizer(wx.VERTICAL)
        self.t1 = wx.TextCtrl() ## (p,size = (120,30)) ## ,style =
wx.TE_MULTILINE |wx.TE_CENTER)
        bs.Add(self.t1, 1, wx.EXPAND)
        self.t1.SetAutoLayout(True)
        #self.t1.SetBackgroundColour(wx.Colour(155, 142, 103))
        #self.t1.SetBestFittingSize(100)
        self.t1.SetDefaultStyle

What is p?
And why do you need to set the size when you are using sizers?

Thank you.

P.S.: Can you post the complete code?

···

On Wed, Jun 14, 2017 at 7:11 AM, <firefox@firemail.cc> wrote:

this does run but I don't see a dang thing! :frowning:

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

wx.VERTICAL gives you a sizer that stacks vertically.
You want to have wx.HORIZONTAL

Regards,
Dietmar

···

On 6/14/17 10:44 AM, Himanshu Pareek wrote:

want to add two textctrl side by side. when i try to do that it gives me one above the other. I am trying this way

bs = wx.BoxSizer(wx.VERTICAL)