Can UIProgressView be inherited? - uiprogressview

Can UIProgressView be inherited?
I created a sub-class of UIProgressView; it works well.
But the console shows the following errors when the sub-class calls [super init] or [super initWithFrame:frame]:
<Error>: CGContextAddPath: invalid context 0x0.
<Error>: clip: invalid context 0x0.
<Error>: CGContextDrawLinearGradient: invalid context 0x0.
<Error>: CGContextAddPath: invalid context 0x0.
<Error>: clip: invalid context 0x0.
<Error>: CGContextDrawLinearGradient: invalid context 0x0.
How can I solve this problem?

Related

What does the error "1:1Typechecker Internal Error: User type in value position" mean?

I was going through the Rotatable Wallet tutorial on the Kadena beginner tutorial, and I ran into this error: "1:1Typechecker Internal Error: User type in value position". What does this mean? And where exactly is the error occurring?

How do I debug errors like this in Codenameone?

I have an app that works well on the simulator. I did an Android build and installed on a device. Now , several functionalities don't work. The debug log I receive contain several errors of this sort
[EDT] 0:23:31,275 - Exception in Ziemozi version 1.0
[EDT] 0:23:31,275 - OS and
[EDT] 0:23:31,275 - Error java.lang.NullPointerException: Attempt to invoke virtual method 'void com.codename1.ab.l.n(int)' on a null object reference
[EDT] 0:23:31,276 - Current Form null
[EDT] 0:23:31,276 - Exception: java.lang.NullPointerException - Attempt to invoke virtual method 'void com.codename1.ab.l.n(int)' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.codename1.ab.l.n(int)' on a null object reference
at com.codename1.g.j.a(InfiniteScrollAdapter.java:156)
at com.codename1.g.j.a(InfiniteScrollAdapter.java:143)
at com.codename1.ab.aa.t(InfiniteContainer.java:177)
at com.codename1.ab.aa$5.run(InfiniteContainer.java:193)
at com.codename1.ab.r.n(Display.java:1298)
at com.codename1.ab.r.l(Display.java:1242)
at com.codename1.ab.r.k(Display.java:1130)
at com.codename1.ab.ao.run(RunnableWrapper.java:120)
at com.codename1.impl.b$1.run(CodenameOneThread.java:60)
How do I debug this or how does it arise so I can fix it?
This happens when one of the components returned from InfiniteContainer is null. E.g. you did something like:
public Component[] fetchComponents(int index, int amount);
// ...
return cmps;
}
cmps is a valid array that's bigger than 0 but one of its elements is null.

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42601]:

I am new to postgresql/postgis and am unable to solve this problem. I have lat long values which I retrieve by the click event and split using
lonlat.split(",");
But when I pass them into the following query, I receive a syntax error.
$sql1=$conn->prepare("select id,ST_Contains(geom,GeomFromText(4326,'POINT(".$lon." ".$lat.")')) as yes_within from public.".$layername);
$sql1->execute();
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at end of input LINE 1: ...om,GeomFromText('POINT( )',4326)) as yes_within from public. ^' in C:\xampp\htdocs... Stack trace: #0 PDOStatement->execute() #1 {main} thrown in C:\xampp\htdocs... on line 22
From the error
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at end of input LINE 1: ...om,GeomFromText('POINT( )',4326)) as yes_within from public. ^' in C:\xampp\htdocs... Stack trace: #0 PDOStatement->execute() #1 {main} thrown in C:\xampp\htdocs... on line 22
That means that even though you think you're getting them from split, you're not getting them from split. You're concatenating an empty string. The problem isn't in PostgreSQL.
Aside from that, don't construct a point that way. Instead use,
ST_MakePoint(long,lat)::geography
Which creates a geography not a geometry and it does it without text-parsing.

Remove GtkMenuItem from GtkMenu in app-indicator using c

I'm building an application that uses an app-indicator. The menu should be updated dynamically. Adding items works great using gtk_menu_shell_append, however for removing I can't find a gtk_menu_shell_* function. I've found gtk_container_remove and calling it with the gtkmenuitem and it's parent results in the following warnings:
GLib-GObject-WARNING **: invalid unclassed pointer in cast to `GtkWidget'
Gtk-CRITICAL **: gtk_widget_get_parent: assertion `GTK_IS_WIDGET (widget)' failed
Gtk-CRITICAL **: gtk_container_remove: assertion `GTK_IS_CONTAINER (container)' failed
I've also tried calling gtk_widget_destory and get errors like this:
GLib-GObject-WARNING **: invalid unclassed pointer in cast to `GtkWidget'
Gtk-CRITICAL **: gtk_widget_destroy: assertion `GTK_IS_WIDGET (widget)' failed
Note that both methods actually remove the menu item from the menu.
What is the correct way to remove a GtkMenuItem from a GtkMenu without generating these errors/warnings?
Apparently the widget was wrong somehow (don't understand why this would still work though).

How to make non-Localizable SplashScreen in WPF

I'm just adding internationalization to my next WPF application, and have followed the instructions here.
I then noticed that there would be a fair amount of duplication in the satellite DLL, so marked the images that won't be localized in the .csproj as
<Localizable>False</Localizable>
Unfortunately, one of my resources is used in a SplashScreen thus:
SplashScreen ss = new SplashScreen("Images/splash.png");
ss.Show(false);
And this throws an exception when the Show call is executed. Here's the exception output
A first chance exception of type 'System.IO.IOException' occurred in WindowsBase.dll
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Step into: Stepping over method without symbols 'System.RuntimeType.CreateInstanceImpl'
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Step into: Stepping over method without symbols 'MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateInstance'
A first chance exception of type 'System.Xaml.XamlObjectWriterException' occurred in System.Xaml.dll
Step into: Stepping over method without symbols 'System.Windows.Markup.WpfXamlLoader.Load'
A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
Additional information: 'The invocation of the constructor on type 'MainWindow' that matches the specified binding constraints threw an exception.' Line number '4' and line position '9'.
When I remove the False line it works again.
Is there any way to load the resource I want, which is stored in test.unlocalizable.g.resources?

Resources