Sign in to follow this  
Followers 0
Damein

What's all the reasons an img won't connect to a button?

14 posts in this topic

I've done it dozens of times with no problems, but for some reason this time it will not work.

$ScoutButton = GuiCtrlCreateButton("Scout", 10, 400, 80, 80, $BS_BITMAP)
    GUICtrlSetImage($ScoutButton, "Img/Scout/ScoutImage.bmp", 1)
    GUICtrlSetOnEvent($ScoutButton, "_Scout")

I've redownloaded and saved a bmp, editted in paint and saved as a bmp and still nothing. Now if I create a plain Pic control, it displays. But not on the button. Why?


MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Share this post


Link to post
Share on other sites



"Img/Scout/ScoutImage.bmp" is not a valid path - use the complete path and it will work.

Also, windows path is using backslashes (\) not /


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

I assumed that might be a problem too, so I tried both ways with no success.

And, if the path is not valid why does it work with GuiCtrlCreatePic? I have the script in the folder before Imgs, so theres no reason its not a valid path.

I tried using \ instead of / as well to no avail.


MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Share this post


Link to post
Share on other sites

Hmm, anyone else have any ideas?


MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Share this post


Link to post
Share on other sites

Omit the 3rd parameter? Based on the documentation, the last two parameters to GuiCtrlSetImage are to specify the particular icon in a multi-icon file. I don't think it should be used for a bitmap.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

No go :graduated:

Here is all the files used, and some not used yet. If someone could take a look and find out exactly why its not working I would be much appreciative.

http://www.mediafire.com/?14pw1k5mx2fp4dt

Edited by Damein

MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Share this post


Link to post
Share on other sites

Oh, you'll have to change the destination folder for the $ScoutButton image, I attempted a full path.


MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Share this post


Link to post
Share on other sites

I made the image 80x80 and still nothing :/


MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Share this post


Link to post
Share on other sites

Anyone else have any input on this? I'm still struggling to find a reason why this won't work.


MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Share this post


Link to post
Share on other sites

Instead of using a button and assigning an image to it, just use an image. It will work just like a button, with guigetmsg. So instead og $scoutbutton = guictrlcreatebutton(blah, blah, blah) use $scoutbutton = guictrlcreatepic(blah, blah, blah).

Share this post


Link to post
Share on other sites

You know, I just found out something.

Originally, I was using this as the code:

$ScoutButton = GuiCtrlCreatePic("Imgs/Scout/ScoutImage.bmp",10,400,80,80)
GUICtrlSetOnEvent($ScoutButton, "_Scout")

Which works fine, but then I decided to add $SS_SUNKEN to make it look nicer and it no longer worked. So I for some reason was like "Oh no, it stopped working randomly!" because I walked away for a bit before testing the Event command. So I removed the $SS_SUNKEN and it worked again.

Now, is there a way to make it so the GuiCtrlSetOnEvent still works, with the $SS_SUNKEN parameter?


MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Share this post


Link to post
Share on other sites

That's because a Pic control has a default style of $SS_NOTIFY. You overrode that with $SS_SUNKEN, so it no longer sends click notifications. You need BitOR($SS_NOTIFY, $SS_SUNKEN).

RTFM my friend...

Share this post


Link to post
Share on other sites

Well spotted. Does your script work now?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0