wxHaskell - using XRC files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

wxHaskell - using XRC files

Günther Schmidt
Hi,

I'm looking for documentation on using XRC files with wxHaskell.

I finally managed to cabal-install wxHaskell last night alas sans docs.

Günther

BTW: I'm using wxFormBuilder, any other good tools out there?


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: wxHaskell - using XRC files

Gour-4
On Wed, 27 Jan 2010 11:09:06 +0100
>>>>>> "Günther" == Günther Schmidt <[hidden email]> wrote:

Günther> I'm looking for documentation on using XRC files with
Günther> wxHaskell.

I'd like to find it too...so, far I've found only two samples:
xrcmenu.xrc & controls.xrc.

Günther> BTW: I'm using wxFormBuilder, any other good tools out there?

Besides wxFormBuilder I played with DialogBlocks (eval version 'cause
it's not free).


Sincerely,
Gour

--

Gour  | Hlapicina, Croatia  | GPG key: F96FF5F6
----------------------------------------------------------------

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: wxHaskell - using XRC files

Günther Schmidt
Hello Gour,

creating the .xrc files with WxFormBuilder isn't the problem, I'd need
to see the .hs files where these resources are imported and used. Do you
happen to know where to find those too?

Günther

Am 27.01.10 13:38, schrieb Gour:

> On Wed, 27 Jan 2010 11:09:06 +0100
>>>>>>> "Günther" == Günther Schmidt<[hidden email]>  wrote:
>
> Günther>  I'm looking for documentation on using XRC files with
> Günther>  wxHaskell.
>
> I'd like to find it too...so, far I've found only two samples:
> xrcmenu.xrc&  controls.xrc.
>
> Günther>  BTW: I'm using wxFormBuilder, any other good tools out there?
>
> Besides wxFormBuilder I played with DialogBlocks (eval version 'cause
> it's not free).
>
>
> Sincerely,
> Gour
>
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: wxHaskell - using XRC files

Gour-4
On Wed, 27 Jan 2010 14:56:28 +0100
>>>>>> "Günther" == Günther Schmidt <[hidden email]> wrote:

Günther> creating the .xrc files with WxFormBuilder isn't the problem,
Günther> I'd need to see the .hs files where these resources are
Günther> imported and used. Do you happen to know where to find those
Günther> too?

I cannot remember where did I find them, but I'm sending 'em via
email.


Sincerely,
Gour

--

Gour  | Hlapicina, Croatia  | GPG key: F96FF5F6
----------------------------------------------------------------

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: wxHaskell - using XRC files

Jeremy O'Donoghue
In reply to this post by Gour-4
Hi Guenther, Gour

On Wed, 27 Jan 2010 13:38 +0100, "Gour" <[hidden email]> wrote:
> On Wed, 27 Jan 2010 11:09:06 +0100
> >>>>>> "Günther" == Günther Schmidt <[hidden email]> wrote:
>
> Günther> I'm looking for documentation on using XRC files with
> Günther> wxHaskell.
>
> I'd like to find it too...so, far I've found only two samples:
> xrcmenu.xrc & controls.xrc.

You have found just about all there is, I'm afraid. It's on my list for
a Blog article, but as you may have realised, my list is quite long, and
the rate of service rather slow.

The basics are pretty straightforward if you have read and understood
the wxWidgets documentation on XRC.

- An XRC file needs to be loaded into a top level window.
- The objects created when the XRC file is loaded can be made available
to wxHaskell by name using the <widget>Res functions (you will find most
of them in Graphics.UI.WX.Controls)

There are quite a few things to watch out for:
- XRC is incompatible with Layout (the XRC contains its own sizers, and
Layout creates sizers suitable for a given window layout)
- You must load your control as a child of the window in which you
loaded the XRC file
- If you try to fetch a control whose name doesn't exist, or if you load
a control by name as the wrong type of control, you will almost
certainly crash irrecoverably (the crash is usually in the wxWidgets
.DLL/.so/.dylib)
- It is not really possible to control an XRC-based menu very well. As
an example, I have never succeeded in disabling a menu option
- I also have not succeeded in getting XRC to work with wxHaskell custom
controls (and I've tried fairly hard). This is currently a show-stopper
for me. I very much doubt that this will ever work without putting
wxHaskell support into a GUI builder, since wxHaskell custom widgets do
not look (to C++) quite the same as C++ custom widgets.

The whole of the XRC support really needs a typesafe veneer over it (if
you search the wxhaskell-devel archives, there was a proof of concept
for doing this proposed about 8 months ago), and probably some
wxHaskell-specific work in a GUI builder.

I'll do my best to answer any specific questions you have.

Best regards
Jeremy

> Günther> BTW: I'm using wxFormBuilder, any other good tools out there?
>
> Besides wxFormBuilder I played with DialogBlocks (eval version 'cause
> it's not free).
>
>
> Sincerely,
> Gour
>
> --
>
> Gour  | Hlapicina, Croatia  | GPG key: F96FF5F6
> ----------------------------------------------------------------
--
  Jeremy O'Donoghue
  [hidden email]

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe