Try placing your code in an "init item" rather than an "update item"

Maptitude Mapping Software <http://www.caliper.com>  Group Moderator


--- In [email protected], "timmelko" <timmelko@...> wrote:
>
> Toolbar Push Button based on an image variable.
> I'm in the process of rewriting our custom mapping module and having
some difficulty with the Push Button feature and attempting to make this
module work with Maptitude 4.8, 5.0 and 6.0.
>
> Using the current code (below) I am able to get the RSC to compile
without errors but it doesn't work.
>
> In Maptitude 4.8 the toolbar button has no image.
>
> In Maptitude 5 and 6… the pre-declared variables seem to cause the
program to reference the memory illegally.
>
> If I remove the [global string_but1a, string_but1b, string_but1c]
Macro `Interface' where I have them defined… the illegal memory
error goes away… but I encounter the same behavior as in 4.8, I get
a blank button.
>
> If anyone has any thoughts I would appreciate it!
>
> ~Tim Melko~
>
> Toolbar "Main Bar"
> Update
> Do
> info = GetProgram()
> if info[5] = 4.800000 then do
>  string_but1a = "buttons_48.bmp|230"
>  string_but1b = "buttons_48.bmp|264"
>  string_but1c = "buttons_48.bmp|298"
>  end
>  else do
>  string_but1a = "MainButtons.bmp|7"
>  string_but1b = null
>  string_but1c = null
>  end
> enditem
>
>  Button "Map Themes"
>  icon: string_but1a
>  Help: "Map Themes"
>  Do
>  runDbox("theme_Dbox")
>  enditem
>
> endToolBar
>

Reply via email to