Having trouble with setting a click call back

Share your scripts and packages with other Mudlet users.
Post Reply
mena_katep
Posts: 1
Joined: Thu Jan 07, 2016 8:55 am

Having trouble with setting a click call back

Post by mena_katep »

As the title states, I'm having a lot of issues setting a click call back within one of my scripts in Mudlet. I have a clearly defined label and I believe the function I'm using within the callback function is correct. . I think, though, that perhaps the action I'm attempting to perform isn't valid.

So, I have a label set with a stylesheet that has QLabel and QLabel::hover to change the image on hover; however, I wanted to set a click call back on the label to change the image when I click it. It's three different images: the default tab is inactive image, the hover tab is inactive image and also the selected tab is active image. The first two bits work fine it's the on click to change the image that won't. If it's not possible to change the QLabel image in this way, is there another alternative? I previously attempted to use setLabelOnEnter and setLabelOnLeave but alas I had a great many problems trying to get them functional.

Hopefully this is explanatory enough for my intent! If not, let me know and I'll post some of the code and try to elaborate a bit more!

Thanks
Mena_Katep

User avatar
SlySven
Posts: 995
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Having trouble with setting a click call back

Post by SlySven »

I cannot remember the exact words but does this mean you want one of the pseudo-states like QLabel::selected or QLabel::active or QLabel::on? You will want to find the "Qt Style Sheets Reference" to get the full list...

Go2Market
Posts: 1
Joined: Wed Mar 10, 2021 8:38 am

Re: Having trouble with setting a click call back

Post by Go2Market »

As the title says, I am having a lot of trouble setting up a click call within one of my Mudlet scripts. I have a clearly defined label and I think the function I am using inside the callback function is correct. . I think, however, that perhaps the action I am trying to take is invalid.

User avatar
Vadi
Posts: 4941
Joined: Sat Mar 14, 2009 3:13 pm

Re: Having trouble with setting a click call back

Post by Vadi »

Could you post the code you're running?

Post Reply