OvermindDL1 | 1 Dec 2009 04:07
Picon

Re: signals

On Mon, Nov 30, 2009 at 10:52 AM, hadass yaari <hadassyaari <at> gmail.com> wrote:
> Hello everybody,
> I want to be able to pass parameters to the method that the
> WText->clicked().connect method gets.
> In all of the examples I saw that just a method with 0 parameters is used
> but I read in the references that there are signals that gets arguments (up
> to 6). I tried to call them but didn't succeeded.
> How can I do that?
> Maybe I need to connect another signal and not the built in? If so - how can
> I connect it the mouse click on the text?

Use Boost.Bind as you would do in any other wrapped function argument listing.

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
witty-interest mailing list
witty-interest <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest
Koen Deforche | 1 Dec 2009 10:10
Picon
Favicon

Re: creating dynamic pages

Hey Hadass,

2009/11/30 hadass yaari <hadassyaari@...>:
> The application that I build is combined with a SQL server.
> I have a lot of information that I keep in the DB as records.
> I want to be able to display a page with the wanted information that I got
> from the DB.
> I implemented it like this: the user choose the wanted data and then I clear
> the screen and display the data that I got from the DB.
> I want to do that differently: I want to dynamically  create pages. I mean,
> when the user clicks on the record that he wants to see, a message with the
> id parameter will be sent to the server and a new page will be created (with
> a url) and will be sent back to the client.
> How can I do that?

Where do you want the result to be displayed then, in a new window/tab ?

Regards,
koen

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
Koen Deforche | 1 Dec 2009 10:16
Picon
Favicon

Re: WTabWidget Strangeness

Hey Charles,

2009/11/30 Hubbard, Charles W <charles.hubbard@...>:
> Hi list,
>
> I just wanted to bring to the attention of the developers, a change in
>
> behavior of WTabWidget widgets in the latest revision
>
> (58e7483196d11edb20674aaf99401dad2641b4c9) of Wt in the public git
>
> repository.  I updated one of my systems to this revision this morning,
>
> and now tabs no longer display as tabs, but appear as bulletted lists
>
> instead.  I reverted back to 737edb9b71ba63efa3dff9de48c2bacb6809afaa

We have merged in the "themes" support into the master branch. That
means that CSS has been pushed out from the widgets to a
theme-specific CSS file. This means that you will need to make sure
that the resources/ folder (and more specifically the
resources/themes/ directory) is properly deployed.

That should bring back the CSS styling?

We are aware that this is a bit of an annoying change, and we will
make sure it is properly indicated in our release notes for the next
release.

Regards,
(Continue reading)

Koen Deforche | 1 Dec 2009 10:07
Picon
Favicon

Re: signals

Hey Hadaas,

2009/11/30 hadass yaari <hadassyaari@...>:
> Hello everybody,
> I want to be able to pass parameters to the method that the
> WText->clicked().connect method gets.
> In all of the examples I saw that just a method with 0 parameters is used
> but I read in the references that there are signals that gets arguments (up
> to 6). I tried to call them but didn't succeeded.
> How can I do that?
> Maybe I need to connect another signal and not the built in? If so - how can
> I connect it the mouse click on the text?

You can use a WSignalMapper to pass an additional argument to the
slot. It is designed to handle the typical case that you connect many
signals to a single slot, which is perhaps your use case ?

Regards,
koen

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
hadass yaari | 1 Dec 2009 18:15
Picon

Re: signals

hello,
I'm trying to use boost::bind to solve my problem. I did it like this:

pb->clicked().connect(SLOT(

this, (boost::bind<void>(&AddPersonAuto::bla,5))));
the error that I get is:

error C2660: 'Wt::EventSignal<E>::connect' : function does not take 2 arguments

As you can see connect gets just just one argument - SLOT
when I use a zero parameters I do it like this:

pb->clicked().connect(SLOT(

this, AddPersonAuto::onSubmit));
isn't it the same?
I'll be happy to hear the solution.
Hadas

On Mon, Nov 30, 2009 at 7:52 PM, hadass yaari <hadassyaari <at> gmail.com> wrote:
Hello everybody,

I want to be able to pass parameters to the method that the WText->clicked().connect method gets.
In all of the examples I saw that just a method with 0 parameters is used but I read in the references that there are signals that gets arguments (up to 6). I tried to call them but didn't succeeded. 
How can I do that?
Maybe I need to connect another signal and not the built in? If so - how can I connect it the mouse click on the text?

Thank you,
Hadas

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
witty-interest mailing list
witty-interest@...
https://lists.sourceforge.net/lists/listinfo/witty-interest
OvermindDL1 | 1 Dec 2009 18:38
Picon

Re: signals

On Tue, Dec 1, 2009 at 10:15 AM, hadass yaari <hadassyaari <at> gmail.com> wrote:
> hello,
> I'm trying to use boost::bind to solve my problem. I did it like this:
>
> pb->clicked().connect(SLOT(
>
> this, (boost::bind<void>(&AddPersonAuto::bla,5))));

Try this?  I am not sure it will work considering the very weird way
Wt handles the connect function (*WAY* too over-engineered).
pb->clicked().connect(this, (boost::bind(&AddPersonAuto::bla,_1,5)));

And I honestly have no clue why Wt uses that nasty, useless SLOT macro
either, you *should* just be able to do this since connect just need a
nullary function to call, who cares if it is a function pointer, a
functor, or any callable, it should just simplify things and just take
a Boost.Function, which can accept and use it all (and which it so
happens that the under-the-scenes Boost.Signals happens to take, thus
Wt is creating some Binds when it is not necessary (wasting time and
memory), and just making things all around more difficult then just
taking a simple TR1/Boost.Function).
pb->clicked().connect(boost::bind(&AddPersonAuto::bla,this,5));

> the error that I get is:
>
> error C2660: 'Wt::EventSignal<E>::connect' : function does not take 2
> arguments
>
> As you can see connect gets just just one argument - SLOT
> when I use a zero parameters I do it like this:
>
> pb->clicked().connect(SLOT(
>
> this, AddPersonAuto::onSubmit));
> isn't it the same?
> I'll be happy to hear the solution.
> Hadas
>
> On Mon, Nov 30, 2009 at 7:52 PM, hadass yaari <hadassyaari <at> gmail.com> wrote:
>>
>> Hello everybody,
>> I want to be able to pass parameters to the method that the
>> WText->clicked().connect method gets.
>> In all of the examples I saw that just a method with 0 parameters is used
>> but I read in the references that there are signals that gets arguments (up
>> to 6). I tried to call them but didn't succeeded.
>> How can I do that?
>> Maybe I need to connect another signal and not the built in? If so - how
>> can I connect it the mouse click on the text?
>> Thank you,
>> Hadas
>
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> witty-interest mailing list
> witty-interest <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
witty-interest mailing list
witty-interest <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest
Wim Dumon | 1 Dec 2009 18:34
Picon
Favicon

Re: signals

Hadass,

SLOT is a macro that is defined as:
#define SLOT(x, y) x, &y
I guess in your case you should omit the SLOT macro.

Regards,
Wim.

2009/12/1 hadass yaari <hadassyaari@...>:
> hello,
> I'm trying to use boost::bind to solve my problem. I did it like this:
>
> pb->clicked().connect(SLOT(
>
> this, (boost::bind<void>(&AddPersonAuto::bla,5))));
> the error that I get is:
>
> error C2660: 'Wt::EventSignal<E>::connect' : function does not take 2
> arguments
>
> As you can see connect gets just just one argument - SLOT
> when I use a zero parameters I do it like this:
>
> pb->clicked().connect(SLOT(
>
> this, AddPersonAuto::onSubmit));
> isn't it the same?
> I'll be happy to hear the solution.
> Hadas
>
> On Mon, Nov 30, 2009 at 7:52 PM, hadass yaari <hadassyaari@...> wrote:
>>
>> Hello everybody,
>> I want to be able to pass parameters to the method that the
>> WText->clicked().connect method gets.
>> In all of the examples I saw that just a method with 0 parameters is used
>> but I read in the references that there are signals that gets arguments (up
>> to 6). I tried to call them but didn't succeeded.
>> How can I do that?
>> Maybe I need to connect another signal and not the built in? If so - how
>> can I connect it the mouse click on the text?
>> Thank you,
>> Hadas
>
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> witty-interest mailing list
> witty-interest@...
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
OvermindDL1 | 1 Dec 2009 18:52
Picon

Re: signals

On Tue, Dec 1, 2009 at 10:38 AM, OvermindDL1 <overminddl1 <at> gmail.com> wrote:
> On Tue, Dec 1, 2009 at 10:15 AM, hadass yaari <hadassyaari <at> gmail.com> wrote:
>> hello,
>> I'm trying to use boost::bind to solve my problem. I did it like this:
>>
>> pb->clicked().connect(SLOT(
>>
>> this, (boost::bind<void>(&AddPersonAuto::bla,5))));
>
> Try this?  I am not sure it will work considering the very weird way
> Wt handles the connect function (*WAY* too over-engineered).
> pb->clicked().connect(this, (boost::bind(&AddPersonAuto::bla,_1,5)));
>
> And I honestly have no clue why Wt uses that nasty, useless SLOT macro
> either, you *should* just be able to do this since connect just need a
> nullary function to call, who cares if it is a function pointer, a
> functor, or any callable, it should just simplify things and just take
> a Boost.Function, which can accept and use it all (and which it so
> happens that the under-the-scenes Boost.Signals happens to take, thus
> Wt is creating some Binds when it is not necessary (wasting time and
> memory), and just making things all around more difficult then just
> taking a simple TR1/Boost.Function).
> pb->clicked().connect(boost::bind(&AddPersonAuto::bla,this,5));

I really mean this too, for example, what if I want to do something like this:
pb->clicked().connect(let(_a=ref(theTest))[if_(_a>0)[bind(AddPersonAuto::bla,val(this),_a++),bind(AddPersonAuto::differentBla,this,_a),--ref(theTest)]]);

To PrettyPrint that from above:
pb->clicked().connect(
    let(_a=ref(theTest))
    [
        if_(_a>0)
        [
            bind(AddPersonAuto::bla,val(this),_a++),
            bind(AddPersonAuto::differentBla,this,_a),
            --ref(theTest)
        ]
    ]
    );

Which would be the same thing as this:
void AddPersonAuto::doAction(void)
{
    int a = theTest;
    if(theTest>0)
    {
        bla(a++);
        differentBla(a);
        --theTest;
    }
}
pb->clicked().connect(SLOT(this, AddPersonAuto::doAction));

Which is of course a *lot* more wordy (and yes I know the example is
not the best designed, I am just showing some programming styles I
use, and yes, that is valid C++).

But I cannot do that because of the rather horrible way the
Wt::Signals class was designed, instead of being generic, it is broken
in the useful cases...
Yes, if you cannot tell, I have no clue why the connect function was
designed so, rather horribly, and yes it has been bugging me more and
more as time goes on...

On Tue, Dec 1, 2009 at 10:34 AM, Wim Dumon <wim <at> emweb.be> wrote:
> SLOT is a macro that is defined as:
> #define SLOT(x, y) x, &y
> I guess in your case you should omit the SLOT macro.

I just found out, that will not help, because whoever designed the
connect method did the stupid thing of doing things like:
  template<class T, class V>
    boost::signals::connection connect(T *target, void (V::*method)());
  template<class T, class V>
    boost::signals::connection connect(T *target, void (V::*method)(A1));
  template<class T, class V>
    boost::signals::connection connect(T *target, void (V::*method)(A1, A2));

And overloading it for each possible amount of variables (up to a
limit, not that high of a limit either), rather then just making it
generic, as would be expected and much more useful (and not require
that blasted SLOT macro at all, horrible design that macro is).

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
witty-interest mailing list
witty-interest <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest
Karun Gahlawat | 1 Dec 2009 19:29
Picon

Please unsubscribe


Sent from my iPhone

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
hadass yaari | 1 Dec 2009 20:00
Picon

Re: creating dynamic pages

Hello koen,
I would like the pages to be displayed in the same window. I also wants to navigate back if I want to the pages that I've been in. This why I want to create this pages and not just to clear the screen and show other things in the same page.
Thanks
Hadas
 
 
 
Hey Hadass,

2009/11/30 hadass yaari <hadassyaari-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
> The application that I build is combined with a SQL server.
> I have a lot of information that I keep in the DB as records.
> I want to be able to display a page with the wanted information that I got
> from the DB.
> I implemented it like this: the user choose the wanted data and then I clear
> the screen and display the data that I got from the DB.
> I want to do that differently: I want to?dynamically ?create pages. I mean,
> when the user clicks on the record that he wants to see, a message with the
> id parameter will be sent to the server and a new page will be created (with
> a url) and will be sent back to the client.
> How can I do that?

Where do you want the result to be displayed then, in a new window/tab ?

Regards,
koen

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
witty-interest mailing list
witty-interest@...
https://lists.sourceforge.net/lists/listinfo/witty-interest

Gmane