RE: return value from dialog window

new topic     » goto parent     » topic index » view thread      » older message » newer message

Horvath Stefan wrote:
> 
> 
> it works fine, here's the code. Thank you ck.
> But I think to make without global variable, if it is possible.
> 
> > " But I bet there's an easier way. ;) ". (ck)
> 
> I must find that way.
> Steve.

I must be misunderstanding your request but what's wrong with using
message_box() instead of a custom dialog?

For example:
include win32lib.ew
without warning
  ------------------------------
constant 
   Win  = create( Window, "YesNo Dialog", 0, Default, Default, 300, 220, 0 ),
   DlgB = create( PushButton, "Click here", Win, 40, 48, 100, 24, 0 ),
   SB   = create(StatusBar, "", Win, 0, 0, 0, 0, 0 )
  ------------------------------
procedure onClick_DlgB(integer self, integer event, sequence params)
   integer response

   response = message_box( "What's your answer?", "YesNo Dialog", MB_YESNO )
   if response = IDYES then
     setText( SB, "Yes" )
   else -- response = IDNO
     setText( SB, "No" )
   end if
end procedure
setHandler(DlgB, w32HClick, routine_id("onClick_DlgB"))
------------------------------
  WinMain(Win, Normal)
------------------------------

-- Brian

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu