Daan, here is a small contribution example, built
on your explanations.
It may fit in the samples, to illustrate these
interesting features from wxHaskell. it needs a bitmap in the current directory,
You will note that "wxNB_RIGHT"
seems to work on XP, finally.
Still, one glitch is the popupmenu
that I was expecting near the button, not top left.
Also, I did not use a Use
a "wxBitmapButton" as u mentions, I did not found it, neither what it
should provides.. hm ?
Author : Luc Taesch
Maintainer : email@example.com
Stability : provisional
: portable ? (tested on XP)
Illustrate more controls from wxHaskell, Hacked from Controls.hs ( Daan Leijen
namely bitmapButtons, righ click menus, vertical
labels on notebooks, usage of tooltips
module Main where
main :: IO ()
gui :: IO ()
= do -- main gui
elements: frame, panel, text control, and the
f <- frame [text := "Controls"
<- panel f 
nb <- notebook2 p
textlog <- textCtrl p WrapLine
[enable := False]
menuList "&File" 
aRightClick <- menuItem file "Say Something\tCtrl+Q" "An interesting
-- use text control as
p1 <- panel nb
[text := "buttons"]
<- bitmapButton p1 0 bm [text := "Ok", on command := logMessage "bitmap
on clickRight := (\pt -> menuPopup file pt p)]
set f [layout
[container p1 $ margin 10 $ floatCentre $ row 5
, hfill $ widget
, on (menu aRightClick) := infoDialog f "Say.."
, clientSize := sz 400 300 ]
= do i <- get w
<- get w (item
("selected index: " ++ show i ++ ": " ++
-- like notebook, with labels created on the side ( rather than on
notebook2 parent props
= do nb <-
notebookCreate parent idAny rectNull ( wxCLIP_CHILDREN +
-- like buttonEx, with a bitmap
instead of the label
bitmapButton parent flags bm props
= do --bm
bitmapButtonCreate parent idAny bm rectNull
----- Original Message -----
Sent: Monday, September 01, 2003 11:36
Subject: [wxhaskell-users] drag and drop,
notebook, bitmapbuttons, rightclick
will just answer all your questions in one go :-)
does wxhaskell support drag and drop
No, not yet. It needs some more C
wrapper support. However,
it is easy to add and it will be there in version 0.3
(I plan to release 0.2 in a few weeks). (unless you
add it for me and
send me the patches... see wxDropTarget and
Is there any (layout ?) possibilities to have the notebook
"buttons" on the (right side) rather than on the top ?
Yes. You have to create the notebook with the
"wxNB_RIGHT" flag. Look at the
source code in "WX.Controls" to see how to create a
(it seems from the docs though that "wxNB_RIGHT" is
not supported yet by
> doew wxhaskell
support bitmapbuttons ?
Yes. Use a "wxBitmapButton". with
> does wxHaskell
support rightclick menu, an
dideally specific to an area , say on a button
Yes. Use "on clickRight" together with
I hope this helps,
All the best.
ps. I think you
could have answered the last three questions yourself by
studying the documentation and samples. Don't worry
though :-), I am very
happy that you use my stuff and I have no problem
questions at all -- however, any time I spend on
email can't be spend on
advancing wxHaskell. Therefore, try to experiment and
study the docs a little
bit before asking questions.