[wxPython] Controls inside ListCtrl

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

[wxPython] Controls inside ListCtrl

Jochen Schaeuble-2
Hi!
  Is it possible to place other controls inside a ListCtrl and how this is
done?
  I also have another problem. I added a wxBoxSizer(wxHORIZONTAL) to the
  _init_ method of my Frame. If I now add two Buttons using
  box.Add(wxButton(self, 1010, "one"), 0, wxEXPAND)
  box.Add(wxButton(self, 1010, "two"), 0, wxEXPAND)

  Only the second button is displayed. Anyone knows why?

Thx 4 reading
  Jochen


_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] Controls inside ListCtrl

Robin Dunn
> Hi!
>   Is it possible to place other controls inside a ListCtrl and how this is
> done?

I don't think so.  You might be able to place control windows on top of a
wxListCtrl, but you woul dhave to manage their size and position yourself.
The wxListCtrl wouldn't know what to do with them.


>   I also have another problem. I added a wxBoxSizer(wxHORIZONTAL) to the
>   _init_ method of my Frame. If I now add two Buttons using
>   box.Add(wxButton(self, 1010, "one"), 0, wxEXPAND)
>   box.Add(wxButton(self, 1010, "two"), 0, wxEXPAND)
>
>   Only the second button is displayed. Anyone knows why?
>

It's there, just underneath the second button.  For some reason the layout
algorithm is not being invoked.  Did you call self.SetSizer(box) and
self.SetAutoLayout(true)?

--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] Controls inside ListCtrl

Ken Seehof-2
In reply to this post by Jochen Schaeuble-2
Jochen Schaeuble wrote:

> Hi!
>   Is it possible to place other controls inside a ListCtrl and how this is
> done?

No standard way to do this.  This is definitely in the area of arcane magic,
butthere's always a way :-)

It really depends on what kind of control you want, and you should be prepared

to spend some time on it.

Here are a couple examples:

If you want a checkbox, you cheat and use pictures of checkboxes in the
listboxes
image list (if it allready has images, simply make the images wider and have
twice
as many images with the checkbox picture on the left side).

If you want a slider bar or something like that, it's a bit more work.  This
would
involve maintaining a list of windows (children of the list control) and
moving them
around in response to half a million different messages to the list control.

I once made a listbox filled with dialog boxes in Visual C++, so I know it's
possible.  But you will be working late.

- Ken Seehof

>   I also have another problem. I added a wxBoxSizer(wxHORIZONTAL) to the
>   _init_ method of my Frame. If I now add two Buttons using
>   box.Add(wxButton(self, 1010, "one"), 0, wxEXPAND)
>   box.Add(wxButton(self, 1010, "two"), 0, wxEXPAND)
>
>   Only the second button is displayed. Anyone knows why?
>
> Thx 4 reading
>   Jochen
>
> _______________________________________________
> wxPython-users maillist  -  [hidden email]
> http://starship.python.net/mailman/listinfo/wxpython-users




_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users