Revision history for gtkdialogDocTips9.8


Revision [33338]

Last edited on 2023-02-24 06:56:43 by zigbert
Additions:
[[HomePage]] > [[SoftwareIndex|Software Index]] > [[SoftwareDevelopment|Development]] > [[gtkdialog|gtkdialog]] > [[gtkdialogDocTips|Tips and Tricks]]
===@@**#%[[gtkdialogDocTips9.7|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.9|Next ❱❱❱]]#%**@@===
Deletions:
[[HomePage]] > [[SoftwareIndex Software Index]] > [[SoftwareDevelopment Development]] > [[gtkdialog gtkdialog]] > [[gtkdialogDocTips Tips and Tricks]]
@@**#%[[gtkdialogDocTips9.7|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.9|Next ❱❱❱]]#%**@@


Revision [32951]

Edited on 2020-08-04 20:16:48 by zigbert
Additions:
====9.8 Hotkeys====
Here follows 3 different ways of defining hotkeys
**<window>**
An ##<action>## signal inside the ##<window>## widget gives the most direct hotkey
##<action signal="key-press-event" condition="command_is_true( [ $(( ${KEY_MOD} & 5 )) = 5 ] && [ $KEY_RAW = 0x1b ] && echo true )">Refresh:varDATE</action>##
SHIFT's state is held by 0th bit and CTRL state by 2nd bit of ##$KEY_MOD## variable (?????C?S) , so, in order to read their state correctly, we need to discard the rest of bits by logical AND: ##$(( $KEY_MOD & 5 ))##. If we would want SHIFT alone, it would be ##$(( $KEY_MOD & 1)) = 1##, only CTRL - ##$(( $KEY_MOD & 4 )) = 4## and so on.
see [[http://murga-linux.com/puppy/viewtopic.php?t=94163]] for more depth.
**<menuitem>**
Menuitems can set both accelerator key and modifier (SHIFT is 1, CTRL is 4 and ALT is 8 ). For a full list of accelerator key values check [[http://git.gnome.org/browse/gtk+/plain/gdk/gdkkeysyms.h]]
##<menuitem stock-id="gtk-quit" accel-key="0x51" accel-mods="4">##
**<button>**
You can activate buttons by pressing keyboard combinations. simply add the attribute ##use-underline##. If set, an underline in the text indicates the next character should be used for the mnemonic accelerator key.
##<button use-underline="true"><label>_Refresh</label></button>##
The defined char in the ##<label>## + 'alt' key will activate given ##<action>##.
@@**#%[[gtkdialogDocTips9.7|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.9|Next ❱❱❱]]#%**@@
Deletions:
====9.7 Drag'n drop====
Gtkdialog has limited support for drag'n drop. This is what we've learnt by now:
**Drag from file browser to ##<entry>## widget.**
%%(language-ref)
export test="
<entry>
<default>Drag a directory from Rox</default>
</entry>"
gtkdialog -p test
%%
**Move items in list by drag'n drop.** ([[http://www.murga-linux.com/puppy/viewtopic.php?t=107816 More info in this thread]])
Using the reorderable option in the ##<tree>## has some strange behavior. For example will items get swallowed when moving them onto another item. The workaround restores the list if the user moves item onto, instead of in between 2 other items... This code by [[MochiMoppel]] is a result of 2 cracked nuts:
1) When moving an item in the list the ##$PTR_Y## variable returns 0. A return value >0 gives us the info that the user is clicking rather than moving.
2) Normally ##<action>## defined for a widget are processed __before__ built-in actions. The trick is to process a user defined ##<action>## __after__ a built-in action. An invisible button allows the code to run a user defined save action __after__ a built-in reorder action.
@@**#%[[gtkdialogDocTips9.6|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.8|Next ❱❱❱]]#%**@@


Revision [32950]

The oldest known version of this page was created on 2020-08-04 20:04:06 by zigbert
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki