ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> wxpython-users
wxpython-users
Re: [wxpython-users] widget always on top
by Robin Dunn other posts by this author
Jun 1 2009 11:10AM messages near this date
[wxpython-users] widget always on top | [wxpython-users] Mouse events outside of frame
Markandeya wrote:
>  Hi All,
>  I am making a textCtrl with a BitmapButton on top of it to the right 
>  with a bitmap of a dropdown arrow. Thus it looks like a combobox. How to 
>  keep the BitmapButton always on top. The textCtrl is in a slot on a 
>  sizer that is on a panel. I read about a frame flag can be set to ontop 
>  of parent, or a dialog box can be set to ontop. So maybe i can put the 
>  BitmapButton on one of these and float it on top of its parent. What's 
>  the best way, or the ways, to keep the button or any widget on top of 
>  other widgets? Same would apply for a listCtrl that is hidden then shown 
>  and has to stay ontop of the existing showing widgets.

The behavior of overlapped sibling widgets is undefined in wx and is not 
supported.  There isn't an equivalent to stay-on-top for non top-level 
windows.


>    Another possible solution to my problem would be to put the 
>  BitmapButton not over but next to, on the right side of,  the textCtrl. 
>  This is ok but i don't know how to make it look like it is in a border 
>  same as the textCtrl. The dropdown button of a combobox is actually 
>  inside the text part's border. I can have the textCtrl and BitmapButton 
>  as separate widgets but they must look like they share the same beveled 
>  border.

Two possibilities:

* Try making the bitmap a child of the textctrl.  This may not work/look 
perfectly on all platforms but might be good enough.

* Put both the textctrl and the bitmap button on a panel with a sizer 
that positions them side-by-side.  Give the panel a style of 
wx.TAB_TRAVERSAL|wx.BORDER_THEME, and use the wx.BORDER_NONE style on 
the textctrl.  This will make it look like the textctrl's border is 
extending around both items, but it is actually the panel's border. 
This approach won't work real well on the Mac, but it should work well 
on Windows and GTK.


-- 
Robin Dunn
Software Craftsman
http://wxPython.org

_______________________________________________
wxpython-users mailing list
wxpython-users@[...].org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
Thread:
Markandeya
Robin Dunn

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved