Signal/Slot

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
boulabiar
Earned a small fee
Earned a small fee
Posts: 13
Joined: Fri Jan 05, 2007 4:06 pm
Location: Tunisia

Signal/Slot

Post by boulabiar »

Hi !

I am new and I want to ask if wx will have the Signal/Slot in next version and if not Why ???

I think it's one of the things that make users go to QT !!

I don't like QT and I want wx to be more and more powerful !!!

Thanks
We are born to learn !!!
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

sigslot mechanisms are good, but they still lack traditional ways of event handling, where the event, if not handled by the child moves up the chain to the parent. Also when you derive a class and do not handle certain events, the base class might still handle them.

With sigslot there is no real way of determining which subscriber gets the first event and what needs to happen if it's not handled.

Ofcourse there are ways around it or Qt does not even use it, but wxWidgets is too extensive to redesign the whole event mechanism.

The good part is that the sigslot found at SF (by Sarah) can be used next to wxWidgets without problems. Simply derive your class from both a wxWidgets derivative, and sigslot template.

Perform a search on this forum to find more info about it. use the keyword sigslot..

Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
krzysiek_t
Earned a small fee
Earned a small fee
Posts: 23
Joined: Tue Jul 11, 2006 1:36 pm
Location: Poland, Warsaw
Contact:

Post by krzysiek_t »

I would say that this is a main difference between wx and qt. I'd prefer events as they are more intuitive for me. Someone else may prefer signal-slots.

I think it's good we have two such libraries (I know them both). And it shouldn't be wx mission to incorporate every GUI programing paradigm existing as it would make it messy, overloaded, confusing.

If you really want to mix wxWidgets with sig-slot approach take a look at Boost library (http://www.boost.org). It cointains portable, C++ implementations of sig-slots.[/url]
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

Agreed, I use sigslot mechanisms for my GUI to let my project view for example be signaled that a project is added to the data structure. It then can add the project to the list. Same goes for updating and deleting. It is very elegant as the GUI is not bloated with update code everywhere after every action.

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Post Reply