I cannot find the equivalent in wxPython ... is there one ?
It's built-in to every window. GtkFixed is a pixel based layout container, and you can do the same by just setting the position and size of the widgets using the constructor parameters, or SetPosition and SetSize methods, and not using a sizer.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
On Wednesday 24 January 2007 03:19, Robin Dunn wrote:
Philippe C. Martin wrote:
> Hi,
>
> I cannot find the equivalent in wxPython ... is there one ?
It's built-in to every window. GtkFixed is a pixel based layout
container, and you can do the same by just setting the position and size
of the widgets using the constructor parameters, or SetPosition and
SetSize methods, and not using a sizer.
--
_________________________
Philippe C. Martin
www.snakecard.com
_________________________
I tried to put a bitmapbutton in a frame but whatever I do (setsize ....) ,
the button takes the whole frame.
So I'm now down to handling the mouse down and up events and having my
customer give me "up and down" bitmaps for the buttons.
It does work but I get a flicker feeling under Windows as I call .Refresh and
that it makes me redraw the text in the POS.
Now, since the customer currently targets Linux and that there is no flicker
here, I am not too worried .. but I do not understand:
Is there a way to get that bitmap button to not take over the whole frame ?
Is there a way to only refresh part of the bitmap.
Thanks,
Philippe
···
On Wednesday 24 January 2007 03:19, Robin Dunn wrote:
Philippe C. Martin wrote:
> Hi,
>
> I cannot find the equivalent in wxPython ... is there one ?
It's built-in to every window. GtkFixed is a pixel based layout
container, and you can do the same by just setting the position and size
of the widgets using the constructor parameters, or SetPosition and
SetSize methods, and not using a sizer.
--
_________________________
Philippe C. Martin
www.snakecard.com
_________________________
I tried to put a bitmapbutton in a frame but whatever I do (setsize ....) ,
the button takes the whole frame.
Uhm, are you forced to put a button directly on a frame? It would be
much easier to do Frame => Panel => Button. Otherwise, layout things
with a sizer.
1) it is a full-screen POS system whith a background image.
2) I attempt to give the customer full control on the layout of the widgets
3) they do _not_ want a "regular" application look
so this is roughly what my input is ... and I handle the text writing in the
3 "LCDs" and need to respond to the buttons event .... a link: http://www.snakecard.com/Screenshot-1.png
The text is off on purpose there ... but I need to handle event / align my
widget in something _very_ equivalent.
Regards,
Philippe
···
On Thursday 25 January 2007 00:48, Andrea Gavana wrote:
Hi Philippe,
> I tried to put a bitmapbutton in a frame but whatever I do (setsize ....)
> , the button takes the whole frame.
Uhm, are you forced to put a button directly on a frame? It would be
much easier to do Frame => Panel => Button. Otherwise, layout things
with a sizer.
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
--
_________________________
Philippe C. Martin
www.snakecard.com
_________________________
I tried to put a bitmapbutton in a frame but whatever I do (setsize ....) , the button takes the whole frame.
A feature of the wx.Frame is that if it has only one child it resizes it to fill the frame's client area. If this is not what you want then either give it another child, implement your own EVT_SIZE handler for the frame, or put a panel in the frame and the button on the panel (this is usually the preferred way to do it.)
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
On Thursday 25 January 2007 01:25, Robin Dunn wrote:
Philippe C. Martin wrote:
> Robin,
>
> I tried to put a bitmapbutton in a frame but whatever I do (setsize ....)
> , the button takes the whole frame.
A feature of the wx.Frame is that if it has only one child it resizes it
to fill the frame's client area. If this is not what you want then
either give it another child, implement your own EVT_SIZE handler for
the frame, or put a panel in the frame and the button on the panel (this
is usually the preferred way to do it.)
--
_________________________
Philippe C. Martin
www.snakecard.com
_________________________
PS: I googled somewhere that the doc talks about this ... but cannot find it
···
On Thursday 25 January 2007 07:32, Philippe C. Martin wrote:
On Thursday 25 January 2007 01:25, Robin Dunn wrote:
> Philippe C. Martin wrote:
> > Robin,
> >
> > I tried to put a bitmapbutton in a frame but whatever I do (setsize
> > ....) , the button takes the whole frame.
>
> A feature of the wx.Frame is that if it has only one child it resizes it
> to fill the frame's client area. If this is not what you want then
> either give it another child, implement your own EVT_SIZE handler for
> the frame, or put a panel in the frame and the button on the panel (this
> is usually the preferred way to do it.)
Robin,
That does fix the problem indeed.
Can I tell the bitmap button to use the background color of the bitmap
behind it/be transparent ? ... right now is seems to make up some colors.
Or is there a way to have it fit exactly the size of the bitmap ?
On Thursday 25 January 2007 07:53, Philippe C. Martin wrote:
PS: I googled somewhere that the doc talks about this ... but cannot find
it
On Thursday 25 January 2007 07:32, Philippe C. Martin wrote:
> On Thursday 25 January 2007 01:25, Robin Dunn wrote:
> > Philippe C. Martin wrote:
> > > Robin,
> > >
> > > I tried to put a bitmapbutton in a frame but whatever I do (setsize
> > > ....) , the button takes the whole frame.
> >
> > A feature of the wx.Frame is that if it has only one child it resizes
> > it to fill the frame's client area. If this is not what you want then
> > either give it another child, implement your own EVT_SIZE handler for
> > the frame, or put a panel in the frame and the button on the panel
> > (this is usually the preferred way to do it.)
>
> Robin,
>
> That does fix the problem indeed.
>
> Can I tell the bitmap button to use the background color of the bitmap
> behind it/be transparent ? ... right now is seems to make up some colors.
>
> Or is there a way to have it fit exactly the size of the bitmap ?
>
> bmp = wx.Bitmap('buttons/btn_ok_normal.png', wx.BITMAP_TYPE_PNG)
> b = wx.BitmapButton(self, -1, bmp, (20, 20),
> (bmp.GetWidth(), bmp.GetHeight()))
>
>
> Thanks,
>
> Philippe
--
_________________________
Philippe C. Martin
www.snakecard.com
_________________________
I tried to put a bitmapbutton in a frame but whatever I do (setsize ....)
, the button takes the whole frame.
A feature of the wx.Frame is that if it has only one child it resizes it
to fill the frame's client area. If this is not what you want then
either give it another child, implement your own EVT_SIZE handler for
the frame, or put a panel in the frame and the button on the panel (this
is usually the preferred way to do it.)
Robin,
That does fix the problem indeed.
Can I tell the bitmap button to use the background color of the bitmap behind it/be transparent ? ... right now is seems to make up some colors.
Or is there a way to have it fit exactly the size of the bitmap ?
Try using a style of wx.NO_BORDER. That should trim the size of the button down to just the bitmap, but it's still a widget and so will have its own background to draw and won't be truly transparent. The only way to do that on all platforms is to draw the bitmap yourself on the parent window, and catch the mouse events you need to make that area of the parent act like a button. Or you can get the portion of the parent's bitmap that the button will cover and draw that on the background of a custom button widget.
You might want to check the archives. Some folks have done some work towards skinning frameworks and custom widgets that can fit into those frameworks, but I'm not sure how far along they have gotten.
···
On Thursday 25 January 2007 01:25, Robin Dunn wrote:
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
On Friday 26 January 2007 10:10, Robin Dunn wrote:
Philippe C. Martin wrote:
> On Thursday 25 January 2007 01:25, Robin Dunn wrote:
>> Philippe C. Martin wrote:
>>> Robin,
>>>
>>> I tried to put a bitmapbutton in a frame but whatever I do (setsize
>>> ....) , the button takes the whole frame.
>>
>> A feature of the wx.Frame is that if it has only one child it resizes it
>> to fill the frame's client area. If this is not what you want then
>> either give it another child, implement your own EVT_SIZE handler for
>> the frame, or put a panel in the frame and the button on the panel (this
>> is usually the preferred way to do it.)
>
> Robin,
>
> That does fix the problem indeed.
>
> Can I tell the bitmap button to use the background color of the bitmap
> behind it/be transparent ? ... right now is seems to make up some colors.
>
> Or is there a way to have it fit exactly the size of the bitmap ?
>
> bmp = wx.Bitmap('buttons/btn_ok_normal.png', wx.BITMAP_TYPE_PNG)
> b = wx.BitmapButton(self, -1, bmp, (20, 20),
> (bmp.GetWidth(), bmp.GetHeight()))
Try using a style of wx.NO_BORDER. That should trim the size of the
button down to just the bitmap, but it's still a widget and so will have
its own background to draw and won't be truly transparent. The only way
to do that on all platforms is to draw the bitmap yourself on the parent
window, and catch the mouse events you need to make that area of the
parent act like a button. Or you can get the portion of the parent's
bitmap that the button will cover and draw that on the background of a
custom button widget.
You might want to check the archives. Some folks have done some work
towards skinning frameworks and custom widgets that can fit into those
frameworks, but I'm not sure how far along they have gotten.
--
_________________________
Philippe C. Martin
www.snakecard.com
_________________________