giuspen / cherrytree

cherrytree
https://www.giuspen.net/cherrytree/
Other
3.38k stars 461 forks source link

is there a Mac version? #176

Closed wenma closed 3 years ago

wenma commented 8 years ago

is there a Mac version?

phillips321 commented 4 years ago

Is it the font for the menus (File, Edit, Formatting..) or is it the font in cherrytree itself ("Projects, "SnowLeopard", etc)?

If it is the system font, you need to edit the system fonts using something like "gtk-chtheme" (sudo port -v install gtk-chtheme). You can also add and search for gtk themes --- here is one bundle "gnome-themes-extra" (sudo port -v install gnome-themes-extra).

If it is the fonts in cherrytree itself, you change those with ("Edit" -> "Preferences" -> "Font" ).

Good luck!

So I've tried looking at gtk-chtheme but it is also fuzzy in this. It appears it's antialiasing incorrectly or something. Have a look at this screenshot, the web browser on the left is native Safari and the fonts look good. CherryTree and gtk-chtheme on right are 'blurry'

Screenshot 2020-05-29 at 13 44 36
kencu commented 4 years ago

I am not 100% certain, but I suspect that you have selected the font Arial but you may not have a full version of that font installed. I invite you to ask on the macports-users mailing list for further advice if you like https://lists.macports.org/mailman/listinfo/macports-users but I will suggest you try selecting another system font (select that Font button to the left of "Arial 10"), or consider installing some fonts. I just did a quick search on my system and I find I do have quite a few fonts installed, so perhaps one of them is making the difference here:

$ port -v installed | grep font
  dejavu-fonts @2.37_0 (active) platform='darwin 10' archs='noarch' date='2019-11-11T22:25:13-0800'
  font-adobe-75dpi @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T00:58:45-0700'
  font-adobe-100dpi @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T00:59:22-0700'
  font-adobe-utopia-75dpi @1.0.4_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T00:59:38-0700'
  font-adobe-utopia-100dpi @1.0.4_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T00:59:51-0700'
  font-adobe-utopia-type1 @1.0.4_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:00:00-0700'
  font-alias @1.0.3_0 (active) platform='darwin 10' archs='noarch' date='2018-09-21T08:39:56-0700'
  font-arabic-misc @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-12-04T12:41:06-0800'
  font-bh-75dpi @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:00:20-0700'
  font-bh-100dpi @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:00:44-0700'
  font-bh-lucidatypewriter-75dpi @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:00:57-0700'
  font-bh-lucidatypewriter-100dpi @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:01:09-0700'
  font-bh-ttf @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:01:18-0700'
  font-bh-type1 @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:01:24-0700'
  font-bitstream-75dpi @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:01:30-0700'
  font-bitstream-100dpi @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:01:38-0700'
  font-bitstream-speedo @1.0.2_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:01:47-0700'
  font-bitstream-type1 @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:01:53-0700'
  font-cronyx-cyrillic @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:01:59-0700'
  font-cursor-misc @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:02:05-0700'
  font-daewoo-misc @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:02:13-0700'
  font-dec-misc @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:02:19-0700'
  font-ibm-type1 @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:02:26-0700'
  font-isas-misc @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:02:33-0700'
  font-jis-misc @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:02:40-0700'
  font-micro-misc @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:02:47-0700'
  font-misc-cyrillic @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:02:54-0700'
  font-misc-ethiopic @1.0.3_2 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:03:00-0700'
  font-misc-meltho @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:03:08-0700'
  font-misc-misc @1.1.2_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:03:28-0700'
  font-mutt-misc @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:03:36-0700'
  font-schumacher-misc @1.1.2_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:03:44-0700'
  font-screen-cyrillic @1.0.4_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:03:51-0700'
  font-sony-misc @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:03:56-0700'
  font-sun-misc @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:04:03-0700'
  font-winitzki-cyrillic @1.0.3_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:04:10-0700'
  font-xfree86-type1 @1.0.4_1 (active) platform='darwin 10' archs='noarch' date='2019-03-29T01:04:15-0700'
  fontconfig @2.13.1_0+universal (active) platform='darwin 10' archs='i386 x86_64' date='2018-08-31T13:07:28-0700'
  freefont-ttf @20120503_0 (active) platform='darwin 10' archs='noarch' date='2019-04-28T10:08:52-0700'
  gnome-font-viewer @3.24.0_1 (active) platform='darwin 10' archs='x86_64' date='2019-11-22T21:05:01-0800'
  mkfontscale @1.2.1_0 (active) platform='darwin 10' archs='x86_64' date='2019-03-29T00:58:17-0700'
  texlive-fonts-recommended @49603_0+doc (active) platform='darwin 10' archs='noarch' date='2019-05-26T20:26:08-0700'
  texlive-fontutils @50695_0+doc (active) platform='darwin 10' archs='noarch' date='2019-07-13T14:22:56-0700'
  urw-core35-fonts @2017-08-04_0 (active) platform='darwin 10' archs='noarch' date='2019-11-11T22:26:44-0800'
  urw-fonts @1.0.7pre44_0 (active) platform='darwin 10' archs='noarch' date='2016-08-11T09:19:58-0700'
  xorg-font-util @1.3.2_0 (active) platform='darwin 10' archs='x86_64' date='2019-10-28T15:59:50-0700'
  xorg-fonts @20090102_1 (active) platform='darwin 10' archs='noarch' date='2018-09-21T08:45:14-0700'
  xorg-libfontenc @1.1.4_0 (active) platform='darwin 10' archs='x86_64' date='2019-03-02T22:18:45-0800'
  xorg-libXfont @1.5.4_2 (active) platform='darwin 10' archs='x86_64' date='2018-10-29T23:44:34-0700'
  xorg-libXfont2 @2.0.4_0 (active) platform='darwin 10' archs='x86_64' date='2019-10-12T09:18:45-0700'
  xorg-libXfontcache @1.0.5_2 (active) platform='darwin 10' archs='x86_64' date='2019-07-07T16:19:28-0700'
telemote commented 4 years ago

choosing a different font made it look better, but still not as clear as native mac app fonts.

telemote commented 4 years ago

Is it the font for the menus (File, Edit, Formatting..) or is it the font in cherrytree itself ("Projects, "SnowLeopard", etc)?

If it is the system font, you need to edit the system fonts using something like "gtk-chtheme" (sudo port -v install gtk-chtheme). You can also add and search for gtk themes --- here is one bundle "gnome-themes-extra" (sudo port -v install gnome-themes-extra).

If it is the fonts in cherrytree itself, you change those with ("Edit" -> "Preferences" -> "Font" ).

Good luck!

What Font are you using, if I may ask in this case?

kencu commented 4 years ago

looks like I have helvetica 9 selected in cherrytree, and helvetica 10 selected for the gtk2 system font. ( I guess I should harmonize those :> ).

eleyf commented 4 years ago

Thank you kindly @kencu

endermaz41 commented 4 years ago

Hi, Getting a message at startup "A newer version is available 0.39.4" Click on the message box, but no other window pops up. Tried reinstalling, but nothing changes

Did get this error : "dbus[2253]: Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded! dbus fail, maybe a firewall problem, centralized instances disabled libc.prctl not available, the process name will be python and not cherrytree"

However, already did this "sudo port load dbus"

kencu commented 4 years ago

If you do this, you will get the new version, and any other MacPorts updates thaave come along since you last did it:

sudo port -v selfupate
sudo port -v upgrade outdated

I didn't realize there was an auto-prompt message in CherryTree -- we are meant to disable that in MacPorts to prevent confusion, and let MacPorts handle it, so I'll see if I can look into that.

kencu commented 4 years ago

Re: your dbus issue. I haven't noticed any issues launching dbus so far, but there are millions of combinations of software so always could be something.

I would do what you did sudo port load dbus, and if that doesn't fix it, then restart the computer and do the same thing again. If that still doesn't fix is, please consider asking for help on the macports users mailing list https://lists.macports.org/mailman/listinfo/macports-users, or opening a trac ticket https://trac.macports.org/

endermaz41 commented 4 years ago

ty -

"sudo port -v selfupate" failed "sudo port -d selfupdate" succeeded.

The prompt is gone but still empty mac screen. Will open a ticket soon.

kencu commented 4 years ago

well that's a different problem then. Glad you updated successfully.

  1. did the last version work for you?
  2. after you updated, does the new version not work for you? If not, does it still not work after you restart (that just makes all weird stuff better ... ).
  3. what happened to dbus. Is that OK now?
kencu commented 4 years ago

BTW -- if sudo port -v selfupdate failed, lets do make sure you got that part fixed. You have to be able to run that to completion.

If that did fail, I'm not certain how sudo port -d selfudate would then succeed, but I would have to see what actually was the error to know.

endermaz41 commented 4 years ago

The last version was working.

"sudo port -v selfupdate" now worked

Logged out, restarted. when I do sudo cherrytree, it flashes in maximized form for one second. Then But still getting the " : "dbus[2253]: Dynamic session lookup supported .." I know it is loaded because when typing this to terminal "launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist". It says "service already loaded"

kencu commented 4 years ago

please don't run sudo cherrytree -- just run cherrytree or double click on the cherrytree application icon in /Applications/MacPorts/CherryTree.app. That should solve your dbus problem at least. (dbus has to be running for the local user, and the system. When you run cherrytree with sudo, there would need to be a local dbus running for the root user, which there is not).

Let's see how far you get with that!

endermaz41 commented 4 years ago

Doing cherrytree still gave me the same error.

But clicking on "/Applications/MacPorts/CherryTree.app" worked

Thank you

kencu commented 4 years ago

well, you're in business! It all came down to sudo cherrytree -- look at that :>

BTW, it should work when you type cherrytree as well... mine does. Later on if you want to sort out what is what, feel free to report back exactly what happens when you do type that.

endermaz41 commented 4 years ago

Ok, It still a little buggy to restart cherrytree. When I quit everything, and clicked on cherrytree, it flashed again. Then typed cherrytree into terminal, nothing, but let it run. Then I clicked on the app icon. It came back on. In terminal, it says "3 rise existing hidden in systray" So have to disable hiding it automatically. Because I can't bring those windows to the front

kencu commented 4 years ago

something is weird with your system. Once again, restart it to clear out all those (I guess) running instances of cherrytree that you have in your -- systray ? what is that? the dock? -- and if this wackiness is still happening to you, feel free to open a ticket for some macOS X11 specific help. This doesn't really sound like it has anything to do with cherrytree specifically, on the face of it.

txe commented 4 years ago

cherrytree has options Enable System Tray Docking and Start Minimized in the System Tray. Can it be the case?

kencu commented 4 years ago

Yes, that is it! I had not enabled those options before myself, but indeed, when i turn on that preference, I get the "quick screen flash then disappears" issue that @endermaz41 had, and then a blank screen. And then the "2 rise existing" message when I opened multiple instances.

And then some issues trying to get back to the preferences screen to turn that off again actually.

So those options, at present, don't seem to play well with maOS.

@endermaz41 -- it is a cherrytree issue (I guess) -- I don't know exactly how to make this work, so perhaps I should find some way to disable that option, at least on the X11 build (haven't tried the +quartz build to see if it does the same).

kencu commented 4 years ago

In the end, I had to edit ~/.config/cherrytree/config.cf and set these two options manually off again, to get going:

systray = False
start_on_systray = False

I guess -- we should not respect those settings if they happen to be "True" on macOS, and grey out the options in the preferences dialog -- unless someone smarter than I am with python knows how to make this work like it is supposed to work.

endermaz41 commented 4 years ago

Yes, that was it. All is well now.

One last question Kencu. I'm not at all familiar with X11. You mentioned in an earlier post, thar once X11 is installed. there are 1000's of applications that I can install. Is there a directory/list to see what I can install ? Or is it that I can install any linux package if I have the source or something along those lines ?

kencu commented 4 years ago

I tried setting HAS_SYSTRAY to False here:

cons.py
72:HAS_SYSTRAY = not (XDG_CURRENT_DESKTOP in os.environ and os.environ[XDG_CURRENT_DESKTOP] == "Unity")

but for some reason, the preference still shows up in the preferences dialog box even if I do. So deeper...

txe commented 4 years ago

@kencu I suppose everyone uses your package, so maybe just disabling systray on macos is fine. If some user finds it not ok, we can then think about it.

kencu commented 4 years ago

Yes, that was it. All is well now.

One last question Kencu. I'm not at all familiar with X11. You mentioned in an earlier post, thar once X11 is installed. there are 1000's of applications that I can install. Is there a directory/list to see what I can install ? Or is it that I can install any linux package if I have the source or something along those lines ?

Pretty much the entire GNOME set of applications is available (that's like dozens), plus a great many that you might be familiar with from Ubuntu, gnucash, the KDE series, -- there are a great great many, most of them current.

if you type "port search gnome" you'll get some of them.

But that is only scratching the surface -- there are literally hundreds more, not directly under gnome. All in all, MacPorts has 20,000 ports. Go nuts!

kencu commented 4 years ago

@kencu I suppose everyone uses your package, so maybe just disabling systray on macos is fine. If some user finds it not ok, we can then think about it.

can you help me sort out why setting this doesn't seem to do it?

cons.py
72:HAS_SYSTRAY = False
kencu commented 4 years ago

Or is it that I can install any linux package if I have the source or something along those lines ?

This is getting off topic for the issue here, but yes, it is very simple to write a Portfile to install software, which is the easiest way, as using a Portfile, MacPorts automatically sets up your build environment, adds all the right link flags, sets up your compiler, etc, etc.

I saw CherryTree on Ubuntu, and it took about 15 minutes to get it into MacOS. The MacPorts build file looks like this if you're curious.

txe commented 4 years ago

Turns out there is no code which turn off the systray. @giuspen , what do you think if I add code to disable systray for macos?

giuspen commented 4 years ago

@txe sure!

ForeverRainbow commented 4 years ago

I did add code to disable the systray when it was detected as missing, wonder why it doesnt trigger on macos?

Edit: Unless this is the python version here and I am being dumb :p

txe commented 4 years ago

@ForeverRainbow , don't be so hard on yourself :) but it was about python

txe commented 4 years ago

@kencu , I put a fix by #980

disasmwinnie commented 4 years ago

file INSTALL cannot make directory "/usr/share/cherrytree/language-specs":

This is probably due System Integrity Protection introduced with El Capitan. It disallows writing to certain directories like /usr, even as root. Only certain core services are allowed to do so, probably something like the app store. To quote from the Wikipedia article:

Among the protected directories are: /System, /bin, /sbin, /usr (but not /usr/local).

You could go ahead and disable SIP, or better, the Makefile should install the OSX version to /usr/local/bin, as it is the only directory in $PATH and is writable. I have no experience with CMake. If somebody could direct me into the right direction (or affected line), I could create a PR.

The OSX install section in /future also lacks gtk icons (I think it was the gnome-icon-theme brew package).

alexBaiJW commented 4 years ago

Is there something wrong? `make install [ 0%] Built target man_pages [ 77%] Built target 7za_static [ 81%] Built target spdlog [ 96%] Built target cherrytree_shared [ 97%] Built target cherrytree [100%] Built target run_tests Install the project... -- Install configuration: "Release" /Users/xx/cherrytree/future/scripts/set_icon_macos.py:4: UninitializedDeallocWarning: leaking an uninitialized object of type NSImage Cocoa.NSWorkspace.sharedWorkspace().setIcon_forFileoptions(Cocoa.NSImage.alloc().initWithContentsOfFile_(sys.argv[1].decode('utf-8')), sys.argv[2].decode('utf-8'), 0) or sys.exit("Unable to set file icon") Traceback (most recent call last): File "/Users/xx/cherrytree/future/scripts/set_icon_macos.py", line 4, in Cocoa.NSWorkspace.sharedWorkspace().setIcon_forFileoptions(Cocoa.NSImage.alloc().initWithContentsOfFile_(sys.argv[1].decode('utf-8')), sys.argv[2].decode('utf-8'), 0) or sys.exit("Unable to set file icon") AttributeError: 'str' object has no attribute 'decode' -- Installing: /usr/share/cherrytree/language-specs CMake Error at cmake_install.cmake:40 (file): file INSTALL cannot make directory "/usr/share/cherrytree/language-specs": No such file or directory.

make: *** [install] Error 1 `

txe commented 4 years ago

The issue with installing in '/usr' maybe related to

if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
  set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "..." FORCE)
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

@alexBaiJW, @msgpeek wrote the possible reason of the issue, Temporary, you can use the following command to change the installation dir

cmake -DCMAKE_INSTALL_PREFIX=/usr/local ../future
alexBaiJW commented 4 years ago

How to install it as a mac application? Currently we can just run it from the shell

disasmwinnie commented 4 years ago

There is no DMG, as there are no packages for other distros/OSes. I doubt there will be until there is a release of the CPP-port (maybe the devs can say more).

You can use CMD+Space to start it, or dock it so you have a permanent shortcut. Or is there a particular feature you are missing, like having a button in the launcher?

If a missing launcher info is your issue, you could also use temporary workarounds yourself like https://mathiasbynens.be/notes/shell-script-mac-apps.

disasmwinnie commented 4 years ago

@txe @giuspen is packaging a priority now? If yes, is there any desired folder structure for /future or should I follow the approach of /future/{windows,debian,osx}?

I still have a McBook for couple of weeks, could take care of DMG.

giuspen commented 4 years ago

Hi @msgpeek for now you have to stay inside of future for future specific stuff, soon I'm going to reorganize so that the future becomes the present. Packaging is not priority for now but a packaging script (or whatever the files are) could come useful

minkuan commented 3 years ago

@kencu mac ports cherrytree works, but it cannot input chinese

kencu commented 3 years ago

The MacPorts install using the python version has a launchable application bundle in /Applications/MacPorts. When we do the c++ version it will be in the same place.

Why it won't accept Chinese characters is over-my-head, though. No idea about that. Do any other versions (Ubuntu, etc) accept Chinese characters?

It's python 2.7 code, so I presume you start by seeing if any script accepts Chinese characters.

Sorry I'm not more useful there.

giuspen commented 3 years ago

@minkuan it is likely a decoding issue but won't be addressed on the 0.39.4. Once you will be able to test the latest 0.99.x if the issue is still there raise a dedicated GitHub issue and describe in detail how to reproduce

georgesmith2017 commented 3 years ago

Guys, here are the instructions that were posted directly as part of the repo. The short version:

Follow this link and scroll down to "Build Cherrytree on MacOS. You may have to install some dependencies in addition to the ones listed but it worked for me without a hitch.

After installing the dependencies with Homebrew, I set these two variables for the compiler to find the brew version of curl, just in case: export LDFLAGS="-L/usr/local/opt/curl/lib" export CPPFLAGS="-I/usr/local/opt/curl/include"

Then build everything

The last instruction is a bit wrong: ./build/cherrytree You are actually in the build folder, so you just need ./cherrytree.

Created an alias in ~/.zshrc for convenience - detaches from the terminal after you run it from the command line: alias ch='/usr/local/bin/cherrytree </dev/null &>/dev/null &'

Good luck :)

kencu commented 3 years ago

That is for the c++ version of course, not the python version.

For the python version you do this:

sudo port -v install xorg-server cherrytree

Later on, when it is ready, I'll add the c++ version to MacPorts, and no doubt that version will be in homebrew too.

alexBaiJW commented 3 years ago

When run the "cmake ../" command, I got the error below:

-- CT_VERSION = 0.99.30
Build tests ON, auto run ON
-- Checking for module 'gtkmm-3.0'
--   Package 'pangomm-1.4', required by 'gtkmm-3.0', not found
CMake Error at /usr/local/Cellar/cmake/3.19.3/share/cmake/Modules/FindPkgConfig.cmake:553 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.19.3/share/cmake/Modules/FindPkgConfig.cmake:741 (_pkg_check_modules_internal)
  CMakeLists.txt:103 (pkg_check_modules)
giuspen commented 3 years ago

Try: brew update brew doctor

giuspen commented 3 years ago

I will try shortly to have a cherrytree formula accepted in homebrew, if this succeeds there will be also a so called bottle, a pre built binary, in homebrew, installable with simply brew install cherrytree

itsacdee commented 3 years ago

That's some amazing stuff

alexBaiJW commented 3 years ago

Try: brew update brew doctor

Has no effect.

brew search pangomm
==> Formulae
pangomm ✔                                                                              pangomm@2.42 ✔
giuspen commented 3 years ago

cherrytree is in homebrew now. brew update brew install cherrytree