Gadget initialization

Mac OSX specific forum
User avatar
dhouston
Enthusiast
Enthusiast
Posts: 430
Joined: Tue Aug 21, 2007 2:44 pm
Location: USA (Cincinnati)
Contact:

Gadget initialization

Post by dhouston »

OSX 10.4.11 PPC
XCode 2.5
PB 4.51

The code below works under Windows, Linux & OSX Intel but I get [ERROR] The specified #Gadget is not initialized at the first SetGadgetState and all subsequent calls that depend on gadget initialization. Since my app has about a zillion gadgets, this is a problem. This is a new installation on a new G4 iMac (actually a used refurb that came with OSX 10.4.11 installed).

What is likely to be missing?

Code: Select all

    top=47
    Frame3DGadget(#PB_Any,5,top,415,49,"     Longitude        |        Latitude        |      Timezone       |")
    SpinGadget(#SPIN_LON1_CFG,8,top+19,65,25,-179,180,#PB_Spin_ReadOnly|#PB_Spin_Numeric)
    SetGadgetState(#SPIN_LON1_CFG, Val(StringField(lon,1,".")))
    SetGadgetText(#SPIN_LON1_CFG, StringField(lon,1,"."))
    SpinGadget(#SPIN_LON2_CFG,70,top+19,50,25,0,99,#PB_Spin_ReadOnly|#PB_Spin_Numeric)
    SetGadgetState(#SPIN_LON2_CFG, Val(StringField(lon,2,"."))) 
    SetGadgetText(#SPIN_LON2_CFG, StringField(lon,2,".")) 
http://davehouston.org
Mac Mini (Intel) 10.6.8 - iMac G4 (PPC) 10.4.11
Dell Dimension 2400 W98SE,W2K,XP,Vista,W7,Debian,Ubuntu,Kubuntu,Xubuntu,Fedora,Mandriva,Mint
(on swappable HDDs)
Vizio VTAB1008 - Android 3.1
MK808 miniAndroidPC (Android 4.1)
User avatar
dhouston
Enthusiast
Enthusiast
Posts: 430
Joined: Tue Aug 21, 2007 2:44 pm
Location: USA (Cincinnati)
Contact:

Re: Gadget initialization

Post by dhouston »

To add a bit more detail...

My app has 1 main window and 15 secondary windows. The main window is fine but all of the secondary windows crash either at a SetGadgetState() immediately following the gadget initialization or at a HideWindow() statement as in the code below (one of the simpler secondary windows).

Code: Select all

Procedure OpenWindowZVM()                                       ;Download ZVM file
  Protected flags
  flags = #PB_Window_WindowCentered|#PB_Window_Invisible
  OpenWindow(#WINDOW_ZVM,100,200,320,138,"Update ZX Virtual Machine Firmware",flags,WindowID(#WINDOW_MAIN))
    DisableWindow(#WINDOW_MAIN,1)
    TextGadget(#PB_Any,3,7,55,20,"ZVM File")
    StringGadget(#FILE_ZVM, 60,3,220, 22, "",#PB_String_ReadOnly)
    SetGadgetColor(#FILE_ZVM, #PB_Gadget_BackColor, RGB(255, 255, 255)) 
    ButtonGadget(#BTN_BROWSE_ZVM,285,3,30,22,"..."):GadgetToolTip(#BTN_BROWSE_ZVM, "Browse for ZVM file")
    TextGadget(#TXT_ZVM, 52,27,220, 22, "")
    CheckBoxGadget(#CHK_EMERGENCY, 15, 50, 225, 20, "EMERGENCY Update Mode")
    ButtonGadget(#BTN_OK_ZVM, 245, 52, 57, 26, "OK"):GadgetToolTip(#BTN_OK_ZVM, "Download ZVM file")
    DisableGadget(#BTN_OK_ZVM, 1)
    ButtonGadget(#BTN_CANCEL_ZVM, 245, 78, 57, 26, "Cancel")
    ProgressBarGadget(#PROGRESS_ZVM, 15, 115, 290, 10, 0, 100, #PB_ProgressBar_Smooth)
;=====CRASHES WITH "#WINDOW NOT INITIALIZED" ON NEXT LINE=====
    HideWindow(#WINDOW_ZVM,0)
  SetActiveWindow(#WINDOW_ZVM)
EndProcedure
As I noted earlier, this code runs fine under Windows, Linux and OSX Intel - it's only OSX PPC that has these problems.

I wonder whether there is some dependency issue since this is a new install of everything on a virgin system.
http://davehouston.org
Mac Mini (Intel) 10.6.8 - iMac G4 (PPC) 10.4.11
Dell Dimension 2400 W98SE,W2K,XP,Vista,W7,Debian,Ubuntu,Kubuntu,Xubuntu,Fedora,Mandriva,Mint
(on swappable HDDs)
Vizio VTAB1008 - Android 3.1
MK808 miniAndroidPC (Android 4.1)
User avatar
dhouston
Enthusiast
Enthusiast
Posts: 430
Joined: Tue Aug 21, 2007 2:44 pm
Location: USA (Cincinnati)
Contact:

Re: Gadget initialization

Post by dhouston »

This has me completely baffled. Exactly the same code runs fine under OSX 10.6.2 (Intel), several Linux distros and Windows - it crashes under OSX 10.4.11 (PPC). I've gone through the code again and again and see nothing wrong.

I'm using XCode 2.5 which, as far as I can tell, is the latest version that will work with OSX 10.4. Does anyone know of any dependency issues?
http://davehouston.org
Mac Mini (Intel) 10.6.8 - iMac G4 (PPC) 10.4.11
Dell Dimension 2400 W98SE,W2K,XP,Vista,W7,Debian,Ubuntu,Kubuntu,Xubuntu,Fedora,Mandriva,Mint
(on swappable HDDs)
Vizio VTAB1008 - Android 3.1
MK808 miniAndroidPC (Android 4.1)
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Gadget initialization

Post by IdeasVacuum »

Hi dhouston

I'm blind to Macs of all flavours so not really any help, sorry.

I can confirm that the code does run fine under Windows (XP 32bit), as a stand-alone Window. Does it run under OSX 10.4 as a stand-alone instead of a child? I could be imagining things but I thought I read somewhere that child forms can have issues on OSX anyway, though I appreciate that it would seem to be CPU related given your test results. Another potentially daft question would be, can you run any of your other PB projects on OSX 10.4?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
WilliamL
Addict
Addict
Posts: 1255
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: Gadget initialization

Post by WilliamL »

Sounds like PPC has a problem. I guess you need to find someone who is still using PPC and they will need a more complete code to try your example.
MacBook Pro-M1 (2021), Tahoe 26.1, PB 6.30b2
User avatar
dhouston
Enthusiast
Enthusiast
Posts: 430
Joined: Tue Aug 21, 2007 2:44 pm
Location: USA (Cincinnati)
Contact:

Re: Gadget initialization

Post by dhouston »

@IdeasVacuum,

Thanks for your interest. My own experience with OSX is nearly as limited as yours, having bought a Mac Mini (Intel) and iMac (PPC) in the past few months just to port my application (5300+ lines and growing) to OSX. Since all runs under everything but this flavor of OSX, I had not tried any of the secondary windows standalone but, as it happens, the one I posted above will also be the main window of a small standalone app so I tried it on its own on the suspect system with no crash.

I am becoming more and more convinced that this is either some obscure dependency issue or an equally obscure bug - but I have no clue as to how to proceed in trying to track it down. While I wanted a project to work on while recovering from surgery, I certainly did not want one this frustrating. :cry:

@WilliamL,

I think your suggestion is the only way to proceed.
http://davehouston.org
Mac Mini (Intel) 10.6.8 - iMac G4 (PPC) 10.4.11
Dell Dimension 2400 W98SE,W2K,XP,Vista,W7,Debian,Ubuntu,Kubuntu,Xubuntu,Fedora,Mandriva,Mint
(on swappable HDDs)
Vizio VTAB1008 - Android 3.1
MK808 miniAndroidPC (Android 4.1)
User avatar
dhouston
Enthusiast
Enthusiast
Posts: 430
Joined: Tue Aug 21, 2007 2:44 pm
Location: USA (Cincinnati)
Contact:

Re: Gadget initialization (Need some HELP)

Post by dhouston »

I still haven't a clue as to why my code runs fine under Windows, Linux and OSX 10.6.2 (INTEL) but crashes under OSX 10.4.11 (PPC). All child windows crash with either a "#Gadget not initialized" or "#Window not initialized".

I have zipped my source and the apps preference files and uploaded it to my website. I would appreciate it if someone with a PPC based Mac would try it on their machine. Clicking on any of the first three entries in the File menu will call a child window. You can download the ZIP file atI would really like to get some clue as to whether it's a dependency issue, a PB bug, or something about my code in the next week as I am scheduled for more surgery early next week.

If your Mac has no serial ports, there will be a message to that effect at startup but the app will still start and run.
http://davehouston.org
Mac Mini (Intel) 10.6.8 - iMac G4 (PPC) 10.4.11
Dell Dimension 2400 W98SE,W2K,XP,Vista,W7,Debian,Ubuntu,Kubuntu,Xubuntu,Fedora,Mandriva,Mint
(on swappable HDDs)
Vizio VTAB1008 - Android 3.1
MK808 miniAndroidPC (Android 4.1)
Niffo
Enthusiast
Enthusiast
Posts: 504
Joined: Tue Jan 31, 2006 9:43 am
Location: France

Re: Gadget initialization

Post by Niffo »

There are still problems with PPC version of PB. On our side, we have abandoned the idea to propose PPC version of our software to our customers. Most of our source code does not pass the compile process or crash at runtime. If i find some time to do that, i will do some reports on the bug section of this site.
Even Freak as said (in a removed topic of the bug section of this site :( ), that the PPC version of PB is not realy very followed.
Last edited by Niffo on Wed Oct 27, 2010 12:25 pm, edited 1 time in total.
Niffo
User avatar
dhouston
Enthusiast
Enthusiast
Posts: 430
Joined: Tue Aug 21, 2007 2:44 pm
Location: USA (Cincinnati)
Contact:

Re: Gadget initialization

Post by dhouston »

Thanks Niffo.

I had not followed the OSX forums until very recently when I bought first an Intel Mini and then an PPC iMac so I could port my app to OSX. Since my code is OK on everything (see signature) except PPC, my first impulse was to think it a bug in PB but I did not want to report it as a bug without more evidence. I'm still too new to OSX and especially to PPC to completely trust my judgment. And, I can understand that freak has not made PPC a priority.
http://davehouston.org
Mac Mini (Intel) 10.6.8 - iMac G4 (PPC) 10.4.11
Dell Dimension 2400 W98SE,W2K,XP,Vista,W7,Debian,Ubuntu,Kubuntu,Xubuntu,Fedora,Mandriva,Mint
(on swappable HDDs)
Vizio VTAB1008 - Android 3.1
MK808 miniAndroidPC (Android 4.1)
User avatar
dhouston
Enthusiast
Enthusiast
Posts: 430
Joined: Tue Aug 21, 2007 2:44 pm
Location: USA (Cincinnati)
Contact:

Re: Gadget initialization

Post by dhouston »

Niffo wrote:There are still problems with PPC version of PB. On our side, we have abandoned the idea to propose PPC version of our software to our customers.
I guess I'll have to do the same - I've made zero progress finding the cause of my PPC problems. As I have no other use for my PPC machine, I will loan it to an acquaintance who does have a use for it. I'll try again with the next PB release.
http://davehouston.org
Mac Mini (Intel) 10.6.8 - iMac G4 (PPC) 10.4.11
Dell Dimension 2400 W98SE,W2K,XP,Vista,W7,Debian,Ubuntu,Kubuntu,Xubuntu,Fedora,Mandriva,Mint
(on swappable HDDs)
Vizio VTAB1008 - Android 3.1
MK808 miniAndroidPC (Android 4.1)
Post Reply