How to add two buttons in wxpython

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to add two buttons in wxpython

himanshu
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


--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

add two buttons in wxpython

firefox
         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...    :-(


sorry, dude!

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: add two buttons in wxpython

firefox

         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!    :-(

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: add two buttons in wxpython

Igor Korot
Hi,

On Wed, Jun 14, 2017 at 7:11 AM,  <[hidden email]> wrote:

>
>         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?

>
> this does run but I don't see a dang thing!    :-(
>
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to add two buttons in wxpython

Dietmar Schwertberger-2
In reply to this post by himanshu
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)
>
wx.VERTICAL gives you a sizer that stacks vertically.
You want to have wx.HORIZONTAL

Regards,
Dietmar

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.