digitalmars.D.dwt - HelloWorld using Win32lib
- Derek Parnell (15/15) Feb 07 2006 Ok, in the interests of GUI comparisons, here is the entire HW program
- Andrew Fedoniouk (12/21) Feb 07 2006 And you will get syntax error :)
- Derek Parnell (27/50) Feb 07 2006 Content-type: text/plain; charset="us-ascii"
-
Andrew Fedoniouk
(14/55)
Feb 07 2006
So what does
on the Form?
Ok, in the interests of GUI comparisons, here is the entire HW program using the Windows library I want to port to D. import win32lib; void startApp() { createForm("My First Message", -- Window title "Hello World!" -- Put some text in it ) } -- Derek (skype: derek.j.parnell) Melbourne, Australia "Down with mediocracy!" 8/02/2006 12:41:35 PM
Feb 07 2006
"Derek Parnell" <derek psych.ward> wrote in message news:vsay7aqghfwh.191c9c9rc6ex6.dlg 40tude.net...Ok, in the interests of GUI comparisons, here is the entire HW program using the Windows library I want to port to D. import win32lib; void startApp() { createForm("My First Message", -- Window title "Hello World!" -- Put some text in it ) }And you will get syntax error :) Form is MessageBox here I beleive. MessageBox(0, "My First Message", "Hello World!", MB_OK) is even shorter. Form to be practical should be parametrized by some resource - its layout definition so createForm(caption, text) will work if text is some markup otherwise it should be createForm(caption, dlgResId) Not so easy, huh? :) Andrew.
Feb 07 2006
Content-type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Tue, 7 Feb 2006 18:08:15 -0800, Andrew Fedoniouk wrote:"Derek Parnell" <derek psych.ward> wrote in message news:vsay7aqghfwh.191c9c9rc6ex6.dlg 40tude.net...Ok, so I copied the code from a *working* Euphoria program, thus the wrong comment syntax.Ok, in the interests of GUI comparisons, here is the entire HW program using the Windows library I want to port to D. import win32lib; void startApp() { createForm("My First Message", -- Window title "Hello World!" -- Put some text in it ) }And you will get syntax error :)Form is MessageBox here I beleive.You believe wrongly.MessageBox(0, "My First Message", "Hello World!", MB_OK) is even shorter.But that's not what this program does. See the attachment.Form to be practical should be parametrized by some resource - its layout definition so createForm(caption, text) will work if text is some markup otherwise it should be createForm(caption, dlgResId)My example is *one* way to skin the cat. If we are talking commercial applications then all user visible text needs to be parameterized and resolved at runtime. setUserLanguage( langCode ) . . . createForm("<apptitle>", // Window title "<hwtext>" // Put some text in it ) Where 'apptitle' and 'hwtext' are resource identifiers that are replaced at runtime by the real text for the user's chosen language (if defined).Not so easy, huh? :)Yes, it is. I've done it in this library already and it works. -- Derek (skype: derek.j.parnell) Melbourne, Australia "Down with mediocracy!" 8/02/2006 1:10:30 PM
Feb 07 2006
"Derek Parnell" <derek psych.ward> wrote in message news:14mxblmynomu9.177qhx00fo875.dlg 40tude.net...On Tue, 7 Feb 2006 18:08:15 -0800, Andrew Fedoniouk wrote:So what does <hwtext> on the Form? Or what this Form does? Shows plain text? Purpose? In the whole win32 API there is only one function which accepts window caption and window text ::MessageBox. To be short: createForm in the given example is capable to serve only HelloWorld purposes. Or show full signature of createForm. Probably I don't understand something in principle."Derek Parnell" <derek psych.ward> wrote in message news:vsay7aqghfwh.191c9c9rc6ex6.dlg 40tude.net...Ok, so I copied the code from a *working* Euphoria program, thus the wrong comment syntax.Ok, in the interests of GUI comparisons, here is the entire HW program using the Windows library I want to port to D. import win32lib; void startApp() { createForm("My First Message", -- Window title "Hello World!" -- Put some text in it ) }And you will get syntax error :)Form is MessageBox here I beleive.You believe wrongly.MessageBox(0, "My First Message", "Hello World!", MB_OK) is even shorter.But that's not what this program does. See the attachment.Form to be practical should be parametrized by some resource - its layout definition so createForm(caption, text) will work if text is some markup otherwise it should be createForm(caption, dlgResId)My example is *one* way to skin the cat. If we are talking commercial applications then all user visible text needs to be parameterized and resolved at runtime. setUserLanguage( langCode ) . . . createForm("<apptitle>", // Window title "<hwtext>" // Put some text in it ) Where 'apptitle' and 'hwtext' are resource identifiers that are replaced at runtime by the real text for the user's chosen language (if defined).I trust you. Andrew Fedoniouk. http://terrainformatica.comNot so easy, huh? :)Yes, it is. I've done it in this library already and it works. --
Feb 07 2006