-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash in osmain....? #80
Comments
Hi! yes there is a bug in Therefore, I suspect your crash is for other reason (division by zero). If the problem persists, try to identify in your app part. If finally, is in NAppGUI part, please provide a minimum code to reproduce it. Regards! |
I tried with exactly the same code in 1.4 as in 1.3, and it still fails on 1.4. The 'naphello' compiles and runs OK. However, it seems only to crash on mouse moves, once a control (table) is selected. If I remove the tables, it does not crash, but there are other issues; I cannot resize the window, nor can I move the focus in my photo collection grid with the cursor keys. All of these work in 1.3. Another thing: in 1.3 the app I build is shown in the context switcher (cmd-tab); in 1.4 these are not shown. Is it perhaps not building true desktop apps? The screenshot on failure is as follows. |
If you think it would help, I’ll send you the source code? |
Further to the above... I replaced the HelloWorld's main.c with my source file, and it compiles and runs better (e.g., now there is a context switcher icon). However, it still crashes, now on
line 956 in i_onMove(TableView *view, Event *e) called from i_onMoved (line 105, listener_pass_event). So... seems like there is a problem with moves/resizing as well as building, as the process setting up a new application for Mac in https://nappgui.com/en/guide/newprj.html and https://nappgui.com/en/guide/win_mac_linux.html#h4 do not produce the same result as when building as if it were one of the demo apps. Here is the screen shot. Any ideas? |
Umm its strange. Its a division by zero crash. Please share the code to debug it. Thanks! |
Here...
Change the test image file in get_image() to something you have.
…---------------------------------
Sam
Den lör 30 dec. 2023 kl 09:59 skrev Francisco García Collado <
***@***.***>:
Umm its strange. Its a division by zero crash. Please share the code to
debug it. Thanks!
—
Reply to this email directly, view it on GitHub
<#80 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMAVI5QKJM25YGZDWD2GCW3YL7CW7AVCNFSM6AAAAABBGR2UEKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZSGQ3TQMJRGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Sent via email, but cannot see the code.... here it is again (cannot upload .c files, change extension from .txt to .c) |
I found the problem. Its a division by zero for TableView controls without columns. Its fixed in this commit be0790c
If you just want a list of images, you can also use a ListBox, very lightweight control Thank you very much for your reports. They help to improve to code. |
Well, now it doesn't crash! However, there is another difference between 1.3 and 1.4: the view is clipping correctly (top/bottom) on 1.3, but not on 1.4. When I scroll, the photos are happily shown all the way up to the top window bar, and bottom window border. Also, when following the build a new app instructions, it still seems like it's not building a proper window app; no icon in the context switcher, and I cannot resize the window at all. Ideas? (when substituting for one of the demo apps, it is showing the icon + allow resize) |
For application icon, your project needs a https://nappgui.com/en/guide/newprj.html#h2 NAppGUI build system will take the icon and link it with the app in each platform. You can use the icons in examples or design your own. https://nappgui.com/en/guide/resources.html#h10 After create the Also, please review your project source tree looks more or less like that:
The main
And the
You can download and test this demo package: |
Now we are getting somewhere! The app builds fine now... except that it's not picking up the icon. I've tried with NR_NONE or NRC_EMBEDDED which both should do it, but my app doesn't get it. The NAppDice app does, however. I'm now trying to get rid of the scrolling problem.... it looks like this: Maybe the order of the controls matter? It working in 1.3 ... |
It seems there is something wrong with your installation. I have clone, build, install nappgui. Later create a new project from scratch. Follow these instructions: Important I think the initial dimensions of view control are soo big. If the window is resizable the view control will expand. Clone, build and install NAppGUI in new location
Create an empty fintus_prj folder with this unique CMakeLists.txt
Run CMake. This will create a new fintus folder with a demo project.
Just change the code in Important find_package() can find older installations. Review the NAppGUI message
|
Hi again, and thanks for your patience! I did exactly like you said above, and all completed perfectly without error messages. The last was:
So everything seemed fine... and the HelloWorld app builds OK, and runs OK. BUT the icon is still missing! I checked with Xcode, and it shows: So it definitely recognises the logo.icns file... I will now check with the real Funtus code, instead of the helloworld. Cheers, |
I think I found out why it doesn't pick the icon... the project files were on a removable drive, and some Apple security measure (maybe nrc or some other executable doesn't have the rights to access the other drive?) prevents it from picking up the icons. I tested it with you fintus_prj.zip and left it on the main drive (Macintosh HD) ---- and now the icon shows as it should. This leaves only one problem left: the scrolling. Your fintus also scrolls incorrectly on my Mac, so something is still different between your system (you screenshot seemed perfect) and mine. What could that be? And how could I track it down? Cheers, |
I really i don't known what is happen. Looking your code i see you create a lot of panels. It's not necessary. For your design, only one Panel (the main) is neccesary with a (1,3) layout. In the middle cell (0,1) you put a (3,1) sublayout with the view and two tables. Main Layout Please review the Layout Chapter When your GUI grow, you can change the (0,0) cell with a Sublayout. The same for the (0,2) information label. Use subpanels only is necessary if you want to switch different layouts at runtime I known its not easy at the beginning. Good luck |
You are probably right. I will try to simplify the design tomorrow.Cheers,Sam30 dec. 2023 kl. 21:17 skrev Francisco García Collado ***@***.***>:
I really i don't known what is happen. Looking your code i see you create a lot of panels. It's not necessary. For your design, only one Panel (the main) is neccesary with a (1,3) layout. In the middle cell (0,1) you put a (3,1) sublayout with the view and two tables.
Main Layout
(0,0) Label (filters and stuff)
(0,1) Sublayout (3,1) (Tree, View, Tree). layout_hexpand(1,0) (only view will resize)
(0,2) Information
Please review the Layout Chapter
https://nappgui.com/en/gui/layout.html
https://nappgui.com/en/howto/guihello.html#h13
When your GUI grow, you can change the (0,0) cell with a Sublayout. The same for the (0,2) information label.
Use subpanels only is necessary if you want to switch different layouts at runtime
https://nappgui.com/en/howto/guihello.html#h15
I known its not easy at the beginning. Good luck
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Sorry to bother you again...
As you can see the view does not obey its layout boundaries; it is scrolling above to the window bar, and is wider than it should be. It is working correctly in 1.3. Any ideas? Anything I can test/modify? |
Ummm. It's a curious case. The view is correctly dimensioned (the scrollbars are ok). But the view is drawing outside its boundaries. Something happens with the clipping. Are you using macOS Sonoma? Please tell me about your macOS/Xcode/processor. I'll try to reproduce the same environment. I have tested NAppGUI 1.4 in Ventura and Lion. |
Fixed in this commit ac038f9 Apple has changed the default NSView clipping in Sonoma: https://indiestack.com/2023/06/view-clipping-sonoma/ The code works in NAppGUI 1.3 because this version uses Thanks for reports and patience! |
Tested and works! Por fin, you may close this issue! |
My project running well (OK, compiles. runs, but not yet working as it should) in 1.3, but fails in 1.4 with message:
Demo apps run well.
What could be wrong? The CMakeList file is:
I am on the mac using XCode. Tried using makefiles as well with same result.
ADDED:
I noticed that the crash may originate in a function i_OnMove, so I added
with a simple myMove:
NOW, the crash is immediately on launching, in i_create creating the window, on the line window_OnMoved(...));, with the same error message.
ADDED 2:
I added the same window_onMoved and myMove to the demo app drawbig.c, and now the app crashes on start with a NULL pointer access, window, file: oswindow.m at line 526.
Is something seriously wrong with my installation of 1.4?
The text was updated successfully, but these errors were encountered: