Trouble with advanced gui

I’m tryning to have a gui that looks like this

···

menu1 | menu 2 | menu 3


object containing those objects>> |list of objects.str |

here will show the str of the |that will drag here and |
object, draggin and droppin |drop there<<< |
the user cannot modify this sector| |

except by draging and dropping |___________________ |
>button 1 |
>button 2 |

                                             >button 3                      |

____________________________ |button 4 ____________|

wht’s is the best way to do something like this? I’m kinda new on wx, only now few about labels buttons, events and little bit about containers and frames, and can make some dialogs, forms and simple apps Any reply will be helpful

Thankx

David Anderson wrote:

I Know how to make the menus, thankx for the split panel, but what about the txtctrl on the left and the drag and drop stuff?

There is example of drag and drop with demo, (draganddrop.py), the textctrl on the left you just make a regular one and use
a read only style, and drag and drop will set contents.. on the right, you'll want a listctrl but I'm not sure how to do drag and
drop of listctrl items. Maybe someone else can help. Look through the demo though, maybe it has notes or comments on that,
too. -ak

···

On Mon, Mar 24, 2008 at 6:11 PM, AK <andrei.avk@gmail.com > <mailto:andrei.avk@gmail.com>> wrote:

    David Anderson wrote:
    > I'm tryning to have a gui that looks like this
    > _________________________________________________
    > menu1 | menu 2 | menu 3
    > _________________________________________________
    > >object containing those objects>> |list of objects.__str__ |
    > >here will show the __str__ of the |that will drag here and |
    > >object, draggin and droppin |drop there<<< |
    > >the user cannot modify this sector| >
    > >except by draging and dropping |___________________ |
    > > >button 1
    > >
    > > >button
    > 2 |
    > > >button
    > 3 |
    > >____________________________ |button 4 ____________|
    >
    > wht's is the best way to do something like this? I'm kinda new
    on wx,
    > only now few about labels buttons, events and little bit about
    > containers and frames, and can make some dialogs, forms and simple
    > apps Any reply will be helpful
    > Thankx
    Well, menu can be done like this:
           # File Menu
           menu = wx.Menu()
           menu_list = menu.Append(ID_LIST, "&Apply Filters\tCtrl-L",
                   "Apply currently selected filters")
           wx.EVT_MENU(self, ID_LIST, self.list)
    ... add more menus ...
    add all menus to bar:
           menuBar = wx.MenuBar()
           menuBar.Append(menu, "&File")

    Splitter can be done like this:

           self.splitter = wx.SplitterWindow(self, id=-1,
    pos=wx.DefaultPosition,
                   size=wx.DefaultSize, name="splitterWindow")
    # size=wx.DefaultSize, style=wx.SP_3D,
    name="splitterWindow")

    # make it do nothing because by default it will close one splitter
    side!!
           self.Bind(wx.EVT_SPLITTER_DCLICK, self.OnSplitterDclick)

           self.tpanel = wx.Panel(self.splitter, -1,
    style=wx.SUNKEN_BORDER) # top panel
           bpanel = wx.Panel(self.splitter, -1,
    style=wx.SUNKEN_BORDER) # bottom panel

    And put your text controls, buttons, etc in these panels.. also
    you will
    want to put another splitter
    in the right half of screen and put 2 panels on top and bottom..
    HTH, -ak

    >
    ------------------------------------------------------------------------
    >
    > _______________________________________________
    > wxpython-users mailing list
    > wxpython-users@lists.wxwidgets.org
    <mailto:wxpython-users@lists.wxwidgets.org>
    > http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
    >

    --
     -ak
     Tobu | http://www.lightbird.net/tobu/ | Freeform DB / Tagger / PIM

    _______________________________________________
    wxpython-users mailing list
    wxpython-users@lists.wxwidgets.org
    <mailto:wxpython-users@lists.wxwidgets.org>
    http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

------------------------------------------------------------------------

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
  
--
-ak
  Tobu | http://www.lightbird.net/tobu/ | Freeform DB / Tagger / PIM

By now I can sshow the panes, now i’m fighting with the listctrl xD
Thx, any problem I’ll come back

···

On Mon, Mar 24, 2008 at 7:23 PM, AK andrei.avk@gmail.com wrote:

David Anderson wrote:

Well. I made my SplitPannel

def OnNovo(self, evt):

    self.splitter = wx.SplitterWindow(self, id=-1,

pos=wx.DefaultPosition,

                                      size=wx.DefaultSize,

name=“Split”, style=wx.SP_3D)

    self.Bind(wx.EVT_SPLITTER_DCLICK, self.OnSplitterDclick)
    self.tpanel = wx.Panel(self.splitter,

-1,style=wx.SUNKEN_BORDER) # top panel

    self.bpanel = wx.Panel(self.splitter,

-1,style=wx.SUNKEN_BORDER) # bottom panel

    addErro = wx.Button(self.bpanel, ADD_ERRO, 'Adiciona Erro')
    criaErro = wx.Button(self.bpanel, CRIA_ERRO, 'Criar erro')
    criaDupla = wx.Button(self.bpanel, CRIA_DUPLA, 'Criar dupla')
    geraHtml = wx.Button(self.bpanel, GERA_HTML, 'Gerar Html')
    botoes = wx.BoxSizer(wx.VERTICAL)
    botoes.Add(addErro)
    botoes.Add(criaErro)
    botoes.Add(criaDupla)
    botoes.Add(geraHtml)
    self.Bind(wx.EVT_BUTTON, self.onAddErro, id=ADD_ERRO)
    self.Bind(wx.EVT_BUTTON, self.onCriaErro, id=CRIA_ERRO)
    self.Bind(wx.EVT_BUTTON, self.onCriaDupla, id=CRIA_DUPLA)
    self.Bind(wx.EVT_BUTTON, self.onGeraHtml, id=GERA_HTML)
    self.bpanel.SetSizer(botoes)

And when it’s supposed to show the splitpane, it only appears a small

square at the left corner of the frame…

can anyone see the problem?

thx

I think you might need to also do at the end,

self.splitter.SetSashPosition(0) - this sets it in the middle, (200) would

set it 200 pixels from top or left, etc. However, may I suggest

something? You might do better if you take the splitter

example from demos, get it to run, and then change it to suit your

needs. I’ve also been working with splitters, notebooks,

listctrls in the last couple of weeks (I’m new to wxpython too) and I

found this works much better than starting from

scratch / from code in tutorial. It’s just much more efficient to start

with working, complete code and go from there.

HTH, -ak

On Mon, Mar 24, 2008 at 6:37 PM, AK <andrei.avk@gmail.com > > mailto:andrei.avk@gmail.com> wrote:

David Anderson wrote:
> I Know how to make the menus, thankx for the split panel, but what
> about the txtctrl on the left and the drag and drop stuff?
There is example of drag and drop with demo, (draganddrop.py), the
textctrl on the left you just make a regular one and use
a read only style, and drag and drop will set contents.. on the right,
you'll want a listctrl but I'm not sure how to do drag and
drop of listctrl items. Maybe someone else can help. Look through the
demo though, maybe it has notes or comments on that,
too. -ak
>
> On Mon, Mar 24, 2008 at 6:11 PM, AK <andrei.avk@gmail.com >  > >     <mailto:andrei.avk@gmail.com> > >     > <mailto:andrei.avk@gmail.com <mailto:andrei.avk@gmail.com>>> wrote:
>
>     David Anderson wrote:
>     > I'm tryning to have a gui that looks like this
>     > _________________________________________________
>     > menu1 | menu 2 | menu 3
>     > _________________________________________________
>     > >object containing those objects>> |list of
objects.__str__   |
>     > >here will show the __str__ of the   |that will drag here
and  |
>     > >object, draggin and droppin           |drop there<<<
         >
>     > >the user cannot modify this sector|
>          >
>     > >except by draging and dropping    |___________________ |
>     > >                                                  >button 1
>     >                       >
>     > >                                                  >button
>     > 2                      |
>     > >                                                  >button
>     > 3                      |
>     > >____________________________ |button 4 ____________|
>     >
>     > wht's is the best way to do something like this? I'm kinda new
>     on wx,
>     > only now few about labels buttons, events and little bit about
>     > containers and frames, and can make some dialogs, forms
and simple
>     > apps Any reply will be helpful
>     > Thankx
>     Well, menu can be done like this:
>            # File Menu
>            menu = wx.Menu()
>            menu_list = menu.Append(ID_LIST, "&Apply
Filters\tCtrl-L",
>                    "Apply currently selected filters")
>            wx.EVT_MENU(self, ID_LIST, self.list)
>     ... add more menus ...
>     add all menus to bar:
>            menuBar = wx.MenuBar()
>            menuBar.Append(menu, "&File")
>
>     Splitter can be done like this:
>
>            self.splitter = wx.SplitterWindow(self, id=-1,
>     pos=wx.DefaultPosition,
>                    size=wx.DefaultSize, name="splitterWindow")
>     #                size=wx.DefaultSize, style=wx.SP_3D,
>     name="splitterWindow")
>
>     # make it do nothing because by default it will close one
splitter
>     side!!
>            self.Bind(wx.EVT_SPLITTER_DCLICK, self.OnSplitterDclick)
>
>            self.tpanel = wx.Panel(self.splitter, -1,
>     style=wx.SUNKEN_BORDER)   # top panel
>            bpanel = wx.Panel(self.splitter, -1,
>     style=wx.SUNKEN_BORDER)        # bottom panel
>
>     And put your text controls, buttons, etc in these panels.. also
>     you will
>     want to put another splitter
>     in the right half of screen and put 2 panels on top and bottom..
>     HTH, -ak
>
>
>     >
>
------------------------------------------------------------------------
>     >
>     > _______________________________________________
>     > wxpython-users mailing list
>     > wxpython-users@lists.wxwidgets.org
<mailto:wxpython-users@lists.wxwidgets.org>
>     <mailto:wxpython-users@lists.wxwidgets.org
<mailto:wxpython-users@lists.wxwidgets.org>>
>     > [http://lists.wxwidgets.org/mailman/listinfo/wxpython-users](http://lists.wxwidgets.org/mailman/listinfo/wxpython-users)
>     >
>
>
>     --
>      -ak
>      Tobu | [http://www.lightbird.net/tobu/](http://www.lightbird.net/tobu/) | Freeform DB /
Tagger / PIM
>
>     _______________________________________________
>     wxpython-users mailing list
>     wxpython-users@lists.wxwidgets.org
<mailto:wxpython-users@lists.wxwidgets.org>
>     <mailto:wxpython-users@lists.wxwidgets.org
<mailto:wxpython-users@lists.wxwidgets.org>>
>     [http://lists.wxwidgets.org/mailman/listinfo/wxpython-users](http://lists.wxwidgets.org/mailman/listinfo/wxpython-users)
>
>
>
------------------------------------------------------------------------
>
> _______________________________________________
> wxpython-users mailing list
> wxpython-users@lists.wxwidgets.org
<mailto:wxpython-users@lists.wxwidgets.org>
> [http://lists.wxwidgets.org/mailman/listinfo/wxpython-users](http://lists.wxwidgets.org/mailman/listinfo/wxpython-users)
>
--
 -ak
 Tobu | [http://www.lightbird.net/tobu/](http://www.lightbird.net/tobu/) | Freeform DB / Tagger / PIM
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
<mailto:wxpython-users@lists.wxwidgets.org>
[http://lists.wxwidgets.org/mailman/listinfo/wxpython-users](http://lists.wxwidgets.org/mailman/listinfo/wxpython-users)


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

-ak

Tobu | http://www.lightbird.net/tobu/ | Freeform DB / Tagger / PIM


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Hi David,

It might also be worth looking at wxGlade:
http://wxglade.sourceforge.net/

It can generate most of the icky bits of the GUI and event-binding code for you.
You still have to struggle with the setup of a ListCtrl – but with some help from the wxPython Demo, I’m sure you’ll manage to work that out, just like I managed :slight_smile:

Good Luck,

–Tim

Tim van der Leeuw wrote:

Hi David,

It might also be worth looking at wxGlade:
http://wxglade.sourceforge.net/

It can generate most of the icky bits of the GUI and event-binding code for you.
You still have to struggle with the setup of a ListCtrl -- but with some help from the wxPython Demo, I'm sure you'll manage to work that out, just like I managed :slight_smile:

Sounds like a nice idea to me,
if we could make a wiki page,
where we could show how a specific layout (maybe David's one is a good example)
can be made by the different tools.
( with the hope there will only survive one or two good ones :wink:

Coming from other GUI languages the GUI layout design is one of the most complex and un-mature things in wx-Python:
- tell each child who is parent container is
- tell each parent who it's children are
- tell the grandparent to use some kind of sizer

The fact that there are so many tools, confirms my observation :wink:

cheers,
Stef

I figured it out :slight_smile: Sometimes checking out the wxPython demo can come in handy :stuck_out_tongue:
I'm using wx.Font to set a font size, and then applying it to the various elements that need to have their sizes changed (using elementName.SetFont()).

Hope this helps someone :wink:

Regards,
Lorenzo

L. Fanchi wrote:

···

Hello,

I'm writing a program for Mac OS X and Windows XP at the same time and I'm having some issues with the font sizes on both operating systems.
Currently, I'm coding on my XP box and transferring the files to my Mac and compiling on both machines. The problem is that the text (statictext, but also text next to checkboxes) fits perfectly on my XP machine, but when I run the code on the Mac, the text is way too big.

How can I change the font size of the wx.StaticText and wx.CheckBox on the Mac only?

Thanks in advance for any help!