1. onClick_Listbox ?
- Posted by Robert Pilkington <pilking at BELLATLANTIC.NET>
Dec 17, 1999
-
Last edited Dec 18, 1999
I need to have a listbox in Win32Lib. When I click on one of the items, I
need it to trigger an event. Using onClick[thelistbox] =
routine_id("thisroutine")doesn't seem to call thisroutine when I click on an
item, so I was wondering how could I do it?
2. Re: onClick_Listbox ?
- Posted by Brent Hugh <bhugh at CSTP.UMKC.EDU>
Dec 17, 1999
-
Last edited Dec 18, 1999
At 10:34 PM 12/17/1999 -0500, you wrote:
>I need to have a listbox in Win32Lib. When I click on one of the items, I
>need it to trigger an event. Using onClick[thelistbox] =
>routine_id("thisroutine")doesn't seem to call thisroutine when I click on an
>item, so I was wondering how could I do it?
When I was doing something (perhaps) similar with a DropDownBox, I used
onGotFocus[MidiOutList] = routine_id("onGotFocus_MidiOutList"). That may
or may not work for you.
The other thing that works with DropDownBox is onChange . . . maybe this is
what you want.
--Brent
+++++++++++++++++++ Brent Hugh / bhugh at griffon.mwsc.edu ++++++++++++++++++
+ Missouri Western State College Dept of Music, St. Joseph, Missouri +
+ Piano Home Page: http://www.mwsc.edu/~bhugh +
+ Internet Piano Concert: http://cctr.umkc.edu/userx/bhugh/recital.html +
++++++++++ Classical Piano MP3s http://www.mp3.com/brent_d_hugh ++++++++++
3. Re: onClick_Listbox ?
From: Robert Pilkington <pilking at BELLATLANTIC.NET>
Subject: onClick_Listbox ?
> I need to have a listbox in Win32Lib. When I click on one of the items, I
> need it to trigger an event. Using onClick[thelistbox] =
> routine_id("thisroutine")doesn't seem to call thisroutine when I click on
an
> item, so I was wondering how could I do it?
Hi Robert:
You need to put your code in the on_change response, e.g:
-- code generated by Win32Lib IDE v0.8
include Win32Lib.ew
without warning
----------------------------------------------------------------------------
----
-- Window Window1
global constant Window1 = create( Window, "The Window", 0, Default, Default,
350, 250+ 19, 0 )
global constant List1 = create( List, "List1", Window1, 81, 37, 150, 120,
0 )
global constant LText2 = create( LText, "LText2", Window1, 32, 196, 280, 24,
0 )
----------------------------------------------------------------------------
----
procedure Window1_onOpen ()
addItem(List1,"One")
addItem(List1,"Two")
addItem(List1,"Three")
end procedure
onOpen[Window1] = routine_id("Window1_onOpen")
----------------------------------------------------------------------------
----
procedure List1_onChange ()
setText(LText2,
sprintf("You chose %d",getIndex(List1)))
end procedure
onChange[List1] = routine_id("List1_onChange")
----------------------------------------------------------------------------
----
WinMain( Window1, Normal )
Regards,
Irv