Development :  K-Meleon Web Browser Forum
K-Meleon development related discussions. 
launch bugmenot script by toolbar button
Posted by: froggy
Date: March 12, 2012 12:30AM

I want to launch the bugmenot macro thats on this site here:
http://kmeleon.sourceforge.net/wiki/KmmBugMeNot

but not by the rt. clicking in context menu, which is what this macro will do. I want to launch it by clicking a new toolbar button. Not sure what to put in toolbars.cfg ?

FYI My scripting experience in minimal.

Using v 1.5.3
Thanks



Edited 2 time(s). Last edit at 03/12/2012 01:00AM by froggy.

Options: ReplyQuote
Re: launch bugmenot script by toolbar button
Posted by: JohnHell
Date: March 15, 2012 03:59PM

Just edit a toolbar section or create your own (in this example I'll create my own) and just call the macro from a button inside that toolbar:

My Buttons bar{

      Button name{
      macros(BugMeNot)
      button mouseover description
      buttonimagebmp.bmp[0]
      buttonimagebmp.bmp[0]
      buttonimagebmp.bmp[0]
      }

}


Enable the toolbar "My Buttons bar" through the View menu.

The number between brackets is the index of the first 16px of the bmp you have. If you have a bmp of 16x16 (and therefore only one icon) you can just leave it as [0]. If you have a bmp of 32x16 and you want to use the image between the first 16px and the 32 px, you should use [1] to select it.

The three bmp definitions are for onmouseover, active and so on options with the button appearance.

Note that I'm using a 16px icon size, but can be defined other types.


But you have already a reference in the toolbars.cfg file:

#
# Toolbar Definition File for K-Meleon
#
# Jeff Doozan  <jeff@tcbnetworks.com>
#
#
#  ToolBar Name(16,16) {       # (width, height) is optional, defaults to 16, 16
#     Button Name(16, 16) {    # (width, height) is optional, defaults to toolbar dimensions
#       ID_NAV_STOP            # command id (required)
#       Stop Page Loading      # Tooltip text
#       c:\toolhot.bmp[2]      # hot image (optional)
#                              #   [2] (optional) is the zero based index of the
#                              #    image within the file, defaults to 0
#       c:\toolcold.bmp[2]     # cold image (optional)
#       c:\tooldead.bmp[2]     # disabled image (optional)
#    }
#  }
#
#  Notes:
#    - If don't specify any images in the toolbar, it will become a "text" based
#      toolbar, and use the button names in place of images
#



Edited 2 time(s). Last edit at 03/15/2012 04:01PM by JohnHell.

Options: ReplyQuote
Re: launch bugmenot script by toolbar button
Posted by: froggy
Date: March 17, 2012 12:15AM

THanks for the help.
I placed your code in the toolbars.cfg file:

My Buttons bar{

BugMeNot{
macros(BugMeNot)
button mouseover description
buttonimagebmp.bmp[0]
buttonimagebmp.bmp[0]
buttonimagebmp.bmp[0]
}
}

But I get a blank button. Not sure about the "Toolbar Definition File " you pasted.

Can I get the blank button to show "bugmenot" instad of a bmp ?
The button works buts its invisible unless the mouse is on it.

Options: ReplyQuote
Re: launch bugmenot script by toolbar button
Posted by: JamesD
Date: March 17, 2012 12:46AM

@ Froggy

You must actually have an image file of type = bmp. I have put one here: http://dl.dropbox.com/u/1522294/bugmenot.bmp It is not great, but it may work until you can get one that is better. Copy the file to KM root/skins/default folder. Make your code read as follows:
bugmenot.bmp[0]
bugmenot.bmp[0]
bugmenot.bmp[0]

Hanlon’s razor is an eponymous adage named after Robert J. Hanlon that states: “Never attribute to malice that which is adequately explained by stupidity.”

JamesD

Options: ReplyQuote
Re: launch bugmenot script by toolbar button
Posted by: froggy
Date: March 17, 2012 01:41AM

That works just fine. Thanks for the help !
Appreciate it.



Edited 1 time(s). Last edit at 03/17/2012 01:42AM by froggy.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.