Skip to content
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

GtkApplication Root #400

Closed
ccoupe opened this Issue Feb 7, 2018 · 18 comments

Comments

Projects
None yet
3 participants
@ccoupe
Copy link
Contributor

ccoupe commented Feb 7, 2018

I thought I had an issue for this but I guess not.

We don't use GtkApplication - but if we did - we could have menus - File for Shoes apps (like Shoes/osx has) and like OSX - Linux/Gtk could send new shoes launches to the single Shoes process as new windows. OSX does this so the code is there in Shoes - part of the app vs APP[] thing. It's a bigger change you might think. For example when you double click a .pdf file - you open the pdf reade app. If you double click a different pdf - it opens in the same reader. Web browsers do it for html files.

@ccoupe ccoupe added the Enhancement label Feb 7, 2018

@ccoupe ccoupe added this to the 3.3.7 milestone Feb 7, 2018

@ccoupe

This comment has been minimized.

Copy link
Contributor Author

ccoupe commented Feb 7, 2018

This would also be a good place to add the multiple monitor support - they are related in odd ways.

ccoupe added a commit that referenced this issue Feb 10, 2018

for issue #400, branch 'gapp'
* menus: true can be added to Shoes.app styles/hash default is false.
* WIP jiggering shoes_native_app_open in gtk.c to display menu
  and shoes content.
@ccoupe

This comment has been minimized.

Copy link
Contributor Author

ccoupe commented Feb 11, 2018

Branch gapp (gtk) can request menus at Shoes.app time. Numerous and serious issues to resolve but lets get the api in order. @BackOrder cares about these things and it's better to get it right before a lot of code gets written. I offer:

Shoes.app menus: true do
  mb = app.menubar
  # add Help and Help->About to menubar
  helpmenu = menu "Help"
  helpmenu << menuitem "About" do
   alert "Version 12 of Menu Test App"
  end
  mb << helpmenu
  # replace default File -> Quit handler  with our block
  filemenu = mb[0]
  filemenu.each do |fmi|
    if fmi.name == 'Quit' 
      fmi = menuitem "Musical Quit" do
        alert "I can't quit her - \"Blood, Sweat and Tears\". Use decoration"
      end
    end
  end
end

Feedback requested.

It may not be possible to modify menus text once they are created and of course OSX has it's opinion on what's possible. You should know that the Gtk code I've got appears to be amenable to the suggested API, i.e. enough works to know something.

@dredknight

This comment has been minimized.

Copy link
Contributor

dredknight commented Feb 11, 2018

Can I help with something?

@ccoupe

This comment has been minimized.

Copy link
Contributor Author

ccoupe commented Feb 12, 2018

@dredknight - of course you can help with feedback. Thought Exercise, no coding for you, yet.

The Cobbler screen has a 'button' panel - sort of toolbar-ish. What if there was a real menubar on top with "File", "Cobbler" and the Cobbler menu had menu entries for "Info", "Gems".... with key accelerators like control-i and control-g . Obviously it would save visual space in cobbler - it has too many buttons already and we need some more Those could be menus and menuitems. It would extend Shoes into a very normal GUI toolkit for those that want it.

I have a concerns about what self is in the {block} attached to the menuitem dispatch.

@ccoupe

This comment has been minimized.

Copy link
Contributor Author

ccoupe commented Feb 12, 2018

There is a possibility of real tool-bar strips with ittty-bity icons I need to keep that option open in this re-design.

@dredknight

This comment has been minimized.

Copy link
Contributor

dredknight commented Feb 12, 2018

You are correct that cobbler can be arranged a bit more neatly. A menu-ish type thing sounds great.

For example (all mentions refer to latest 3.3.6 r3173 on windows) "Install gempack" and "Jailbreak gems" should be inside "Install gems". It is intuitive that all gem related operations have to be there.

A cobbler bug I noticed is that if you select "Clear Image cache" twice (one after another) you get a C++ error.

Multiple errors appear in console when "Profile" button is selected.

no implicit conversion of nil into String
@ccoupe

This comment has been minimized.

Copy link
Contributor Author

ccoupe commented Feb 16, 2018

Here is a small script and the screen shot.

Shoes.app menus: true, width: 300, height: 200 do  
  mb = menubar
  helpmenu = menu "Help"
  aboutitem =  menuitem "About" do
    puts "ABOUT!!"
  end
  helpmenu << aboutitem
  mb << helpmenu
end

menu2

There are many issues - why are there scrollbars ? A known bug and wide ranging. Who built the File Menu - the script didn't? That requires that you know about Shoes OSX and the mac's global menu. On osx Shoes has a global menu with File and and a few entries under it, Load and Quit. When the hoes app close via the window decorator, that global menu is still there and Load will start a new app. People have hooked up their text editor via applescript to use it. All menu changes use the global menu on osx. It can't be removed or changed from Shoes OSX. Just can't.

So, Shoes menus on Gtk (Linux and Windows) creates a File menu, and File->Quit for you, sort of like
OSX. There is a lot to do. Next to do is a minimal OSX cocoa implementation so that little script works there. Then I'll know enough to fill out the menu api for Shoes.

ccoupe added a commit that referenced this issue Feb 17, 2018

for #400, menus on branch gapp
* Can call a user block on menu selection. Self may be wrong.
* Good enough to try working on osx to see if proof of concept
  is viable.

ccoupe added a commit that referenced this issue Feb 17, 2018

on #400 osx compiles and ignore new menu api
* much thinking is required. Much control is possible. Many things
  we more forward thinking than the code actually does.
@ccoupe

This comment has been minimized.

Copy link
Contributor Author

ccoupe commented Feb 17, 2018

Now that I've looked at the OSX code for startup and menus there's a lot I'd like to change. There are global menu items that haven't worked tor 4 years or more. Somethings that never worked and plenty of good intentions. Much pondering.

ccoupe added a commit that referenced this issue Feb 18, 2018

ccoupe added a commit that referenced this issue Feb 21, 2018

for #400, branch gapp - menus
* API is minimal, just enough for a might not ever be used feature.
* some important shoes stopper bugs not fixed
* menu.insert has many problems
* menu.replace, menubar.insert and menubar.replace not written

ccoupe added a commit that referenced this issue Feb 25, 2018

for #400, menus api is good enough
* not everything that could be done, needs to be done,
 Some will disagree but they haven't used the current code to build
 menus.  Like vs need.
* much code movement and jiggering.
@ccoupe

This comment has been minimized.

Copy link
Contributor Author

ccoupe commented Feb 27, 2018

I have a rough write up of the menu api Future work on the branch gapp will have to wait until I get out of the hospital and feel like working on Shoes - late March if all goes well.

ccoupe added a commit that referenced this issue Mar 1, 2018

ccoupe added a commit that referenced this issue Mar 1, 2018

ccoupe added a commit that referenced this issue Mar 1, 2018

for #400, #401 branch gapp
* register gtk application works properly. systray is happier. Me too.
* at startup, before shoes_native_init we parse shoes.yaml for App_Name
  and Theme #401.
* new  C global 'char *shoes_app_name' , default "Shoes"
  should be used for all window titles a few other places (systray)
  that assume "Shoes" - Menubar for example really needed that.
  Should make creating applications that hide shoes much easier.
  Not completly working because it uses the crap code I wrote long ago
  for changing title.

ccoupe added a commit that referenced this issue Mar 3, 2018

ccoupe added a commit that referenced this issue Apr 7, 2018

for #400 - settings object working
* tied to shoes_world_t  but has a Ruby class
* mostly unused. That will change.

ccoupe added a commit that referenced this issue Apr 7, 2018

for #400 - settings methods are working.
* see Tests/gapp/app1.rb

ccoupe added a commit that referenced this issue May 3, 2018

ccoupe added a commit that referenced this issue May 5, 2018

ccoupe added a commit that referenced this issue May 5, 2018

ccoupe added a commit that referenced this issue May 5, 2018

@ccoupe

This comment has been minimized.

Copy link
Contributor Author

ccoupe commented May 5, 2018

I modified Cobbler to use the new menu system. Awesome Mockup. I am beyond pleased.
menu-cobbler

I added non functional menu items for the Advanced packaging (.deb) for me. This where I can integrate the long neglected exe-shoes code. Yay. And the linux-shoes and osx-shoes variations as well. Sharp eyes might notice a menu for Theme.

@dredknight

This comment has been minimized.

Copy link
Contributor

dredknight commented May 5, 2018

Looks great!

Sharp eyes might notice a menu for Theme.

Does this mean I can put a colour or two to spice it up?

@BackOrder

This comment has been minimized.

Copy link
Collaborator

BackOrder commented May 5, 2018

This is awesome and much better than the previous layout.

@ccoupe

This comment has been minimized.

Copy link
Contributor Author

ccoupe commented May 5, 2018

Does this mean I can put a colour or two to spice it up?

Theme support is the next feature I want to add to 3.3.7 - issue #354, #401 and others. It's CSS - if you know gtk css you can modify the appearance of lots of things. It's a fair sized task so it won't happen soon. There are lots of gtk themes that can be downloaded and installed on a linux system. I'm hoping to reuse them for Shoes. If so, Cobbler needs to browse them and switch to one. The screen shot is just a mockup for that. Lot's to do first.

This is awesome and much better than the previous layout.

I've tweaked Cobbler since. Menus even more awesome when you see them in action as the default for any app/script . Download the 3.3.7 beta. To set the default, create a shoes.yaml in the shoes root (next to the cshoes.exe for windows in the Program Files x86 place)

App_Name: Foobar
Theme: Sierra-light
Use_Menus: true 

Only the last line matters for current purposes. The 3.3.7 download also includes the multiple monitor stuff.

ccoupe added a commit that referenced this issue May 18, 2018

huge commit - app titles, icons,via Settings issue #400
* cleanup
* more things that have_menu affects.

ccoupe added a commit that referenced this issue May 18, 2018

for #400 - remove shoes_app_name global var
* don't confuse os.window with slot>os.canvas when menus
  are being displayed

ccoupe added a commit that referenced this issue May 18, 2018

on #400, rename shoes.yaml to startup.yaml
* check curdir, then shoes exe location for startup.yaml

ccoupe added a commit that referenced this issue May 23, 2018

for #400, add linux-merge packaging
* gui supports checkboxes, cleaner to edit
* still some minor things to tweak.

ccoupe added a commit that referenced this issue May 28, 2018

for #400 merge packaging mostly working windows,osx,linux
* now for cleanup/refactor see build-bsd and bld.rb

ccoupe added a commit that referenced this issue May 30, 2018

on #400 - separate gui and nav from what needs to
* be displayed and called. Centralize code instead of
  duplication
* fix central code for gem name handling.
* add 'required' field to templates.
* only linux and freebsd(experiment) so far

ccoupe added a commit that referenced this issue May 31, 2018

for #400 -merge packaging
* osx working
* fixed prequisite checking

ccoupe added a commit that referenced this issue May 31, 2018

@ccoupe

This comment has been minimized.

Copy link
Contributor Author

ccoupe commented Jun 1, 2018

Does anyone need a small task to do in Ruby? Merge packaging in Linux/Bsd uses the fpm command with is a ruby gem with a bin command line. It would be nice if Shoes could into the gem instead of having to having the user manual execute a fpm command line. There are gotcha's to just shelling out to run the fpm command. See here

@dredknight

This comment has been minimized.

Copy link
Contributor

dredknight commented Jun 2, 2018

I can do it but I am not sure that I understand what needs to be done. So FPM is a gem we have to go without using? From the code you have provided which are the functions/lines that need to be done with other tools?

is it just this line -

yield "Please do './fpm.sh' in #{scriptp}" if blk

and what the commented line below it has to do with it?

@ccoupe

This comment has been minimized.

Copy link
Contributor Author

ccoupe commented Jun 2, 2018

The block comment is the code I want to make work. Call the gem insternals without going through
a shell call.

I'm not sure fpm can be installed on Windows. On linux it installes the gem and then it installs a command in bin/ so it's called like anyother command line tool. the script in bin/ then calls the gem bin/fpm.rb (somehow - missing clarity). which conspire to parse the command line and run the code in the gem. The starting script is

#!/usr/bin/env ruby_executable_hooks
#
# This file was generated by RubyGems.
#
# The application 'fpm' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0.a"

if ARGV.first
  str = ARGV.first
  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
    version = $1
    ARGV.shift
  end
end

load Gem.bin_path('fpm', 'fpm', version)

which is kind of what 'require' does.

@dredknight

This comment has been minimized.

Copy link
Contributor

dredknight commented Jun 9, 2018

FYI I built a centos environment this Friday where I will be testing the code. I will let you know once it is ready.

ccoupe added a commit that referenced this issue Jun 19, 2018

many things #400
* osx buttons can be resized
* much noodling around for Windows resizing issues - not fixed.
* fewer whines from Gtk 3.20+
@ccoupe

This comment has been minimized.

Copy link
Contributor Author

ccoupe commented Jan 16, 2019

Closing 3.3.7 issues.

@ccoupe ccoupe closed this Jan 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.