Giter VIP home page Giter VIP logo

iupcocoa's Introduction

README for IUP

  IUP is a portable toolkit for building graphical user interfaces. It offers a configuration API in three basic languages: C, Lua and LED. IUP's purpose is to allow a program to be executed in different systems without any modification, therefore it is highly portable. Its main advantages are:
    * high performance, due to the fact that it uses native interface elements.
    * fast learning by the user, due to the simplicity of its API.

  Build instructions and usage are available in the IUP documentation.

  For complete information, visit IUP's web site at http://www.tecgraf.puc-rio.br/iup
  or access its documentation in the HTML folder.

(end of README)

iupcocoa's People

Contributors

cmatzenbach avatar davidphilliposter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iupcocoa's Issues

Getting started on Mac OS X

I forked your branch, and in Terminal did:

cd IupCocoa
make


The compile failed with many #include <gtk/...> file not found errors. So I coulduse some help getting started:

How do I configure for an OS X build? for an iOS build?
What do you need?

implement key press event callbacks

Iup has a key callback for most widgets called K_ANY and KEYPRESS_CB
https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_k_any.html

  1. We have to detect a native key press on each specific widget

  2. Map the native keys that were pressed to the corresponding Iup keycodes.
    https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/key.html
    Also may need to set MODKEYSTATE to record whether modifier keys are being pressed (control, alt, shift, option)

  3. Invoke the user's callback

  4. Check the user's return value from the callback and do the proper thing

This code should eventually be factored in a common place, but right now, the easiest place to start is directly code in iupcocoa_tree.m. There is a method called

  • (void) keyDown:(NSEvent*)the_event
    already there which captures all key presses when that tree instance in focus.

From there (2) you will need to find which keys are being pressed from the_event object. You will then map these to the Iup keycodes.

You invoke the user callback (3), following the usual Iup invoke callback conventions. This too should eventually be factored in a way we can call this for all widgets.

Then check the return value (4).

I think (but not completely sure):

In - (void) keyDown:(NSEvent*)the_event

If IUP_IGNORE:
return immediately to end the method and don't do anything.

if IUP_CONTINUE:
call
[super keyDown:the_event];
and return.

If IUP_DEFAULT:
return immediately to end the method and don't do anything.
(this is the same as IUP_IGNORE, which is why I'm not completely sure)

if IUP_CLOSE:
call
IupExitLoop();
and return immediately.

Some info on Cocoa key events
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/HandlingKeyEvents/HandlingKeyEvents.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.