View mode: basic / threaded / horizontal-split · Log in · Help
August 07, 2006
Make, Build, DMD front-end
Derek Parnell wrote:
> On Mon, 07 Aug 2006 22:24:57 +0200, Dejan Lekic wrote:
> 
> 
>>I share this opinion. Everyone has GNU Make.
> 
> 
> I don't.
> 

I don't either.

However, I'm of the opinion that the DMD front-end should incorporate a 
little of Derek's Build goodness: specifically the facility to 
incorporate imported modules as part of the codegen/link step.

DMD has always opened and parsed all import modules, but right now it 
appears to discard them before codegen. Seems to me that should change 
(via a switch, or something); assuming Derek were given some credit for it
August 08, 2006
Re: FLTK native in 'D'. Would that be useful?
Derek Parnell wrote:

>>I share this opinion. Everyone has GNU Make.
> 
> I don't.

At this point you can probably just run Build
on the sample application for the same effect ?

(that would be "d-fltk-1.1.x/D/test/hello.d")

Matthias needs some volunteers to port to, and
test on, the Windows and X11 platforms anyway

--anders
August 09, 2006
Re: FLTK native in 'D'. Would that be useful?
MatthiasM escribió:
> 
> Hello everyone,
> 
> as promised, I have put a first attempt at D-FLTK onto our Subversion 
> system. The test application "hello" runs already on OS X.
> 
> Everyone interested, please feel free to download, play, improve and 
> comment! You can send patches to me directly. You can also join the 
> general fltk newsgroup and discuss D-FLTK there (until the C++ folks 
> complain about too much traffic ;-)
> 
> Anyway, I hop ya'll enjoy and don't get scared by my "D" style.
> 
> 
> Here's how you get the source:
> 
> 
> svn co http://svn.easysw.com/public/fltk/fltk/branches/branch-D-1.1 
> d-fltk-1.1.x
> 
> 
> All "D" sources are in - um - "D". The rest of the FLTK archive is 
> intact to make it easy to compare "D" and "C++" code.
> 
> Matthias

You forgot to add std/c/osx/qd/quickdraw.d to rev 5287. Also, the previous two 
revs didn't work (I got "bus error" with both of them)

-- 
Carlos Santander Bernal
August 09, 2006
Re: FLTK native in 'D'. Would that be useful?
Carlos Santander wrote:
> You forgot to add std/c/osx/qd/quickdraw.d to rev 5287. Also, the 
> previous two revs didn't work (I got "bus error" with both of them)

Thanks. I added the quickdraw.d header file.

If you get a bus error (which is very likely in this early state), it 
would be helpful if you could run 'gdb' on the executable and post the 
first eight or so lines of the traceback. Just enter:

  gdb button
  run
  bt

like so:

> gdb button
(gdb) run
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x0000000a
0x00003ec0 in _Dmain (args={length = 1, ptr = 0x303710}) at test/button.d:53
53        (cast(ubyte*)null)[10] = 3;
(gdb) bt
#0  0x00003ec0 in _Dmain (args={length = 1, ptr = 0x303710}) at 
test/button.d:53
#1  0x0002c368 in _d_run_main2goFZv ()
#2  0x0002c42c in _d_run_main ()
#3  0x000024a4 in _start (argc=1, argv=0xbffff9a0, envp=0xbffff9a8) at 
/SourceCache/Csu/Csu-58.1.1/crt.c:272
#4  0x0000234c in start ()
(gdb)

Thanks!

Matthias
August 09, 2006
Re: FLTK native in 'D'. Would that be useful?
MatthiasM escribió:
> 
> Thanks. I added the quickdraw.d header file.

Ok. Now I get "make: *** No rule to make target `test/button.o', needed by
`button'.  Stop." I guess test/button.d is missing.

> 
> If you get a bus error (which is very likely in this early state), it 
> would be helpful if you could run 'gdb' on the executable and post the 
> first eight or so lines of the traceback. Just enter:
> 

Ok, here it is (rev 5288):

(gdb) bt
#0  0xffff8824 in ___memcpy () at
/System/Library/Frameworks/System.framework/PrivateHeaders/ppc/cpu_capabilities.h:189
#1  0x00026bd8 in _adDup (a={length = 2, ptr = 0x0}, szelem=4218832) at
../../../gcc-4.0.3/libphobos/internal/adi.d:576
#2  0x000104a0 in _D2fl6widget9Fl_Widget10copy_labelFAaZv (this=@0x407f80,
a={length = 2, ptr = 0x0}) at fl/widget.d:356
#3  0x00002600 in _Dmain (args={length = 1, ptr = 0x303610}) at test/hello.d:37
#4  0x00028a28 in _d_run_main2goFZv () at
../../../gcc-4.0.3/libphobos/internal/dgccmain2.d:83
#5  0x00028afc in _d_run_main (argc=4218832, argv=0x0, main_func=0x2) at
../../../gcc-4.0.3/libphobos/internal/dgccmain2.d:93
#6  0x00001e7c in _start (argc=1, argv=0xbffffb70, envp=0xbffffb78) at
/SourceCache/Csu/Csu-58/crt.c:272
#7  0x00001d24 in start ()


-- 
Carlos Santander Bernal
August 09, 2006
Re: FLTK native in 'D'. Would that be useful?
Carlos Santander wrote:
>> Thanks. I added the quickdraw.d header file.
> 
> Ok. Now I get "make: *** No rule to make target `test/button.o', needed by
> `button'.  Stop." I guess test/button.d is missing.

Gee, where did I leave my brain yesterday? OK, it is added.

> Ok, here it is (rev 5288):
> 
> (gdb) bt

Cool. Thanks! That shows that I did not understand slicing, duplicating 
and flexible arrays yet ;-)
August 10, 2006
Re: FLTK native in 'D'. Would that be useful?
MatthiasM escribió:
> Carlos Santander wrote:
>>> Thanks. I added the quickdraw.d header file.
>>
>> Ok. Now I get "make: *** No rule to make target `test/button.o', 
>> needed by
>> `button'.  Stop." I guess test/button.d is missing.
> 
> Gee, where did I leave my brain yesterday? OK, it is added.
> 
>> Ok, here it is (rev 5288):
>>
>> (gdb) bt
> 
> Cool. Thanks! That shows that I did not understand slicing, duplicating 
> and flexible arrays yet ;-)
> 

rev 5291 works except when exiting the programs with Command-Q: bus error again. 
Here's what I get:

(gdb) bt
#0  0x0001b774 in _D2fl3mac21QuitAppleEventHandlerFPvPviZi (appleEvt=0xbfffead0, 
reply=0xbfffeae0, refcon=0) at fl/mac.d:1309
#1  0x914f9960 in aeDispatchAppleEvent ()
#2  0x91504fc0 in sendToSelf ()
#3  0x914fd8f8 in AESendMessage ()
#4  0x914fd3d4 in aeSend ()
#5  0x9329938c in AESend ()
#6  0x9334fcc4 in SendCoreAEToSelf ()
#7  0x932b5bf0 in HandleCommandEvent ()
#8  0x931e72b4 in HIApplication::EventHandler ()
#9  0x931ea554 in DispatchEventToHandlers ()
#10 0x931e9cac in SendEventToEventTargetInternal ()
#11 0x932298f8 in CallNextEventHandler ()
#12 0x0001b2a8 in _D2fl3mac21carbonDispatchHandlerFPvPvPvZi 
(nextHandler=0xbffff010, event=0x309730, userData=0x0) at fl/mac.d:1113
#13 0x931ea554 in DispatchEventToHandlers ()
#14 0x931e9cac in SendEventToEventTargetInternal ()
#15 0x931f0a60 in SendEventToEventTarget ()
#16 0x932692cc in SendHICommandEvent ()
#17 0x93299158 in SendMenuItemSelectedEvent ()
#18 0x932b49d0 in HandleKeyboardEvent ()
#19 0x931ea554 in DispatchEventToHandlers ()
#20 0x931e9cac in SendEventToEventTargetInternal ()
#21 0x931e9b28 in SendEventToEventTargetWithOptions ()
#22 0x932b3ce0 in HandleKeyboardEvent ()
#23 0x931f0ddc in ToolboxEventDispatcherHandler ()
#24 0x931ea7a4 in DispatchEventToHandlers ()
#25 0x931e9cac in SendEventToEventTargetInternal ()
#26 0x932298f8 in CallNextEventHandler ()
#27 0x0001b2a8 in _D2fl3mac21carbonDispatchHandlerFPvPvPvZi 
(nextHandler=0xbffff7e0, event=0x30a660, userData=0x0) at fl/mac.d:1113
#28 0x931ea554 in DispatchEventToHandlers ()
#29 0x931e9cac in SendEventToEventTargetInternal ()
#30 0x931f0a60 in SendEventToEventTarget ()
#31 0x0001b534 in _D2fl3mac16do_queued_eventsFdZd (time=1e+20) at fl/mac.d:1259
#32 0x0001b6b8 in _D2fl3mac7fl_waitFdZi (time=1e+20) at fl/mac.d:1294
#33 0x00002740 in _D2fl2fl2Fl4waitFdZd (time_to_wait=1e+20) at fl/fl.d:141
#34 0x000027dc in _D2fl2fl2Fl3runFZi () at fl/fl.d:197
#35 0x00002650 in _Dmain (args={length = 1, ptr = 0x303610}) at test/hello.d:40
#36 0x00028a28 in _d_run_main2goFZv () at 
../../../gcc-4.0.3/libphobos/internal/dgccmain2.d:83
#37 0x00028afc in _d_run_main (argc=1, argv=0x0, main_func=0x1800000) at 
../../../gcc-4.0.3/libphobos/internal/dgccmain2.d:93
#38 0x00001e7c in _start (argc=1, argv=0xbffffb68, envp=0xbffffb70) at 
/SourceCache/Csu/Csu-58/crt.c:272
#39 0x00001d24 in start ()


-- 
Carlos Santander Bernal
August 10, 2006
carbon modules (was Re: FLTK native in 'D'. Would that be useful?)
HideSheetWindow is declared twice in windowmanager.

Also, maybe you should change your function pointer types from typedefs to 
aliases so no casting is required to use them.

-- 
Carlos Santander Bernal
August 13, 2006
Re: FLTK native in 'D'. Would that be useful?
I had a little more time and managed to port pushhbuttons and keyboard 
handling. The "button" demo works pretty well now.

I also ported the standard dialogs (messages, alerts, simple choices), 
and apart from the Fl_Input widget, the seem to work.

Group resizing is now implemented as well.

So, just in case you are writing a GUI app on Mac that only needs 
pushbuttons in a window, D-FLTK is usable for you ;-)


Matthias


PS: since I don't have the terminating 0 in "D" strings, you will 
sometimes see additional letters popping up in labels. This still 
requires fixing. The code is in "D/fl/draw.d", called fl_measure and 
fl_draw... .

PPS: download is still only via svn from:
  http://svn.easysw.com/public/fltk/fltk/branches/branch-D-1.1
August 13, 2006
Re: FLTK native in 'D'. Would that be useful?
MatthiasM escribió:
> 
> I had a little more time and managed to port pushhbuttons and keyboard 
> handling. The "button" demo works pretty well now.
> 
> I also ported the standard dialogs (messages, alerts, simple choices), 
> and apart from the Fl_Input widget, the seem to work.
> 
> Group resizing is now implemented as well.
> 
> So, just in case you are writing a GUI app on Mac that only needs 
> pushbuttons in a window, D-FLTK is usable for you ;-)
> 
> 
> Matthias
> 
> 
> PS: since I don't have the terminating 0 in "D" strings, you will 
> sometimes see additional letters popping up in labels. This still 
> requires fixing. The code is in "D/fl/draw.d", called fl_measure and 
> fl_draw... .
> 
> PPS: download is still only via svn from:
>   http://svn.easysw.com/public/fltk/fltk/branches/branch-D-1.1

I still get a bus error when pressing Command-Q with rev 5297 (both hello and 
button):

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x00023e1c in _D2fl3mac21QuitAppleEventHandlerFPvPviZi (appleEvt=0xbfffead0, 
reply=0xbfffeae0, refcon=0) at fl/mac.d:1295
1295        if ( Fl_X.first == x ) {
(gdb) bt
#0  0x00023e1c in _D2fl3mac21QuitAppleEventHandlerFPvPviZi (appleEvt=0xbfffead0, 
reply=0xbfffeae0, refcon=0) at fl/mac.d:1295
#1  0x914f9960 in aeDispatchAppleEvent ()
#2  0x91504fc0 in sendToSelf ()
#3  0x914fd8f8 in AESendMessage ()
#4  0x914fd3d4 in aeSend ()
#5  0x9329938c in AESend ()
#6  0x9334fcc4 in SendCoreAEToSelf ()
#7  0x932b5bf0 in HandleCommandEvent ()
#8  0x931e72b4 in HIApplication::EventHandler ()
#9  0x931ea554 in DispatchEventToHandlers ()
#10 0x931e9cac in SendEventToEventTargetInternal ()
#11 0x932298f8 in CallNextEventHandler ()
#12 0x0002389c in _D2fl3mac21carbonDispatchHandlerFPvPvPvZi 
(nextHandler=0xbffff010, event=0x409490, userData=0x0) at fl/mac.d:1100
#13 0x931ea554 in DispatchEventToHandlers ()
#14 0x931e9cac in SendEventToEventTargetInternal ()
#15 0x931f0a60 in SendEventToEventTarget ()
#16 0x932692cc in SendHICommandEvent ()
#17 0x93299158 in SendMenuItemSelectedEvent ()
#18 0x932b49d0 in HandleKeyboardEvent ()
#19 0x931ea554 in DispatchEventToHandlers ()
#20 0x931e9cac in SendEventToEventTargetInternal ()
#21 0x931e9b28 in SendEventToEventTargetWithOptions ()
#22 0x932b3ce0 in HandleKeyboardEvent ()
#23 0x931f0ddc in ToolboxEventDispatcherHandler ()
#24 0x931ea7a4 in DispatchEventToHandlers ()
#25 0x931e9cac in SendEventToEventTargetInternal ()
#26 0x932298f8 in CallNextEventHandler ()
#27 0x0002389c in _D2fl3mac21carbonDispatchHandlerFPvPvPvZi 
(nextHandler=0xbffff7e0, event=0x425ff0, userData=0x0) at fl/mac.d:1100
#28 0x931ea554 in DispatchEventToHandlers ()
#29 0x931e9cac in SendEventToEventTargetInternal ()
#30 0x931f0a60 in SendEventToEventTarget ()
#31 0x00023bdc in _D2fl3mac16do_queued_eventsFdZd (time=1e+20) at fl/mac.d:1245
#32 0x00023d60 in _D2fl3mac7fl_waitFdZi (time=1e+20) at fl/mac.d:1280
#33 0x00002960 in _D2fl2fl2Fl4waitFdZd (time_to_wait=1e+20) at fl/fl.d:167
#34 0x000029fc in _D2fl2fl2Fl3runFZi () at fl/fl.d:223
#35 0x0000275c in _Dmain (args={length = 1, ptr = 0x403610}) at test/button.d:55
#36 0x00031fac in _d_run_main2goFZv () at 
../../../gcc-4.0.3/libphobos/internal/dgccmain2.d:83
#37 0x00032080 in _d_run_main (argc=1, argv=0x0, main_func=0x1800000) at 
../../../gcc-4.0.3/libphobos/internal/dgccmain2.d:93
#38 0x00001e9c in _start (argc=1, argv=0xbffffb68, envp=0xbffffb70) at 
/SourceCache/Csu/Csu-58/crt.c:272
#39 0x00001d44 in start ()


-- 
Carlos Santander Bernal
4 5 6 7 8 9 10 11
Top | Discussion index | About this forum | D home