Re: [Pharo-users] image resize event

2013-08-20 Thread Henrik Johansen
On Aug 19, 2013, at 6:07 , Usman Bhatti wrote: > Hello, > > I would like to resize all my windows opened inside my image when resizing > the image window. Can anyone point me to the hook where I can plug my code > for window resizing? > > For example, it would like to do > onImageResize >

Re: [Pharo-users] image resize event

2013-08-20 Thread fritsche . markus

[Pharo-users] Process ID of VM

2013-08-20 Thread Torsten Bergmann
I just wrapped this in NB last week, so if you have NativeBoost and Windows you can use: NBWin32Process getCurrentProcessId (requires the latest packages from http://smalltalkhub.com/#!/~Pharo/NativeBoost) I'm sure on any other platforms there are API's as well to get the PID, like getpid o

Re: [Pharo-users] Process ID of VM

2013-08-20 Thread Igor Stasenko
Thanks for your hard work! 1 important remark: NBXLibTypes class>>initialize super initialize. Display := #NBXLibDisplay. Never use 'super initialize' for class initializers. On 20 August 2013 09:42, Torsten Bergmann wrote: > I just wrapped this in NB last week, so if you h

Re: [Pharo-users] Process ID of VM

2013-08-20 Thread Tim Hendriks
I'am just learning (a few weeks) so why not use super in Class? Thanks Tim Op 20-8-2013 11:29, Igor Stasenko schreef: Thanks for your hard work! 1 important remark: NBXLibTypes class>>initialize super initialize. Display := #NBXLibDisplay. Never use 'super initialize' fo

Re: [Pharo-users] Process ID of VM

2013-08-20 Thread Henrik Johansen
On Aug 20, 2013, at 11:34 , Tim Hendriks wrote: > I'am just learning (a few weeks) so why not use super in Class? > > Thanks Tim Nothing wrong with using super in Class, but using it in class initialize is a no-no. That method is treated specially and called once a Class is loaded into

Re: [Pharo-users] Process ID of VM

2013-08-20 Thread Igor Stasenko
Classes forming the tree structure (one class can have many subclasses). A class initialization usually done for initializing properties shared by class and all its subclasses, and sent automatically to tools like Monticello when it loads the code to each separate class. So, if we use 'super initia

Re: [Pharo-users] Process ID of VM

2013-08-20 Thread jtuc...@objektfabrik.de
Hi Tim, the problem is not the send of #super to a class, but the call of #initialize of #super on the class side. As long as you are not interested in very confusing details about the inheritence hierarchy of Class and Metaclasses and stuff, don't ask, just do as you're told ;-) You can, ho

Re: [Pharo-users] Process ID of VM

2013-08-20 Thread Tim Hendriks
Ok, I don't want to know :-) Just as a rule: don't call super initialize on the Class site ? But I can use (the message) initialize on the Class site (for initializing applications roots in seaside for example) but just do'nt use super in it. Correct? Thanks Tim Op 20-8-2013 11:45, jtuc...@

Re: [Pharo-users] Process ID of VM

2013-08-20 Thread Esteban Lorenzano
no, you do not call super initialize in class side initialize method. You do not do: MyClass class>>#initialize super initialize. "THIS IS BAD" ... rest of initialization. we should add a Lint rule with that, btw. On Aug 20, 2013, at 11:52 AM, Tim Hendriks wrote: > Ok, I d

Re: [Pharo-users] Process ID of VM

2013-08-20 Thread jtuc...@objektfabrik.de
Ok, here's the mess we made ;-). We've confused you. But don't worry, you've just touched an area of Smalltalk where the boundaries between computation and magic get very blurry. You can implement the method initialze (just like any other method) on the instance or class side. For instance

Re: [Pharo-users] Process ID of VM

2013-08-20 Thread Tim Hendriks
OK Thanks a lot. I won't call super initialize on de Class side Don't know why I just don't simpel Thanks for trying to explain why. Op 20-8-2013 12:00, Esteban Lorenzano schreef: no, you do not call super initialize in class side initialize method. You do not do: MyClass

Re: [Pharo-users] Process ID of VM

2013-08-20 Thread Esteban Lorenzano
but you can do MyClass class>>#someOtherMethodWhichIsNotCalled"initialize" super someOtherMethodWhichIsNotCalled"initialize". etc... the restriction is just for the method called #initialize :) Esteban On Aug 20, 2013, at 12:22 PM, Tim Hendriks wrote: > OK Thanks a lot. > >

Re: [Pharo-users] Process ID of VM

2013-08-20 Thread Tim Hendriks
Op 20-8-2013 13:39, Esteban Lorenzano schreef: but you can do MyClass class>>#someOtherMethodWhichIsNotCalled"initialize" super someOtherMethodWhichIsNotCalled"initialize". etc... the restriction is just for the method called #initialize :) Just to make it simple, I guess :-)

Re: [Pharo-users] image resize event

2013-08-20 Thread Tudor Girba
I would like to know the solution for this as well :) Doru On Tue, Aug 20, 2013 at 9:30 AM, wrote: > > *Von: *Henrik Johansen > *Gesendet: *Dienstag, 20. August 2013 09:24 PM > *An: *Any question about pharo is welcome > *Antwort an: *Any question about pharo is welcome > *Betreff: *Re: [Pha

Re: [Pharo-users] image resize event

2013-08-20 Thread Usman Bhatti
Fernando is going to propose a fix for this in PasteUpMorph>>extent: Once his fix integrated in Pharo, PasteUpMorph announcer can be used to capture the image window size change event and trigger the update code: World announcer on: WindowResizing do:[ do some actions] usman On Tue, Aug 20, 201

Re: [Pharo-users] image resize event

2013-08-20 Thread Stéphane Ducasse
On Aug 20, 2013, at 6:26 PM, Usman Bhatti wrote: > Fernando is going to propose a fix for this in PasteUpMorph>>extent: > Once his fix integrated in Pharo, PasteUpMorph announcer can be used to > capture the image window size change event and trigger the update code: > > World announcer on: Wi

Re: [Pharo-users] Process ID of VM

2013-08-20 Thread Udo Schneider
On 20.08.13 09:42, Torsten Bergmann wrote: NBWin32Process getCurrentProcessId The NativeBoost approach is a really good idea! I'll check whether I can get this working on other platforms as Win32 as well. Thanks, Udo

Re: [Pharo-users] Process ID of VM

2013-08-20 Thread Udo Schneider
On 19.08.13 23:16, David T. Lewis wrote: If you have OSProcess: OSProcess thisOSProcess pid Thats's a good one. I'm currently checking if OSProcess is loaded and then using it. Still searching for some way to diffrentiate images. I'm currently thinking about generating a unique ID during

[Pharo-users] NativeBoost: Null-terminated Strings

2013-08-20 Thread Udo Schneider
All, I just wrapped a few functions using NB - as easy as it used to be in Dolphin! Really nice. I'm stuck with a simple thing however. I'm passing a string buffer into a function which fills this buffer (null-terminated String). The passed in String however contains all the nulls as well (w

Re: [Pharo-users] Process ID of VM

2013-08-20 Thread Igor Stasenko
on windoze, getting pid of current process is piece of cake (GetModuleHangle). On 20 August 2013 19:16, Udo Schneider wrote: > On 20.08.13 09:42, Torsten Bergmann wrote: > >>NBWin32Process getCurrentProcessId >> > The NativeBoost approach is a really good idea! I'll check whether I can > ge

Re: [Pharo-users] Process ID of VM

2013-08-20 Thread Igor Stasenko
see NativeBoostWin32 class>>getVMModuleHandle On 21 August 2013 04:42, Igor Stasenko wrote: > on windoze, getting pid of current process is piece of cake > (GetModuleHangle). > > > On 20 August 2013 19:16, Udo Schneider wrote: > >> On 20.08.13 09:42, Torsten Bergmann wrote: >> >>>NBWin32Pro

Re: [Pharo-users] NativeBoost: Null-terminated Strings

2013-08-20 Thread Igor Stasenko
String pseudo type corresponds to 'const char *' type.. because it passes the string by copying it on stack and null terminating it there, and then pushing the pointer (which on stack), as argument to function. That means that original string is never modified, in your case function will modify a t